/* 地图模块特定样式 */
.map-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

h2 {
    margin: 20px 0;
    color: #2c3e50;
}

.search-panel {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.input-group {
    flex: 1;
    min-width: 200px;
}

.address-container {
    position: relative;
    width: 100%;
}

/* 定位按钮样式 */
.location-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #3498db;
    color: white;
    border: none;
    padding: 5px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.location-btn:hover {
    background: #2980b9;
}

.address-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
}

.suggestion-item:hover {
    background-color: #f5f5f5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.map-select {
    width: 100%;
    margin: 15px 0;
}

#selectMapContainer {
    height: 250px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input {
    width: auto;
    margin-right: 5px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.btn-export {
    background-color: #27ae60;
}

.btn-export:hover {
    background-color: #219653;
}

.result-panel {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
}

tr:hover {
    background-color: #f1f1f1;
}

/* 地址单元格样式 */
.address-cell {
    position: relative;
}

.address-text {
    display: block;
    margin-bottom: 5px;
}

.nav-buttons {
    display: flex;
    gap: 5px;
}

.nav-link {
    display: inline-block;
    padding: 2px 6px;
    background: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: #219a52;
    text-decoration: none;
}

.pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.page-btn {
    margin: 0 5px;
    padding: 5px 10px;
    border: 1px solid #ddd;
    background-color: #fff;
    cursor: pointer;
    border-radius: 3px;
}

.page-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

#mapContainer {
    height: 400px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .search-panel {
        flex-direction: column;
    }
    
    .input-group {
        width: 100%;
    }
    
    /* 优化移动端企业列表显示 */
    .table-container {
        overflow-x: auto;
    }
    
    #resultTable {
        font-size: 14px;
    }
    
    #resultTable th, #resultTable td {
        padding: 8px 10px;
    }
    
    /* 企业名称和地址在移动端采用多行显示，避免过长 */
    #resultTable td:nth-child(2), #resultTable td:nth-child(3) {
        max-width: 150px;
        white-space: normal;
        word-break: break-word;
    }
    
    /* 移动端下企业列表采用网格布局，更紧凑 */
    @media (max-width: 480px) {
        #resultBody tr {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            border-bottom: 1px solid #ddd;
            padding: 10px 0;
        }
        
        #resultBody td {
            border: none;
            padding: 5px 10px;
        }
        
        /* 序号和企业名称占满宽度 */
        #resultBody td:nth-child(1),
        #resultBody td:nth-child(2) {
            grid-column: 1 / -1;
            font-weight: bold;
        }
        
        /* 添加标签说明 */
        #resultBody td::before {
            content: attr(data-label);
            font-weight: bold;
            margin-right: 5px;
            color: #666;
        }
        
        /* 隐藏表头 */
        #resultTable thead {
            display: none;
        }
    }
}
