* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    height: 100vh;
    overflow: hidden;
    background-color: #f5f7fa;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar {
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10;
    display: flex;
    flex-direction: column;
    max-height: 40vh;
    overflow: hidden;
    border-right: 1px solid #e0e0e0;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #1a73e8, #4285f4);
    color: white;
}

.sidebar-header h1 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.search-container {
    position: relative;
}

.search-container>input{
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background-color: rgba(255,255,255,0.9);
    height: auto;
}

.search-input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.selected-ports-block{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #5f6368;
    font-size: 1rem;
}

.location-search-container {
    display: flex;
    margin-bottom: 10px;
}

.location-search-input {
    flex: 1;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 88px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background-color: rgba(255,255,255,0.9);
    height: auto;
}

.location-search-btn {
    background: #34a853;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
    height: auto;
    font-size: 0.95rem;
}

.location-search-btn:hover {
    background: #2e8b47;
}

/* 分类按钮样式 */
.category-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.category-btn {
    flex: 1;
    min-width: 60px;
    padding: 8px 5px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 500;
}

.category-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.category-btn.active {
    background: rgba(255,255,255,0.9);
    color: #4285f4;
    border-color: #4285f4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.port-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.port-count {
    color: #5f6368;
    font-size: 0.85rem;
    margin-bottom: 10px;
    padding-left: 5px;
    font-weight: 500;
}

.port-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.port-item {
    padding: 15px;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
}

.port-item:hover {
    background: #f1f8ff;
    border-color: #d2e3fc;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* 路线列表容器 */
.route-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.route-list-header {
    padding: 15px;
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    border-radius: 8px;
    margin-bottom: 15px;
}

.route-list-header h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-count {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
}

/* 路线搜索和筛选 */
.route-search-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.route-search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.route-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa0a6;
    font-size: 14px;
    pointer-events: none;
}

.route-search-input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.route-search-input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

.route-type-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #202124;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.route-type-select:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

.route-search-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.route-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}

.route-search-btn:active {
    transform: translateY(0);
}

.route-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.route-item {
    padding: 10px 15px;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: relative;
}

.route-item:hover {
    background: #f1f8ff;
    border-color: #4285f4;
    box-shadow: 0 4px 8px rgba(66, 133, 244, 0.15);
    transform: translateY(-2px);
}

.route-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.route-item-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 150px;
}

.route-item-title i {
    color: #4285f4;
    font-size: 14px;
}

.route-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #202124;
}

.route-item-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.route-type,
.route-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #5f6368;
}

.route-type i,
.route-count i {
    color: #9aa0a6;
    font-size: 12px;
}

.route-item-description {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.8rem;
    color: #5f6368;
}

.route-item-description i {
    color: #9aa0a6;
    font-size: 12px;
    margin-top: 2px;
}

.route-item-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.route-item-status.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.route-item-status.inactive {
    background: #ffebee;
    color: #c62828;
}

.port-item.active-start {
    border-color: #4285f4;
    background: #e8f0fe;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.port-item.active-end {
    border-color: #fbbc05;
    background: #fef7e0;
    box-shadow: 0 0 0 2px rgba(251, 188, 5, 0.2);
}

.port-name {
    font-weight: 600;
    color: #202124;
    margin-bottom: 8px;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.port-route-btn {
    background: none;
    border: none;
    color: #4285f4;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
}

.port-route-btn:hover {
    background: rgba(66, 133, 244, 0.1);
    transform: scale(1.1);
}

.port-code {
    background: #4285f4;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.port-details {
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
    margin-bottom: 8px !important;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-weight: 500;
    color: #838282;
}

.port-details span:nth-child(1) {
    max-width: 220px;
}

.port-fee{
    background-color: #a8a8a8;
    padding: 8px 8px;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    max-height: 34px;
}

.port-fee:hover {
    background-color: #8a8a8a;
}

/* 距离显示样式 */
.port-distance {
    background-color: #ffebee;
    padding: 8px 8px;
    color: #ea4335;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    max-height: 34px;
    font-weight: bold;
    border: 1px solid #ffcdd2;
    white-space: nowrap;
    line-height:18px;
}

.port-distance:hover {
    background-color: #ffcdd2;
}

.route-actions {
    display: flex;
    gap: 8px;
}

.route-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-weight: 500;
    height: auto;
}

.route-btn i {
    margin-right: 5px;
}

.set-start {
    background: #4285f4;
    color: white;
}

.set-start:hover {
    background: #3367d6;
}

.set-end {
    background: #fbbc05;
    color: white;
}

.set-end:hover {
    background: #e6a800;
}

#map {
    flex: 1;
    height: 60vh;
    width: 100%;
}

.route-status {
    position: fixed;
    top: 220px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 0.9rem;
    z-index: 99999999;
    display: none;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 清除路线按钮 - 显示在编辑点位按钮旁边 */
.clear-route-btn {
    background: #ea4335;
    color: white;
    border: none;
    white-space: nowrap;
    padding: 0 15px;
    height: 40px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: none; /* 默认隐藏，只有路线展示时才显示 */
    flex-direction: row;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(234, 67, 53, 0.2);
    pointer-events: auto !important;
    z-index: 1000;
    position: relative;
}

.clear-route-btn:hover {
    background: #d33b2c;
    box-shadow: 0 4px 8px rgba(234, 67, 53, 0.3);
    transform: translateY(-1px);
}

.clear-route-btn:active {
    transform: translateY(0);
}


.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ea4335;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    z-index: 99999999;
    display: none;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: 500;
}

/* 分页器样式 */
.pagination-container {
    margin-top: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-height: 56px;
    display: flex;
    align-items: center;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #5f6368;
    flex-shrink: 0;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #4285f4;
    color: #4285f4;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.9rem;
    color: #5f6368;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 自定义弹窗样式 */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #202124;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #5f6368;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e0e0e0;
    color: #202124;
}

.modal-body {
    padding: 20px;
}

.modal-port-info {
    margin-bottom: 20px;
}

.modal-port-info h4 {
    margin: 0 0 10px 0;
    color: #202124;
    font-size: 1.1rem;
}

.modal-port-info p {
    margin: 0;
    color: #5f6368;
    font-size: 0.9rem;
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.modal-btn.set-start-btn {
    background: #4285f4;
    color: white;
}

.modal-btn.set-start-btn:hover {
    background: #3367d6;
}

.modal-btn.set-end-btn {
    background: #fbbc05;
    color: white;
}

.modal-btn.set-end-btn:hover {
    background: #e6a800;
}

/* Mapbox Popup 样式优化 */
.mapboxgl-popup {
    z-index: 100;
}

.mapboxgl-popup-content {
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    padding: 0;
    overflow: hidden;
}

.mapboxgl-popup-close-button {
    right: 8px;
    top: 8px;
    font-size: 16px;
    color: #5f6368;
    background: rgba(255,255,255,0.9);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mapboxgl-popup-close-button:hover {
    background: #e0e0e0;
    color: #202124;
}

.custom-popup {
    min-width: 280px;
    max-width: 90vw;
}

.popup-title {
    font-size: 18px;
    color: #202124;
    font-weight: 700;
    border-bottom: 1px solid #e8eaed;
    padding: 15px 20px;
    text-align: center;
    background: #f8f9fa;
}

.popup-content {
    padding: 15px 20px;
}

.popup-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.popup-table th, .popup-table td {
    padding: 8px 0;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

.popup-table th {
    width: 30%;
    color: #5f6368;
    font-weight: normal;
}

.popup-table td {
    color: #202124;
}

.popup-footer {
    text-align: center;
    margin-top: 12px;
}

.popup-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4264fb;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    transition: background-color 0.2s;
    width: 100%;
}

.popup-button:hover {
    background-color: #3151d6;
}

/* 移动端控制按钮 */
.mobile-controls {
    position: absolute;
    bottom: 80px;
    right: 15px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: #5f6368;
    transition: all 0.2s;
}

.mobile-control-btn:hover {
    background: #f8f9fa;
    transform: scale(1.05);
}

/* 移动端清除路线按钮特殊样式 */
#mobileClearRouteBtn {
    background: #ea4335;
    color: white;
}

#mobileClearRouteBtn:hover {
    background: #d33b2c;
    transform: scale(1.05);
}

/* 主计算按钮 */
.main-calculate-btn {
    padding: 12px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
    width: 100%;
    font-weight: 600;
    transition: all 0.2s;
    height: auto;
}

/* 分类图标样式 */
.port-name i {
    font-size: 1rem;
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.main-calculate-btn:hover {
    background: #3367d6;
    transform: translateY(-2px);
}

.main-calculate-btn i {
    margin-right: 8px;
}

.selected-ports {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.selected-ports-title {
    font-size: 0.9rem;
    color: #5f6368;
    margin-bottom: 10px;
    font-weight: 500;
}

.selected-port-info {
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.selected-port-info i {
    margin-right: 8px;
    font-size: 1rem;
}

/* 位置标记样式 */
.location-marker {
    font-size: 24px;
    color: #ea4335;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

.admin-edit-controls button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.admin-edit-controls button:active {
    transform: translateY(0);
}

/* 响应式布局 */
@media (min-width: 768px) {
    .container {
        flex-direction: row;
    }
    
    #map {
        height: 100%;
    }
    
    .mobile-controls {
        display: none;
    }
}

/* Web端分类按钮 - 桌面端显示 */
.web-category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.web-category-buttons .category-btn {
    flex: 0 0 auto;
    width: calc(33.333% - 6px);
    white-space: nowrap;
    min-width: 0;
}

/* 移动端分类按钮 - 移动端显示 */
.mobile-category-buttons {
    display: none;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.mobile-category-buttons .category-btn {
    flex: 0 0 auto;
    width: calc(33.333% - 6px);
    white-space: nowrap;
    min-width: 0;
}

/* 移动端适配 */
@media (max-width: 767px) {
    .web-category-buttons {
        display: none;
    }
    
    .mobile-category-buttons {
        display: flex;
    }

    /* 搜索输入框 */
    .search-input,
    .location-search-input {
        padding: 6px 12px 6px 35px !important;
        height: 36px !important;
        font-size: 0.85rem !important;
    }
    
    .search-icon,
    .location-search-container .search-icon {
        left: 12px !important;
        font-size: 0.9rem !important;
    }

    .search-container{
        width: 100%;
    }
    .search-container>input{
        border-radius: 6px 0 0 6px;
    }
    
    /* 搜索按钮 */
    .location-search-btn {
        padding: 0 12px !important;
        height: 36px !important;
        font-size: 0.85rem !important;
        min-width: 40px !important;
    }
    
    /* 分类按钮 */
    .category-buttons {
        gap: 4px;
        margin-top: 8px;
    }
    
    .category-btn {
        padding: 6px 8px !important;
        font-size: 0.7rem !important;
        min-width: 50px;
    }
    
    /* 移动端分类按钮固定宽度两行显示 */
    .mobile-category-buttons {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .mobile-category-buttons .category-btn {
        flex: 0 0 auto;
        width: calc(33.333% - 3px);
        white-space: nowrap;
        min-width: 0;
    }
    
    /* 主标题 */
    .sidebar-header h1 {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
    }
    
    /* 港口列表项 */
    .port-item {
        padding: 5px 10px !important;
        margin-bottom: 6px !important;
    }
    
    .port-name {
        font-size: 0.9rem !important;
        margin-bottom: 6px !important;
    }
    
    .port-details {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        color: #838282;
        font-weight: 500;
    }

     .port-fee{
        background-color: #a8a8a8;
        padding: 8px 8px;
        color: white;
        border-radius: 5px;
    }
    
    /* 操作按钮 */
    .route-actions {
        margin-top: 8px !important;
        gap: 6px !important;
    }
    
    .route-btn {
        padding: 4px 8px !important;
        height: 30px !important;
        font-size: 0.75rem !important;
    }
    
    .route-btn i {
        margin-right: 3px !important;
        font-size: 0.8rem !important;
    }
    
    /* 路线按钮 */
    .port-route-btn {
        font-size: 1rem !important;
        padding: 3px !important;
    }
    
    /* 主计算按钮 */
    .main-calculate-btn {
        padding: 8px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
        margin: 8px 0 !important;
    }
    
    .main-calculate-btn i {
        margin-right: 6px !important;
        font-size: 0.9rem !important;
    }
    
    /* 选中港口信息 */
    .selected-ports {
        padding: 10px !important;
        margin-bottom: 10px !important;
    }
    
    .selected-ports-title {
        font-size: 0.8rem !important;
        margin-bottom: 8px !important;
    }
    
    .selected-port-info {
        font-size: 0.75rem !important;
        margin-bottom: 6px !important;
    }
    
    .selected-port-info i {
        margin-right: 6px !important;
        font-size: 0.9rem !important;
    }
    
    /* 港口计数 */
    .port-count {
        font-size: 0.75rem !important;
        margin-bottom: 8px !important;
    }
    
    /* 侧边栏头部 */
    .sidebar-header {
        padding: 10px !important;
    }
    
    /* 移动端控制按钮 */
    .mobile-controls {
        bottom: 60px !important;
        right: 8px !important;
        gap: 6px !important;
    }
    
    .mobile-control-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }
    
    /* 错误和状态消息 */
    .error-message,
    .route-status {
        padding: 8px 16px !important;
        font-size: 0.8rem !important;
    }

    .mapboxgl-popup-content{
        transform: scale(0.8);
    }
    
    /* 弹出窗口 */
    .custom-popup {
        min-width: 200px !important;
    }
    
    .popup-title {
        font-size: 16px !important;
        padding: 10px 15px !important;
    }
    
    .popup-content {
        padding: 10px 15px !important;
    }
    
    .popup-table {
        font-size: 0.8rem !important;
    }
    
    .popup-table th, 
    .popup-table td {
        padding: 3px 0 !important;
    }
    
    .popup-button {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }
    
    /* 分页器 - 移动端优化 */
    .pagination-container {
        margin-top: 8px !important;
        padding: 6px 8px !important;
        min-height: 44px !important;
    }
    
    .pagination {
        gap: 8px !important;
    }
    
    .pagination-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.8rem !important;
    }
    
    .pagination-info {
        font-size: 0.75rem !important;
        padding: 0 4px !important;
    }
    
    /* 自定义弹窗 */
    .modal-content {
        width: 95% !important;
        margin: 10px !important;
    }
    
    .modal-header {
        padding: 15px !important;
    }
    
    .modal-body {
        padding: 15px !important;
    }
    
    .modal-btn {
        padding: 10px 15px !important;
        font-size: 0.9rem !important;
    }
    
    /* 地图容器 */
    #map {
        height: 100vh !important;
        flex: 1;
    }
    
    /* 容器整体 */
    .container {
        height: 100vh;
    }
    
    /* 移动端港口列表样式 */
    .port-list-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        z-index: 1000;
        max-height: 70vh;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        overflow: hidden;
        display: block !important;
    }

    .port-list-container.show {
        transform: translateY(0);
        display: block !important;
    }

    .port-list-handle {
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 10px auto;
        cursor: pointer;
    }

    /* 移动端路径规划面板样式 */
    .mobile-route-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        z-index: 9999999;
        max-height: 80vh;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        display: none;
    }

    .mobile-route-panel.active {
        transform: translateY(0);
        display: block;
    }

    .mobile-route-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 20px 15px 20px;
        border-bottom: 1px solid #e0e0e0;
        background: #f8f9fa;
        border-radius: 20px 20px 0 0;
    }

    .mobile-route-title {
        font-size: 1.2rem;
        font-weight: 600;
        color: #202124;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-route-close {
        background: none;
        border: none;
        font-size: 1.2rem;
        color: #5f6368;
        cursor: pointer;
        padding: 8px;
        border-radius: 50%;
        transition: all 0.2s;
    }

    .mobile-route-close:hover {
        background: #e0e0e0;
        color: #202124;
    }

    .mobile-route-content {
        padding: 10px;
        gap: 10px;
        display: flex;
        flex-direction: column;
    }

    .mobile-route-inputs {
        display: flex;
        flex-direction: row;
        gap: 10px;
        max-height: 40px;
    }

    .mobile-route-input-group {
        position: relative;
    }

    .route-input-wrapper {
        position: relative;
        display: flex;
        align-items: center;
    }

    .route-input-wrapper .start-icon,
    .route-input-wrapper .end-icon {
        position: absolute;
        left: 12px;
        color: #5f6368;
        z-index: 2;
        font-size: 1rem;
    }

    .route-input-wrapper .start-icon {
        color: #4285f4;
    }

    .route-input-wrapper .end-icon {
        color: #fbbc05;
    }

    .route-input {
        width: 100%;
        padding: 8px;   
        border: 2px solid #e8eaed;
        border-radius: 8px;
        font-size: 1rem;
        transition: border-color 0.3s ease;
        outline: none;
        background: white;
        text-indent: 2em;
        padding-right: 35px;
        text-overflow: ellipsis;
    }

    .route-input:focus {
        border-color: #4285f4;
        box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
    }

    .route-location-btn {
        position: absolute;
        right: 8px;
        background: none;
        border: none;
        padding: 6px;
        cursor: pointer;
        color: #5f6368;
        transition: all 0.3s ease;
        border-radius: 4px;
        font-size: 0.9rem;
    }

    .route-location-btn:hover {
        background: #f8f9fa;
        color: #4285f4;
    }

    .route-swap-btn-container {
        display: flex;
        justify-content: center;
        margin: 15px 0;
    }

    .route-swap-btn {
        width: 40px;
        height: 40px;
        border: 2px solid #e8eaed;
        background: white;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        color: #5f6368;
    }

    .route-swap-btn:hover {
        border-color: #4285f4;
        color: #4285f4;
        transform: rotate(180deg);
    }

    .mobile-route-actions {
        display: flex;
        gap: 10px;
    }

    .route-calculate-btn {
        flex: 2;
        height: 36px;
        background: linear-gradient(135deg, #4285f4, #34a853);
        color: white;
        border: none;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 0.8rem;
    }

    .route-calculate-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
    }

    .route-clear-btn {
        flex: 1;
        height: 36px;
        background: #f8f9fa;
        color: #5f6368;
        border: 1px solid #e8eaed;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 0.8rem;
    }

    .route-clear-btn:hover {
        background: #e8eaed;
        color: #202124;
    }

    /* 移动端控制按钮容器 */
    .mobile-controls-container {
        position: fixed;
        bottom: 20px;
        right: 15px;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-control-btn {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: white;
        border: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1.2rem;
        color: #5f6368;
        transition: all 0.2s;
    }

    .mobile-control-btn:hover {
        background: #f8f9fa;
        transform: scale(1.05);
    }

    /* 隐藏Web端的路径规划面板在移动端 */
    .route-planning-panel {
        display: none !important;
    }
    
    /* 隐藏Web端顶部控制栏在移动端 */
    .top-controls {
        display: none !important;
    }
    
    /* 确保移动端搜索栏显示 */
    .mobile-location-search {
        display: block !important;
    }
    
    /* 隐藏Web端港口列表在移动端 */
    .web-port-list {
        display: none !important;
    }
}

/* 滚动条样式 */
.port-list-container::-webkit-scrollbar {
    width: 6px;
}

.port-list-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.port-list-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.port-list::-webkit-scrollbar {
    width: 4px;
}

.port-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.port-list::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 2px;
}

.port-list::-webkit-scrollbar-thumb:hover {
    background: #b8b8b8;
}

/* 搜索模式切换按钮 */
.search-mode-switcher {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 1001;
    background: white;
    padding: 6px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-mode-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #5f6368;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
}

.search-mode-btn:hover {
    background: #f1f3f4;
    color: #202124;
}

.search-mode-btn.active {
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    box-shadow: 0 2px 6px rgba(66, 133, 244, 0.3);
}

.search-mode-btn i {
    font-size: 14px;
}

/* 顶部控制栏样式 */
.top-controls {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: 12px;
    z-index: 1000;
    max-width: 600px;
    width: 90%;
    transition: all 0.3s ease;
}

/* 路线列表面板（显示在顶部搜索框下方） */
.route-list-panel {
    position: fixed;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    /* height: 500px; */
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.route-list-panel .route-list-header {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    border-radius: 12px 12px 0 0;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.route-list-panel .route-list-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-list-panel .route-count {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
}

.route-list-panel .route-search-filter {
    padding: 10px 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    margin: 0;
}

.route-list-panel .route-list {
    height: 340px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 20px;
    margin: 0;
    list-style: none;
    min-height: 0;
    box-sizing: border-box;
}

.route-list-panel .pagination-container {
    padding: 6px 20px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    display: block;
    background: #f8f9fa;
    margin-top: 0;
    box-sizing: border-box;
    min-height: auto;
    height: auto;
}

.route-list-panel .pagination-container .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin: 0;
    padding: 0;
    min-height: auto;
    height: auto;
}

.route-list-panel .pagination-container .pagination-btn {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.route-list-panel .pagination-container .pagination-info {
    font-size: 0.85rem;
    padding: 0 8px;
}

/* 路线列表滚动条样式 */
.route-list-panel .route-list::-webkit-scrollbar {
    width: 6px;
}

.route-list-panel .route-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.route-list-panel .route-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.route-list-panel .route-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

/* 路线规划按钮 */
.route-planning-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.route-planning-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
}

.route-planning-btn i {
    font-size: 16px;
}

/* 顶部搜索容器 */
.top-search-container {
    flex: 1;
    min-width: 0;
}

.top-search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(66, 133, 244, 0.2);
    transition: all 0.3s ease;
}

.top-search-input-container:focus-within {
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

.top-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 15px;
    font-size: 14px;
    outline: none;
    color: #202124;
    text-indent: 2em;
}

.top-search-input::placeholder {
    color: #9aa0a6;
}

.top-search-btn {
    padding: 13px 15px;
    background: #4285f4;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 0 5px 5px 0;
}

.top-search-btn:hover {
    background: #3367d6;
}

#routePlanningBtn{
    color: #4285f4;
    background-color: white;
    border-radius: unset;
}
#routePlanningBtn:hover{
    background-color: #3367d6;
    color: white;
}

/* 路径规划面板样式 */
.route-planning-toggle-btn {
    display: flex;
    align-items: center;
    background:rgb(245, 244, 244);
    color: #0c7be4;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    padding:13px;
    font-size: 18px;
}

.route-planning-toggle-btn:hover {
    background: #d1d1d1;
}

.route-planning-panel {
    margin-top: 5px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.route-inputs-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.route-inputs-container>.router-panel{
    display: flex;
    gap: 10px;
    width: 100%;
}

.route-input-group {
    flex: 1;
}

.route-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.route-input-wrapper .start-icon,
.route-input-wrapper .end-icon {
    position: absolute;
    left: 12px;
    color: #5f6368;
    z-index: 2;
}

.route-input-wrapper .start-icon {
    color: #4285f4;
}

.route-input-wrapper .end-icon {
    color: #fbbc05;
}

.route-input {
    width: 100%;
    padding: 8px;
    border: 2px solid #e8eaed;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    outline: none;
    text-indent: 2em;
    padding-right: 35px;
    text-overflow: ellipsis;
}

.route-input:focus {
    border-color: #4285f4;
}

.route-location-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #5f6368;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.route-location-btn:hover {
    background: #f8f9fa;
    color: #4285f4;
}

.route-swap-btn-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.route-swap-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #e8eaed;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #5f6368;
}

.route-swap-btn:hover {
    border-color: #4285f4;
    color: #4285f4;
    transform: rotate(180deg);
}

.route-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.route-calculate-btn {
    flex: 2;
    padding: 10px 16px;
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.route-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
}

.route-clear-btn {
    flex: 1;
    padding: 10px 16px;
    background: #f8f9fa;
    color: #5f6368;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.route-clear-btn:hover {
    background: #e8eaed;
    color: #202124;
}

.route-suggestions-container {
    position: relative;
}

.route-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    margin-top: 5px;
}

/* 移动端建议项样式优化 */
@media (max-width: 768px) {
    .route-suggestions {
        left: -200px;
            right: 0;
            min-width: 200px;
            max-height: 250px;
    }
}

/* 搜索建议样式 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

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

.suggestion-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4285f4;
    flex-shrink: 0;
    font-size: 16px;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.suggestion-name {
    font-weight: 600;
    color: #202124;
    margin-bottom: 4px;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-details {
    display: flex;
    gap: 8px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.suggestion-type {
    background: #e8f0fe;
    color: #4285f4;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.suggestion-code {
    color: #5f6368;
    font-size: 12px;
    font-weight: 600;
}

.suggestion-address {
    color: #9aa0a6;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-suggestions {
    color: #9aa0a6;
    text-align: center;
    font-style: italic;
}

/* Popup 按钮样式优化 */
.popup-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-direction: column;
}

.popup-action-btn {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.popup-action-btn.set-start-btn {
    background: #4285f4;
    color: white;
    height: 30px;
    font-size: 1.2em;
}

.popup-action-btn.set-start-btn:hover {
    background: #3367d6;
    transform: translateY(-1px);
}

.popup-action-btn.set-end-btn {
    background: #fbbc05;
    color: white;
    height: 30px;
    font-size: 1.2em;
}

.popup-action-btn.set-end-btn:hover {
    background: #e6a800;
    transform: translateY(-1px);
}

/* 自定义标记样式 */
.custom-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
    position: absolute;
    pointer-events: auto;
    transition: transform 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.custom-marker:hover {
    transform: scale(1.2);
    z-index: 1001;
}

/* 确保标记不会被意外移动 */
.mapboxgl-marker {
    pointer-events: auto !important;
}

/* 移动端搜索栏优化 */
.mobile-search-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.mobile-route-toggle {
    background: #4285f4;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.mobile-search-input-container {
    flex: 1;
    position: relative;
}

.mobile-search-input {
    width: 100%;
    padding:8px;
    border: 1px solid #ddd;
    border-radius: 8px 0 0 8px;
    font-size: 0.9rem;
    text-indent: 1.5em;
}

.mobile-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #5f6368;
}

/* 确保地图在移动端全屏显示 */
@media (max-width: 767px) {
    .container {
        flex-direction: column;
        height: 100vh;
    }
    
    .sidebar {
        max-height: 40vh;
        position: absolute;
        z-index: 9999999;
    }
    
    /* 初始状态隐藏侧边栏内容 */
    .port-list-container:not(.show) {
        display: none;
    }
    .mapboxgl-control-container{
        display: none !important;
    }
}

/* Web端样式 - 确保不受移动端影响 */
@media (min-width: 768px) {
    .sidebar {
        width: 400px;
        max-height: 100vh;
        position: relative;
        display: flex;
        flex-direction: column;
    }
    
    .port-list-container {
        display: block !important;
        position: relative !important;
        transform: none !important;
        border-radius: 0 !important;
        max-height: none !important;
        box-shadow: none !important;
        background: #f8f9fa;
    }
    
    /* 隐藏移动端特有元素 */
    .mobile-location-search {
        display: none !important;
    }
    
    .mobile-route-panel {
        display: none !important;
    }
    
    .mobile-controls-container {
        display: none !important;
    }
    
    /* 确保Web端搜索正常显示 */
    .top-controls {
        display: flex !important;
    }
    
    /* 恢复Web端地图布局 */
    #map {
        height: 100vh;
        flex: 1;
    }
    
    .container {
        flex-direction: row;
        height: 100vh;
    }
}

/* 明确的类控制 */
.web-only {
    display: flex;
}

.mobile-only {
    display: none;
}

.web-port-list {
    display: block;
    position: relative;
    transform: none;
}

@media (max-width: 767px) {
    .web-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block;
    }
    
    .web-port-list {
        display: none;
    }
}
/* 在移动端样式部分添加以下修复 */

@media (max-width: 767px) {
    /* 确保移动端控制按钮正确显示 */
    .mobile-controls-container {
        position: fixed;
        bottom: 20px;
        right: 15px;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .mobile-control-btn {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: white;
        border: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1.2rem;
        color: #5f6368;
        transition: all 0.2s;
    }
    
    .mobile-control-btn:hover {
        background: #f8f9fa;
        transform: scale(1.05);
    }
    
    /* 修复移动端路径规划面板显示 */
    .mobile-route-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        z-index: 9999999;
        max-height: 80vh;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }
    
    .mobile-route-panel.active {
        transform: translateY(0) !important;
        display: block !important;
        position: relative;
    }
    
    .mobile-route-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .mobile-route-title {
        font-size: 1.2rem;
        font-weight: 600;
        color: #202124;
        margin: 0;
    }
    
    .mobile-route-close {
        background: none;
        border: none;
        font-size: 1.2rem;
        color: #5f6368;
        cursor: pointer;
        padding: 5px;
        border-radius: 4px;
        transition: all 0.2s;
    }
    
    .mobile-route-close:hover {
        background: #e0e0e0;
        color: #202124;
    }
    
    .mobile-route-inputs {
        display: flex;
        flex-direction: row;
        gap: 10px;
        max-height: 40px;
    }
    
    .mobile-route-input-group {
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .mobile-route-icon {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1rem;
        z-index: 2;
    }
    
    .mobile-route-input {
        width: 100%;
        padding: 12px 15px 12px 40px;
        border: 2px solid #e8eaed;
        border-radius: 8px;
        font-size: 1rem;
        transition: border-color 0.3s;
        outline: none;
    }
    
    .mobile-route-input:focus {
        border-color: #4285f4;
    }
    
    .mobile-route-actions {
        display: flex;
        gap: 10px;
    }
    
    .mobile-route-btn {
        flex: 1;
        padding: 12px;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.3s;
    }
    
    .mobile-route-calculate {
        background: linear-gradient(135deg, #4285f4, #34a853);
        color: white;
    }
    
    .mobile-route-calculate:active {
        transform: translateY(1px);
    }
    
    .mobile-route-clear {
        background: #f8f9fa;
        color: #5f6368;
        border: 1px solid #e8eaed;
    }
    
    /* 修复港口列表显示 */
    .port-list-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        z-index: 1000;
        max-height: 70vh;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        overflow: hidden;
        display: block !important;
    }
    
    .port-list-container.show {
        transform: translateY(0) !important;
        display: block !important;
    }
    
    .port-list-handle {
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 10px auto;
        cursor: pointer;
    }

    /* 移动端路线列表样式 - 层级要在按钮上面 */
    .route-list-container.mobile-only {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        z-index: 1001; /* 比按钮的z-index: 1000高 */
        max-height: 70vh;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        overflow: hidden;
        display: flex !important;
        flex-direction: column;
    }

    .route-list-container.mobile-only.show {
        transform: translateY(0) !important;
        display: flex !important;
    }

    .route-list-container.mobile-only .route-list-handle {
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 10px auto;
        cursor: pointer;
        flex-shrink: 0;
    }

    .route-list-container.mobile-only .route-list-header {
        padding: 15px;
        margin: 0;
        border-radius: 0;
        flex-shrink: 0;
    }

    .route-list-container.mobile-only .route-search-filter {
        padding: 10px 15px;
        flex-shrink: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .route-list-container.mobile-only .route-search-input-wrapper {
        flex: 1;
        min-width: 0;
    }

    .route-list-container.mobile-only .route-type-select {
        flex: 1;
        min-width: 0;
    }

    .route-list-container.mobile-only .route-search-btn {
        flex-shrink: 0;
        width: auto;
        min-width: 60px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .route-list-container.mobile-only .route-list {
        flex: 1;
        overflow-y: auto;
        padding: 10px 15px;
        margin: 0;
        list-style: none;
        min-height: 0;
    }
    
    /* 确保移动端路线列表项样式和Web端一致 */
    .route-list-container.mobile-only .route-item {
        padding: 10px 15px;
        border-radius: 8px;
        background: #fff;
        margin-bottom: 8px;
        cursor: pointer;
        transition: all 0.2s;
        border: 1px solid #e0e0e0;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        position: relative;
    }
    
    .route-list-container.mobile-only .route-item:hover {
        background: #f1f8ff;
        border-color: #4285f4;
        box-shadow: 0 4px 8px rgba(66, 133, 244, 0.15);
    }
    
    /* 确保移动端路线列表项内容样式和Web端一致 */
    .route-list-container.mobile-only .route-item-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .route-list-container.mobile-only .route-item-title {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 1;
        min-width: 150px;
    }
    
    .route-list-container.mobile-only .route-item-title i {
        color: #4285f4;
        font-size: 14px;
    }
    
    .route-list-container.mobile-only .route-name {
        font-size: 0.95rem;
        font-weight: 600;
        color: #202124;
    }
    
    .route-list-container.mobile-only .route-item-meta {
        display: flex;
        align-items: center;
        gap: 15px;
        flex-shrink: 0;
    }
    
    .route-list-container.mobile-only .route-type,
    .route-list-container.mobile-only .route-count {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 0.85rem;
        color: #5f6368;
    }
    
    .route-list-container.mobile-only .route-type i,
    .route-list-container.mobile-only .route-count i {
        color: #9aa0a6;
        font-size: 12px;
    }
    
    .route-list-container.mobile-only .route-item-description {
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid #f0f0f0;
        display: flex;
        align-items: flex-start;
        gap: 6px;
        font-size: 0.8rem;
        color: #5f6368;
    }
    
    .route-list-container.mobile-only .route-item-description i {
        color: #9aa0a6;
        font-size: 12px;
        margin-top: 2px;
    }

    .route-list-container.mobile-only .pagination-container {
        padding: 10px 15px;
        flex-shrink: 0;
        border-top: 1px solid #e0e0e0;
    }
    
    /* 确保搜索和定位后列表正确显示 */
    .port-list {
        max-height: calc(70vh - 100px);
        overflow-y: auto;
    }

    .route-status{
        top: 290px;
        bottom: auto;
    }
}

/* 路线点位弹窗样式 */
.route-point-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-width: 200px;
}

.route-point-popup h4 {
    color: #2c3e50;
    font-size: 14px;
    margin: 0 0 8px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.route-point-popup h4 i {
    color: #3498db;
    font-size: 13px;
}

.route-point-popup .popup-content {
    font-size: 13px;
}

.route-point-popup .popup-row {
    display: flex;
    margin-bottom: 4px;
}

.route-point-popup .popup-row:last-child {
    margin-bottom: 0;
}

.route-point-popup .label {
    color: #666;
    font-weight: 500;
    min-width: 70px;
    margin-right: 8px;
}

.route-point-popup .value {
    color: #333;
    flex: 1;
    word-break: break-word;
}

/* 路线图层控制面板样式 */
.route-controls {
    position: absolute;
    top: 120px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 200px;
    max-width: 280px;
}

.route-controls h3 {
    font-size: 14px;
    color: #2c3e50;
    margin: 0 0 12px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.route-controls h3 i {
    color: #3498db;
}

.route-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.route-toggle label {
    font-size: 13px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
}

/* 微信社群控件样式 */
.wechat-community-control {
    margin: 10px 10px 0 0;
}

.wechat-community-wrapper {
    position: relative;
}

.wechat-community-btn {
    background: #fff;
    border: none;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    width: 50px;
    transition: all 0.3s ease;
}

.wechat-community-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.wechat-community-btn i {
    font-size: 20px;
    color: #07c160;
    margin-bottom: 2px;
}

.wechat-community-label {
    font-size: 11px;
    color: #333;
    font-weight: 500;
}

.wechat-qrcode-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.wechat-qrcode-popup::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 20px;
    border: 6px solid transparent;
    border-bottom-color: #fff;
}

.wechat-community-wrapper:hover .wechat-qrcode-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.wechat-qrcode-popup img {
    width: 200px;
    height: 200px;
    display: block;
}