/**
 * 设备地图样式
 */

/* 地图容器 */
.equipment-map-view {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
}

.equipment-map-container {
    flex: 1;
    position: relative;
    background: #e5e3df;
    height: 100%;
    /* 使用 100vh / zoom 来补偿响应式 zoom 缩放的影响 */
    min-height: calc(100vh / var(--dynamic-zoom, 0.85) - 200px);
}

#equipment-map-container {
    width: 100%;
    height: 100%;
    min-height: inherit;
}

/* 地图控制面板 */
.map-controls {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 999;
    padding: 0;
    max-width: 360px;
    min-width: 260px;
}

/* 控制面板按钮样式 */
.map-controls .ant-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 控制面板分组标题 */
.map-controls > .ant-space > .ant-space-item > div > div:first-child {
    font-weight: 500;
    margin-bottom: 8px;
    color: #262626;
}

/* 地图图例 */
.map-legend {
    position: absolute;
    bottom: 24px;
    left: 16px;
    z-index: 999;
    padding: 0;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* 地图统计面板 */
.map-stats {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 999;
    padding: 0;
    min-width: 260px;
}

/* 地图卡片通用样式 */
.map-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 18px;
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.map-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.map-card__icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0f5ff, #e0f2fe);
    font-size: 18px;
}

.map-card__title {
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
}

.map-card__subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.map-card__badge {
    margin-left: auto;
    border-radius: 999px;
    font-size: 12px;
    padding: 0 10px;
}

.map-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-card__section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-card__section-title {
    font-weight: 500;
    font-size: 13px;
    color: #1f2937;
}

.map-card__divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(226, 232, 240, 0), rgba(148, 163, 184, 0.7), rgba(226, 232, 240, 0));
}

.map-card__actions .ant-btn {
    border-radius: 10px;
    height: 34px;
}

.map-card__section--actions .map-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.map-card__actions--inline .ant-btn {
    flex: 1;
    min-width: 0;
}

.map-card__full-button {
    margin-top: 10px;
    width: 100%;
}

.map-card__full-button.ant-btn {
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-card__header {
    cursor: grab;
}

.map-card__header--dragging {
    cursor: grabbing;
}

.map-card__header-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.map-card__header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    flex-shrink: 0;
}

.map-card__header-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 8px;
    background: rgba(226, 232, 240, 0.7);
    color: #1f2937;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}

.map-card__header-btn:hover {
    background: rgba(96, 165, 250, 0.35);
    color: #0f172a;
}

.map-card__header-btn:active {
    background: rgba(59, 130, 246, 0.45);
}

.map-card__header-btn:focus {
    outline: none;
}

.map-card__badge {
    flex-shrink: 0;
}

.map-card--collapsed {
    gap: 10px;
}

.map-card--collapsed .map-card__subtitle {
    display: none;
}

.map-card--collapsed .map-card__body {
    display: none;
}

.map-card__segment .ant-radio-button-wrapper {
    border-radius: 10px;
    margin-right: 8px;
    margin-bottom: 4px;
}

.status-filter-group .ant-checkbox-wrapper {
    width: 100%;
    padding: 6px 8px;
    border-radius: 10px;
    transition: background 0.2s;
}

.status-filter-group .ant-checkbox-wrapper:hover {
    background: rgba(226, 232, 240, 0.5);
}

.legend-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.7);
    gap: 12px;
}

.legend-label {
    font-weight: 500;
    color: #1f2937;
}

.legend-chip {
    border-radius: 999px !important;
    font-weight: 600;
}

.map-stats__summary {
    display: flex;
    align-items: center;
    gap: 16px;
}

.map-stats__summary-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-stats__summary-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.map-stats__summary-sub {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}

.map-stats__summary-hint {
    font-size: 12px;
    color: #6b7280;
}

.map-stats__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.map-stats__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.7);
}

.map-stats__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #374151;
}

.map-stats__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.map-stats__value {
    font-weight: 600;
    color: #111827;
}

/* 自定义标记样式 */
.custom-marker {
    position: relative;
    width: 30px;
    height: 40px;
    cursor: pointer;
}

.custom-marker::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: currentColor;
    clip-path: polygon(50% 100%, 0% 20%, 0% 0%, 100% 0%, 100% 20%);
    border-radius: 50% 50% 50% 0;
}

.custom-marker::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
}

/* 加载遮罩 */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.map-add-equipment-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 16px;
    z-index: 1200;
    pointer-events: none;
}

.map-add-equipment-overlay__content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
    color: #fff;
    pointer-events: auto;
}

.map-add-equipment-overlay__info {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.map-detail-health-score {
    margin-top: 16px;
}

.map-detail-health-score__body {
    min-height: 260px;
}

.map-detail-health-score__body .health-score-placeholder {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8c8c8c;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .map-controls {
        max-width: 280px;
    }

    .map-stats {
        min-width: 220px;
    }
}
