/* ==========================================================
   cases.html 样式表 — 智慧农业典型案例地图
   ========================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #e9f0f5;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ===== 双栏主容器 ===== */
.dashboard {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: row;
}

/* ===== 左侧地图区域 ===== */
.map-panel {
    flex: 0 0 65%;
    height: 100%;
    position: relative;
    background-color: #d4e3ec;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
    background: #cbdbe6;
}

/* ===== 右侧列表区域 ===== */
.list-panel {
    flex: 0 0 35%;
    height: 100%;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(0,0,0,0.08);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

/* ===== 列表头部 ===== */
.list-header {
    background: white;
    padding: 16px 18px;
    border-bottom: 3px solid #e74c3c;
    box-shadow: 0 1px 4px rgba(0,0,0,0.02);
    flex-shrink: 0;
}

.list-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e2f3e;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.list-header h3 .brand {
    color: #e74c3c;
    font-weight: 700;
}

/* ===== 表格容器 ===== */
.table-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 12px 12px;
    scroll-behavior: smooth;
}

.table-wrapper::-webkit-scrollbar {
    width: 5px;
}
.table-wrapper::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}
.table-wrapper::-webkit-scrollbar-thumb {
    background: #e74c3c;
    border-radius: 10px;
}

/* ===== 表格样式 ===== */
.project-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.project-table th {
    background: #2c3e4e;
    color: white;
    padding: 12px 10px;
    font-weight: 600;
    font-size: 0.75rem;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.project-table th:nth-child(1) { width: 45%; }
.project-table th:nth-child(2) { width: 25%; }
.project-table th:nth-child(3) { width: 30%; }

.project-table td {
    padding: 10px 10px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
    color: #1e2f3e;
    word-break: break-word;
}

.project-table tr:hover td {
    background-color: #fff5e8;
    cursor: pointer;
    transition: 0.1s;
}

.project-table tr.highlight td {
    background-color: #fff0e0;
}

/* ===== 类别标签（单字母类，g=设施大棚 f=大田 l=养殖 c=综合平台 i=灌溉 t=追溯 o=其他） ===== */
.g, .f, .l, .c, .i, .t, .o {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    font-style: normal;
    background: #eef2f5;
    color: #2c3e50;
    white-space: nowrap;
}

.g { background: #e8f8f0; color: #1e6f3f; border-left: 3px solid #2ecc71; }
.f { background: #fef5e7; color: #b45f1b; border-left: 3px solid #f39c12; }
.l { background: #fdedec; color: #c0392b; border-left: 3px solid #e74c3c; }
.c { background: #e8eaf6; color: #3b4c9b; border-left: 3px solid #9b59b6; }
.i { background: #e0f7fa; color: #00695c; border-left: 3px solid #00acc1; }
.t { background: #fff3e0; color: #e65100; border-left: 3px solid #ff9800; }
.o { background: #e9f0f5; color: #5d6e7e; border-left: 3px solid #95a5a6; }

/* ===== 自定义地图标记 ===== */
.custom-flag-marker {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
}

/* ===== 地图提示框 ===== */
.leaflet-tooltip.custom-tooltip {
    background-color: rgba(255, 255, 252, 0.98);
    border: 1px solid #e74c3c;
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
    color: #1e2f3e;
    font-size: 12px;
    line-height: 1.45;
    padding: 10px 16px;
    max-width: 280px;
    min-width: 230px;
    backdrop-filter: blur(3px);
    pointer-events: none;
    font-weight: 400;
    white-space: normal;
}

.leaflet-tooltip.custom-tooltip::before {
    border-top-color: #e74c3c;
}

.tooltip-title {
    font-weight: bold;
    font-size: 13px;
    color: #c0392b;
    margin-bottom: 5px;
    border-left: 3px solid #e74c3c;
    padding-left: 8px;
}

/* ===== 加载遮罩 ===== */
#jiazai {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 24px;
    border-radius: 48px;
    z-index: 9999;
    font-size: 14px;
    backdrop-filter: blur(8px);
    pointer-events: none;
    font-weight: 500;
    letter-spacing: 1px;
    border-left: 3px solid #e74c3c;
    transition: opacity 0.2s;
}

/* ===== 公司水印（品牌展示） ===== */
.watermark {
    position: absolute;
    bottom: 18px;
    left: 18px;
    background: rgba(10, 20, 28, 0.75);
    backdrop-filter: blur(12px);
    color: #f5f5f5;
    padding: 6px 14px;
    border-radius: 24px;
    font-size: 11px;
    z-index: 1000;
    border-left: 3px solid #e74c3c;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
}

.watermark strong {
    color: #ff6b6b;
}

/* ===== 移动端适配 ===== */
@media (max-width: 780px) {
    .dashboard {
        flex-direction: column;
    }
    .map-panel {
        flex: 0 0 55%;
        min-height: 55%;
    }
    .list-panel {
        flex: 0 0 45%;
        width: 100%;
        border-left: none;
        border-top: 3px solid #e74c3c;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    }
    .list-header {
        padding: 10px 14px;
    }
    .list-header h3 {
        font-size: 1rem;
    }
    .project-table th,
    .project-table td {
        padding: 8px 6px;
        font-size: 11px;
    }
    .watermark {
        bottom: 10px;
        left: 10px;
        font-size: 9px;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    .map-panel {
        flex: 0 0 50%;
        min-height: 50%;
    }
    .list-panel {
        flex: 0 0 50%;
    }
    .project-table th,
    .project-table td {
        font-size: 10px;
        padding: 6px 4px;
    }
    .watermark {
        bottom: 10px;
        left: 10px;
        font-size: 9px;
        padding: 4px 10px;
    }
}
