﻿/* ==================== 鍏ㄥ眬鏍峰紡 ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', sans-serif;
}

/* ==================== 椤堕儴瀵艰埅鏍?==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(26, 32, 44, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: white;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.logo {
    width: 36px;
    height: 36px;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0;
}

.title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.user-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.user-count i {
    font-size: 14px;
}

.user-count:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.user-status-summary {
    font-size: 12px;
    font-weight: bold;
    margin-left: 4px;
}

/* WebSocket 鐘舵€佹寚绀哄櫒 */
.status-indicator {
    padding: 5px 12px;
    border-radius: 18px;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    white-space: nowrap;
}

.status-indicator.connected {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-indicator.connecting {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-indicator.disconnected {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.connected .status-dot {
    background: #4CAF50;
}

.status-indicator.connecting .status-dot {
    background: #FFC107;
}

.status-indicator.disconnected .status-dot {
    background: #F44336;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ==================== 渚ц竟鏍?==================== */
.sidebar {
    position: fixed;
    top: 50px;
    left: 0;
    width: 250px;
    height: calc(100vh - 86px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.08);
    z-index: 999;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    transform: translateX(-250px);
}

.sidebar.show {
    transform: translateX(0);
}

.sidebar.collapsed {
    transform: translateX(-250px);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 鑷畾涔夋粴鍔ㄦ潯 */
.sidebar-content::-webkit-scrollbar {
    width: 5px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

/* ==================== 鍦板浘鎺т欢瀹瑰櫒 ==================== */
.map-controls-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-control-btn {
    width: 100%;
    padding: 10px 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    text-align: left;
}

.sidebar-control-btn:hover {
    background: #f5f5f5;
    border-color: #667eea;
    transform: translateX(3px);
}

.sidebar-control-btn:active {
    transform: translateX(1px);
}

.sidebar-control-btn i {
    width: 20px;
    text-align: center;
    color: #667eea;
}

.sidebar-control-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.sidebar-control-btn.active i {
    color: white;
}

/* 鎺т欢鍒嗛殧绾?*/
.control-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 5px 0;
}

/* 鏂囦欢涓婁紶鎸夐挳 */
#file-input {
    display: none;
}

.file-upload-label {
    width: 100%;
    padding: 10px 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.file-upload-label:hover {
    background: #f5f5f5;
    border-color: #667eea;
    transform: translateX(3px);
}

.file-upload-label i {
    width: 20px;
    text-align: center;
    color: #667eea;
}

/* 璺濈鏍囩鏍峰紡 */
.distance-label {
    background: transparent !important;
    border: none !important;
}

/* ==================== 鎼滅储妗?==================== */
.search-box {
    width: 100%;
    padding: 9px 13px;
    border: 2px solid #e0e0e0;
    border-radius: 7px;
    font-size: 13px;
    transition: all 0.3s;
}

.search-box:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ==================== 鐢ㄦ埛鍒楄〃 ==================== */
.user-list {
    list-style: none;
    margin-top: 8px;
}

.user-item {
    padding: 10px;
    background: #f5f5f5;
    border-radius: 7px;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    transition: all 0.3s;
}

.user-item:hover {
    background: #e0e0e0;
    transform: translateX(5px);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: bold;
    flex-shrink: 0;
}

.user-item-placeholder {
    padding: 10px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* 鍦ㄧ嚎鐘舵€佹寚绀虹偣 */
.status-dot-online,
.status-dot-offline {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: auto;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.status-dot-online {
    background: #4CAF50;
    animation: pulse-online 2s infinite;
}

.status-dot-offline {
    background: #F44336;
    animation: pulse-offline 1.5s infinite;
}

@keyframes pulse-online {

    0%,
    100% {
        box-shadow: 0 0 4px rgba(76, 175, 80, 0.5);
    }

    50% {
        box-shadow: 0 0 8px rgba(76, 175, 80, 1), 0 0 12px rgba(76, 175, 80, 0.5);
    }
}

@keyframes pulse-offline {

    0%,
    100% {
        box-shadow: 0 0 6px rgba(244, 67, 54, 0.7);
    }

    50% {
        box-shadow: 0 0 10px rgba(244, 67, 54, 1), 0 0 14px rgba(244, 67, 54, 0.8);
    }
}

/* 鐢ㄦ埛鍦ㄧ嚎/绂荤嚎鐘舵€?*/
.user-online {
    border-left: 3px solid #4CAF50;
}

.user-offline {
    border-left: 3px solid #F44336;
    opacity: 0.7;
}

/* 鍒囨崲灏忕粍鎸夐挳 */
.join-group-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.join-group-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(102, 126, 234, 0.4);
}

.join-group-btn:active {
    transform: translateY(0);
}

/* ==================== 鍦板浘瀹瑰櫒 ==================== */
#map {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 36px;
    transition: left 0.3s ease;
}

.sidebar.show~#map {
    left: 250px;
}

/* ==================== 搴曢儴淇℃伅鏍?==================== */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: rgba(26, 32, 44, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 11px;
    z-index: 1000;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==================== 妯℃€佹 ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 26px;
    border-radius: 13px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.25);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    margin-bottom: 9px;
    color: #333;
    font-size: 22px;
    text-align: center;
}

.modal-content p {
    margin-bottom: 18px;
    color: #666;
    text-align: center;
    font-size: 13px;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 18px;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
}

#group-input {
    width: 100%;
    padding: 11px;
    margin-bottom: 14px;
    border: 2px solid #ddd;
    border-radius: 7px;
    font-size: 15px;
    transition: border-color 0.3s;
}

#group-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.button-group {
    display: flex;
    gap: 9px;
    margin-top: 18px;
}

.primary-btn,
.secondary-btn {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 13px rgba(102, 126, 234, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: #f0f0f0;
    color: #333;
}

.secondary-btn:hover {
    background: #e0e0e0;
}

.error-message {
    color: #dc3545;
    background: #f8d7da;
    padding: 9px;
    border-radius: 5px;
    margin-top: 9px;
    font-size: 13px;
    text-align: center;
}

/* ==================== Toast 閫氱煡 ==================== */
#toast-container {
    position: fixed;
    bottom: 52px;
    right: 18px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.toast {
    padding: 13px 18px;
    border-radius: 7px;
    color: white;
    font-size: 13px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 280px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-info {
    background: #17a2b8;
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

.toast-warning {
    background: #ffc107;
    color: #333;
}

/* ==================== 鍦板浘鏍囪鏍峰紡 ==================== */
/* 绾㈣壊銆佽摑鑹插拰鐢ㄦ埛鍚嶅伐鍏锋彁绀烘牱寮忓凡绉昏嚦 common-styles.css */

/* ==================== Leaflet 鎺т欢 ==================== */
.leaflet-control {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-radius: 7px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border: none !important;
}

.leaflet-bar a {
    border-radius: 7px !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 3px 18px rgba(0, 0, 0, 0.13) !important;
    overflow: hidden !important;
    border: none !important;
    background: #ffffff !important;
}

.leaflet-popup-content {
    margin: 4px 6px !important;
}

.leaflet-popup.default-popup-style .leaflet-popup-content-wrapper {
    background: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: 0 3px 18px rgba(0, 0, 0, 0.13) !important;
}

.leaflet-popup.default-popup-style .leaflet-popup-tip {
    background: #ffffff !important;
}

.leaflet-popup-tip {
    background: #ffffff !important;
    border: none !important;
}



/* 闅愯棌 Leaflet 鐗堟潈 */
.leaflet-control-attribution {
    display: none !important;
}

/* ==================== 寮哄埗闅愯棌鎵€鏈夊湴鍥炬帶浠讹紙闄ゅ浘灞傞€夋嫨澶栵級==================== */

/* 闅愯棌瀹氫綅鎺т欢 */
.leaflet-control-locate {
    display: none !important;
}

/* 闅愯棌鍧愭爣鎺т欢 */
.leaflet-control-coordinates {
    display: none !important;
}

/* 闅愯棌姣斾緥灏?*/
.leaflet-control-scale {
    display: none !important;
}

/* 闅愯棌鏂囦欢涓婁紶鎺т欢 */
.leaflet-control-filelayer {
    display: none !important;
}

/* 闅愯棌鎵€鏈夊乏涓婅鐨勬帶浠讹紙闄や簡鍥惧眰閫夋嫨锛?/
.leaflet-top.leaflet-left .leaflet-control:not(.leaflet-control-layers) {
    display: none !important;
}

/* 闅愯棌鎵€鏈夊彸涓婅鐨勬帶浠?*/
.leaflet-top.leaflet-right .leaflet-control:not(.leaflet-control-layers) {
    display: none !important;
}

/* 闅愯棌鎵€鏈夊乏涓嬭鐨勬帶浠?*/
.leaflet-bottom.leaflet-left .leaflet-control {
    display: none !important;
}

/* 闅愯棌鎵€鏈夊彸涓嬭鐨勬帶浠?*/
.leaflet-bottom.leaflet-right .leaflet-control {
    display: none !important;
}

/* 猸?鍙樉绀哄浘灞傞€夋嫨鎺т欢 */
.leaflet-control-layers {
    display: block !important;
}

/* 鎾斁鍥炴斁鏍忔牱寮?*/
#track-playback-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    pointer-events: none;
    padding: 6px 0;
}

.pb-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 9px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 8px 10px;
    pointer-events: auto;
    max-width: 960px;
}

.pb-bar.mobile {
    width: calc(100% - 16px);
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
}

.pb-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.pb-row.bottom {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.pb-slider-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pb-slider-wrap.desktop {
    width: 320px;
}

.pb-slider-wrap.mobile {
    width: 100%;
    margin: 2px 8px 6px;
}

.pb-speed-display {
    min-width: 32px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    font-size: 12px;
    color: #333;
    background: rgba(102, 126, 234, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 6px;
    display: none;
}

.pb-slider {
    flex: 1;
    width: 100%;
    accent-color: #667eea;
    height: 6px;
    -webkit-appearance: none;
    background: linear-gradient(to right, #667eea 0%, #667eea var(--pb-progress, 0%), #e9edf7 var(--pb-progress, 0%), #e9edf7 100%);
    border-radius: 6px;
}

.pb-bar.mobile .pb-slider {
    height: 4px;
    -webkit-appearance: none;
    background: linear-gradient(to right, #667eea 0%, #667eea var(--pb-progress, 0%), #eef1f7 var(--pb-progress, 0%), #eef1f7 100%);
    border-radius: 6px;
}

.pb-bar.mobile .pb-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.pb-bar.mobile .pb-slider::-moz-range-track {
    height: 4px;
    background: #eef1f7;
    border-radius: 6px;
}

.pb-bar.mobile .pb-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    border: 2px solid #fff;
}

.pb-bar.mobile .pb-slider::-moz-range-progress {
    height: 4px;
    background: #667eea;
    border-radius: 6px;
}

.pb-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.pb-slider::-moz-range-track {
    height: 6px;
    background: #e9edf7;
    border-radius: 6px;
}

.pb-slider::-moz-range-progress {
    height: 6px;
    background: #667eea;
    border-radius: 6px;
}

.pb-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    border: 2px solid #fff;
}

.pb-btn {
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pb-bar.mobile .pb-btn {
    font-size: 12px;
    padding: 6px 10px;
    min-width: 78px;
}

.pb-btn:hover {
    background: #f5f5f5;
    border-color: #667eea;
    transform: translateY(-1px);
}

.pb-btn:active {
    transform: translateY(0);
}

.pb-time {
    margin-left: 8px;
    color: #333;
}

.pb-bar.mobile .pb-time {
    order: 2;
    width: 100%;
    text-align: center;
    margin-left: 0;
    margin-top: 2px;
}

.pb-time.mobile {
    font-size: 12px;
    white-space: nowrap;
}

.pb-time.desktop {
    font-size: 13px;
}

/* ==================== 绉诲姩绔€傞厤 ==================== */
@media (max-width: 768px) {
    .header {
        height: 46px;
        padding: 0 12px;
    }

    .header-left {
        gap: 8px;
    }

    .logo {
        width: 32px;
        height: 32px;
    }

    .title {
        font-size: 15px;
        max-width: 140px;
    }

    .header-right {
        gap: 10px;
    }

    .user-count {
        padding: 5px 10px;
        font-size: 12px;
        gap: 5px;
    }

    .user-count i {
        font-size: 13px;
    }

    .status-indicator {
        padding: 4px 9px;
        font-size: 10px;
        gap: 4px;
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }

    .sidebar {
        top: 46px;
        width: 230px;
        height: calc(100vh - 78px);
        transform: translateX(-230px);
    }

    .sidebar.collapsed {
        transform: translateX(-230px);
    }

    .sidebar.show~#map {
        left: 230px;
    }

    #map {
        top: 46px;
        bottom: 32px;
    }

    .footer {
        height: 32px;
        padding: 0 12px;
        font-size: 10px;
    }

    .footer-left,
    .footer-right {
        gap: 10px;
    }

    .footer-left span:first-child {
        display: none;
    }

    .modal-content {
        margin: 20% auto;
        padding: 18px;
        width: 95%;
    }

    #toast-container {
        bottom: 44px;
        right: 10px;
        left: 10px;
    }

    .toast {
        max-width: 100%;
        font-size: 12px;
        padding: 11px 15px;
    }

    /* 绉诲姩绔帶浠堕€傞厤 */
    .sidebar-control-btn {
        padding: 9px 10px;
        font-size: 13px;
    }

    .sidebar-control-btn i {
        width: 18px;
        font-size: 14px;
    }

    .file-upload-label {
        padding: 9px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .header {
        height: 42px;
        padding: 0 10px;
    }

    .header-left {
        gap: 8px;
    }

    .logo {
        width: 28px;
        height: 28px;
    }

    .title {
        font-size: 12px;
        max-width: 90px;
    }

    .header-right {
        gap: 8px;
    }

    .user-count {
        padding: 4px 9px;
        font-size: 11px;
        gap: 4px;
    }

    .user-count span:last-child {
        display: none;
    }

    .status-indicator {
        padding: 3px 7px;
        font-size: 9px;
    }

    #ws-status-text {
        display: none;
    }

    .sidebar {
        top: 42px;
        width: 210px;
        height: calc(100vh - 70px);
        transform: translateX(-210px);
    }

    .sidebar.show~#map {
        left: 210px;
    }

    #map {
        top: 42px;
        bottom: 28px;
    }

    .footer {
        height: 28px;
        font-size: 9px;
    }

    #toast-container {
        bottom: 36px;
    }
}

@media (max-width: 768px) and (min-resolution: 2dppx) {
    .header {
        height: 50px;
    }

    .logo {
        width: 34px;
        height: 34px;
    }

    .title {
        font-size: 16px;
    }

    .user-count {
        font-size: 13px;
        padding: 6px 12px;
    }

    .status-indicator {
        font-size: 11px;
        padding: 5px 10px;
    }

    .sidebar {
        top: 50px;
    }

    #map {
        top: 50px;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .header {
        height: 40px;
        padding: 0 10px;
    }

    .logo {
        width: 28px;
        height: 28px;
    }

    .title {
        font-size: 12px;
    }

    .sidebar {
        top: 40px;
        height: calc(100vh - 68px);
    }

    #map {
        top: 40px;
        bottom: 28px;
    }

    .footer {
        height: 28px;
    }
}

@media print {

    .header,
    .sidebar,
    .footer,
    .status-indicator,
    .modal,
    #toast-container,
    .leaflet-control {
        display: none !important;
    }

    #map {
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
    }
}

/* ==================== KML寮圭獥鏍峰紡浼樺寲 ==================== */
.kml-desc {
    margin: 8px 0;
    padding: 6px 10px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    border-left: 3px solid #667eea;
}

.kml-media {
    margin: 8px 0;
    text-align: center;
}

.kml-media img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease;
}

.kml-media img:hover {
    transform: scale(1.05);
}

.kml-media a {
    display: inline-block;
    text-decoration: none;
}

/* ==================== 涓嬭浇鑿滃崟鏍峰紡 ==================== */
.download-control-wrapper {
    position: relative;
    display: inline-block;
}

.download-menu {
    position: absolute;
    top: 48px;
    left: 0;
    width: 220px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
}

.download-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.download-menu-header {
    padding: 12px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-menu-header i {
    font-size: 16px;
}

.download-menu-hint {
    padding: 10px 14px;
    font-size: 12px;
    color: #888;
    border-bottom: 1px solid #f0f0f0;
}

.download-user-list {
    max-height: 180px;
    overflow-y: auto;
    padding: 8px;
}

.download-user-list::-webkit-scrollbar {
    width: 4px;
}

.download-user-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.download-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #333;
}

.download-user-item:hover {
    background: #f5f5f5;
}

.download-user-item.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.download-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.download-no-user {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.download-menu-actions {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #f0f0f0;
}

.download-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.download-btn.kml {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.download-btn.kml:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.download-btn.gpx {
    background: #f0f0f0;
    color: #333;
}

.download-btn.gpx:not(:disabled):hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* 绉诲姩绔笅杞借彍鍗曢€傞厤 */
@media (max-width: 480px) {
    .download-menu {
        width: 200px;
        left: -80px;
    }

    .download-user-list {
        max-height: 140px;
    }

    .download-btn {
        padding: 9px 10px;
        font-size: 12px;
    }
}

/* ==================== 鍥炬爣妯℃€佹鏍峰紡 ==================== */
.icon-modal-content {
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.icon-modal-content h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.icon-modal-content h2 i {
    color: #667eea;
}

.icon-search-wrapper {
    margin-bottom: 16px;
}

.icon-search-wrapper input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.icon-search-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.icon-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 4px;
}

.icon-gallery::-webkit-scrollbar {
    width: 6px;
}

.icon-gallery::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.icon-gallery::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.icon-item:hover {
    border-color: #667eea;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.icon-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 8px;
}

.icon-copy-btn {
    background: transparent;
    border: none;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    word-break: break-all;
    text-align: center;
    line-height: 1.3;
}

.icon-copy-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* ==================== 涓嬭浇搴旂敤妯℃€佹鏍峰紡 ==================== */
.download-modal-content {
    max-width: 450px;
}

.download-modal-content h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.download-modal-content h2 i {
    color: #667eea;
}

.download-apps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.download-app-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.download-app-item:hover {
    border-color: #667eea;
    background: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.download-app-item .app-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3ddc84 0%, #2fa866 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* 瀵煎嚭KML鍥炬爣浣跨敤钃濊壊鑳屾櫙 */
.download-app-item .app-icon.kml-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.download-app-item .app-icon i {
    font-size: 26px;
    color: white;
}

.download-app-item .app-info {
    flex: 1;
    min-width: 0;
}

.download-app-item .app-info h3 {
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
}

.download-app-item .app-info p {
    font-size: 12px;
    color: #888;
    margin: 0;
    text-align: left;
}

.download-app-item .download-link {
    padding: 8px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.download-app-item .download-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 鍥炬爣鍜屼笅杞芥ā鎬佹绉诲姩绔€傞厤 */
@media (max-width: 768px) {
    .icon-modal-content {
        margin: 5% auto;
        max-height: 90vh;
    }

    .icon-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        max-height: 55vh;
    }

    .icon-item img {
        width: 40px;
        height: 40px;
    }

    .download-app-item {
        flex-wrap: wrap;
    }

    .download-app-item .download-link {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
}

/* 闅愯棌 locus-actions 閾炬帴鐨勭姸鎬佹爮鏄剧ず */
.download-app-item .locus-download-link[data-href] {
    cursor: pointer;
}

/* 璺熼殢鎸夐挳鏍峰紡 */
.follow-btn {
    background: #e0e0e0;
    border: none;
    border-radius: 5px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-right: 5px;
}

.follow-btn:hover {
    background: #667eea;
    color: white;
}

.follow-btn.active {
    background: #4CAF50;
    color: white;
}

.follow-btn i {
    font-size: 12px;
}

/* 鐢ㄦ埛鍚嶅伐鍏锋彁绀烘牱寮?*/


