/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 14px;
}

body, html {
    height: 100%;
    overflow: hidden;
}

/* ========== OL地图默认组件隐藏 ========== */
.ol-custom-overviewmap,
.ol-overviewmap,
.ol-scale-line,
#mouse-position {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

.ol-zoomslider {
    right: 13px !important;
    position: absolute !important;
}

/* ========== 核心容器 ========== */
#container {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#panoramaContainer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    z-index: 1000 !important;
}

/* ========== 图层控制 ========== */
.layerControlContainer {
    position: fixed;
    top: 110px !important;
    right: 10px;
    z-index: 997;
}

.layerControlToggle {
    width: 35px;
    height: 35px;
    cursor: pointer;
    border: none;
    padding: 4px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    display: inline-block;
    -webkit-tap-highlight-color: transparent;
}

.layerControlToggle:hover {
    background: #f5f5f5;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.layerControlToggle:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.layerControlToggle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0.8);
    pointer-events: none;
    display: block;
}

.layerControlPanel {
    position: absolute;
    top: calc(100% + 3px);
    right: 0;
    width: 200px;
    background: #fff;
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    display: none;
}

.layer-panel-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #f5f5f5;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    z-index: 10;
    will-change: transform, height;
}

.layer-panel-close-btn:hover {
    background: #009688;
    color: #fff;
    transform: scale(1.05);
}

.layer-panel-close-btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.layerTree {
    padding: 8px;
    margin-top: 4px;
    list-style: none;
}

/* ========== 测量工具 ========== */
#measureTool {
    position: fixed !important;
    top: 200px !important;
    right: 5px !important;
    transform: none !important;
    flex-direction: column !important;
    padding: 3px !important;
    gap: 3px !important;
    z-index: 990 !important;
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
    height: 120px !important;
}

.measure-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: none !important;
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}

.measure-btn svg {
    width: 16px !important;
    height: 16px !important;
    pointer-events: none;
}

#clearMeasure {
    display: none;
}

#measureTooltip {
    width: 80px;
    position: absolute;
    z-index: 991;
    background: rgba(251, 238, 238, 0.7);
    color: rgb(235, 17, 17);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    pointer-events: none;
}

.map-tip {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 14px;
    border-radius: 4px;
    z-index: 5;
    pointer-events: none;
    white-space: nowrap;
    display: none;
}

/* ========== 地块列表面板 ========== */
#togglePanel {
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 998;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #009688;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#left-bottom-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 95%;
    max-width: 400px;
    height: 40vh;
    min-height: 30vh;
    max-height: 70vh;
    background: #fff;
    z-index: 997;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -2px 15px rgba(0,0,0,0.15);
    overflow: hidden;
    pointer-events: auto;
}

#left-bottom-panel.show {
    transform: translateX(-50%) translateY(calc(100% - 40vh));
}

.panel-dragger {
    width: 40px;
    height: 5px;
    background: #ddd;
    border-radius: 3px;
    margin: 8px auto;
    cursor: grab;
    z-index: 1000;
    touch-action: none;
    pointer-events: auto;
}

.panel-dragger:active, .panel-dragger:hover {
    cursor: grabbing;
    background: #bbb;
}

.panel-header {
    background: #009688;
    color: #fff;
    padding: 2px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    border-radius: 20px 20px 0 0;
    z-index: 100;
}

.panel-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
}

.panel-content {
    height: calc(100% - 48px);
    overflow-y: auto !important;
    padding: 0 10px 10px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* ========== 地块筛选与列表 ========== */
.search-bar {
    display: flex;
    padding: 0 10px;
    gap: 8px;
    margin: 10px 0;
}

.search-bar input {
    flex: 1;
    height: 40px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

.search-bar .search-btn {
    width: 80px;
    height: 40px;
    background: #009688;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.land-type-filters {
    display: flex;
    gap: 6px;
    padding: 0 5px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.land-type-btn {
    min-width: auto;
    max-width: 100px;
    width: fit-content;
    min-height: 38px;
    border: 1px solid #e5e7eb;
    background: #f6f7f9;
    border-radius: 10px;
    padding: 2px 4px;
    font-size: 16px;
    color: #333;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    position: relative;
    z-index: 1;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.land-type-btn.active {
    background: #009688;
    color: #ffffff;
    border-color: #009688;
    box-shadow: 0 2px 4px rgba(0, 150, 136, 0.2);
}

.land-type-btn:active {
    transform: scale(0.96);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.land-type-btn:hover:not(.active) {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.land-type-text {
    pointer-events: none;
    line-height: 1.2;
    font-size: 13px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    font-weight: 800;
}

.tabs {
    display: flex;
    padding: 10px;
    gap: 10px;
}

.tab {
    flex: 1;
    height: 36px;
    border: none;
    background: #fff;
    color: #333;
    border-radius: 10px;
    cursor: pointer;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    font-weight: 700;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.tab.active {
    background: #009688;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 150, 136, 0.2);
}

.tab:active {
    transform: scale(0.98);
}

.tab:hover:not(.active) {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.land-list {
    padding: 0 10px;
}

.land-item {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.land-item .btn-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.land-item .btn-group button {
    flex: 1;
    height: 36px;
    border: none;
    background: #009688;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
}

.pagination {
    padding: 10px;
    text-align: center;
    margin-top: 10px;
}

/* 原有弹窗改造成覆盖列表的详情页 */
#mobile-popup {
    position: fixed;      /* 固定定位，覆盖整个屏幕/列表 */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;       /* 确保覆盖地块列表（优先级拉满） */
    display: none;       /* 默认隐藏 */
    flex-direction: column;
    overflow: hidden;
}

/* 显示详情页（替代原有show类） */
#mobile-popup.show {
    display: flex;
}

/* 弹窗关闭按钮（保留，可选） */
#popup-closer {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: #eee;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
}

/* 新增：返回按钮样式 */
#popup-back-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 12px;
    border: none;
    background: #009688; /* 和列表标题栏同色系 */
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
}

/* 详情内容区（适配全屏） */
#popup-content {
    flex: 1;
    padding: 60px 15px 15px; /* 给顶部按钮留空间 */
    overflow-y: auto;        /* 内容超出可滚动 */
    font-size: 14px;
    line-height: 1.8;
}

/* 可选：地块列表容器（确保被弹窗覆盖） */
#land-list-container { /* 替换成你实际的地块列表容器ID */
    position: relative;
    z-index: 999;
}

/* 备案信息样式 - 适配移动端 */
.record-info {
    position: fixed;
    bottom: 2px; /* 避开地块列表面板 */
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px; /* 移动端小字体，不占空间 */
    color: #fff; /* 白色文字，适配地图背景 */
    background: rgba(0, 0, 0, 0.5); /* 半透明黑背景，提升可读性 */
    padding: 4px 8px;
    z-index: 99; /* 确保在地图上方，但低于交互面板 */
    pointer-events: none; /* 禁止点击，不影响地图交互 */
    white-space: nowrap; /* 防止文字换行 */
    overflow: hidden;
    text-overflow: ellipsis; /* 极端窄屏时省略 */
}
