/* ===========================================================
 * BM.search 控件样式
 * 仿 leaflet-bar 风格，与缩放/测量按钮统一视觉
 * =========================================================== */

/* 控件容器：白底圆角阴影，与缩放控件一致 */
.bm-search-control {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    background: #fff;
}

/* 折叠按钮（28×28 仿 leaflet-bar） */
.bm-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    line-height: 28px;
    color: #333;
    text-decoration: none;
    background: #fff;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 4px 4px 0 0;
}
.bm-search-toggle:hover {
    background: #f4f4f4;
    color: #c62828;
}
.bm-search-toggle svg {
    display: block;
    pointer-events: none;
}

/* 展开面板 */
.bm-search-panel {
    width: 280px;
    background: #fff;
    border-radius: 0 0 4px 4px;
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", Arial, sans-serif;
    animation: bmSearchFade 0.15s ease-out;
}
@keyframes bmSearchFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 输入栏 */
.bm-search-input-wrap {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 4px;
    gap: 4px;
}
.bm-search-input {
    flex: 1;
    min-width: 0;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    color: #333;
    outline: none;
    background: #fff;
    transition: border-color 0.15s;
}
.bm-search-input:focus {
    border-color: #c62828;
}
.bm-search-input::placeholder {
    color: #999;
    font-size: 12px;
}
.bm-search-btn {
    flex-shrink: 0;
    height: 28px;
    padding: 0 10px;
    background: #c62828;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.bm-search-btn:hover { background: #b71c1c; }
.bm-search-btn:active { background: #8d1414; }
.bm-search-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: #999;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s, background 0.15s;
}
.bm-search-close:hover { color: #c62828; background: #f5f5f5; }

/* 结果列表 */
.bm-search-results {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
    font-size: 12.5px;
    color: #333;
}
.bm-search-results li {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.12s;
    line-height: 1.5;
}
.bm-search-results li:hover { background: #fff8e1; }
.bm-search-results li:last-child { border-bottom: none; }
.bm-search-row-title {
    font-weight: 600;
    color: #1a3a5c;
    font-size: 13px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bm-search-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    padding: 1px 6px;
    background: #eef2f7;
    color: #2c6e9e;
    border-radius: 2px;
    text-transform: uppercase;
}
.bm-search-row-desc {
    color: #666;
    font-size: 11.5px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bm-search-row-coord {
    color: #999;
    font-size: 10.5px;
    font-family: Consolas, Monaco, monospace;
}
.bm-search-row-sub {
    color: #888;
    font-size: 10.5px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bm-search-empty {
    padding: 12px 10px;
    text-align: center;
    color: #999;
    font-size: 12px;
    line-height: 1.6;
    cursor: default;
}
.bm-search-empty:hover { background: transparent; }

/* 底部署名 */
.bm-search-foot {
    padding: 4px 10px;
    font-size: 10px;
    color: #bbb;
    text-align: right;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 4px 4px;
}

/* 落点 marker */
.bm-search-marker {
    background: transparent;
    border: none;
}

/* 滚动条美化（webkit） */
.bm-search-results::-webkit-scrollbar { width: 6px; }
.bm-search-results::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.bm-search-results::-webkit-scrollbar-thumb:hover { background: #999; }

/* 移动端（≤640px）适配：保持按钮位置不变，缩小面板 */
@media (max-width: 640px) {
    .bm-search-panel {
        width: 240px;
    }
    .bm-search-input { font-size: 13px; }
    .bm-search-results { max-height: 200px; }
}
