body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

#map {
    position: absolute;
    top: 56px;
    bottom: 0;
    width: 100%;
    height: calc(100vh - 56px);
}

.photo-marker {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid white;
}

.photo-marker:hover {
    transform: scale(1.1);
    z-index: 1000 !important;
}

.photo-marker img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.photo-cluster {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.photo-cluster:hover {
    transform: scale(1.1);
    z-index: 1000 !important;
}

.cluster-photo {
    position: absolute;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
}

.cluster-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cluster-count {
    position: absolute;
    bottom: -8px;
    right: 18px;
    background-color: #ff4757;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.photo-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.photo-viewer.active {
    opacity: 1;
    visibility: visible;
}

.photo-container {
    position: relative;
    width: 90%;
    height: 70%;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo-display {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-photo {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.25);
}

.photo-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    pointer-events: none;
}

.nav-btn {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #2c3e50;
    font-size: 24px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover {
    background-color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #2c3e50;
    font-size: 20px;
    cursor: pointer;
    z-index: 1010;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.close-btn:hover {
    background-color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.photo-toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 8px 12px;
    background-color: transparent;
    margin-top: 15px;
    margin-bottom: 10px;
}

.toolbar-btn {
    padding: 6px 12px;
    background-color: rgba(44, 62, 80, 0.85);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.toolbar-btn:hover {
    background-color: #34495e;
    transform: translateY(-2px);
}

.toolbar-btn.delete-btn {
    background-color: rgba(231, 76, 60, 0.85);
}

.toolbar-btn.delete-btn:hover {
    background-color: #c0392b;
}

/* 预览栏 */
.photo-preview {
    display: flex;
    overflow-x: hidden;
    gap: 8px;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    /* width: 100%; */
    scroll-behavior: smooth;
}

.preview-item {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.preview-item:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.preview-item.active {
    opacity: 1;
    border: 2px solid #3498db;
    transform: scale(1.1);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-count-indicator {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.total-photo-count {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    background-color: #2c3e50;
    color: white;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
}

.navbar {
    z-index: 1000;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* 右键菜单样式 */
.custom-context-menu {
    display: none;
    position: absolute;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    padding: 5px 0;
}

.custom-context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.custom-context-menu li {
    padding: 8px 15px;
    cursor: pointer;
}

.custom-context-menu li:hover {
    background-color: #f0f0f0;
}

/* 详情面板 */
.photo-details {
    position: absolute;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100%;
    background-color: white;
    padding: 20px;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.photo-details.open {
    left: 0;
}

.photo-details h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.detail-item {
    margin-bottom: 15px;
}

.detail-item label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #7f8c8d;
}

.detail-item .value {
    color: 2c3e50;
    word-wrap: break-word;
    word-break: normal;
}

/* 备注区域 */
.note-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.note-section h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.note-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 10px;
}

/* 进度条样式 */
.progress-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: none;
    min-width: 300px;
    text-align: center;
}

.progress-bar {
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3498db;
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

/* 搜索标记样式 */
.search-marker {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .photo-preview-container {
        width: 95%;
    }

    .preview-nav-btn {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .preview-prev-btn {
        left: -10px;
    }
    
    .preview-next-btn {
        right: -10px;
    }
    
    .preview-item {
        width: 40px;
        height: 40px;
    }
    
    .photo-container {
        width: 95%;
        height: 60%;
    }
    
    .photo-details {
        width: 280px;
    }
    
    .photo-toolbar {
        flex-wrap: wrap;
    }
    
    .photo-preview {
        flex-wrap: wrap;
        max-width: 90%;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .navbar .btn {
        font-size: 12px;
        padding: 5px 8px;
    }
    
    #search-input {
        max-width: 150px !important;
    }
}

.navbar-hidden {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

/* 调整Leaflet缩放控件位置 */
.leaflet-top.leaflet-left {
    top: 80px;
}

/* 隐藏缩放控件的类 */
.leaflet-control-zoom-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* 导出选项样式 */
.export-options {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: none;
    min-width: 300px;
}

.export-options h5 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.export-options .form-check {
    margin-bottom: 15px;
}

.export-options .btn-group {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 56px;
    right: -350px;
    width: 350px;
    height: calc(100% - 56px);
    background-color: white;
    padding: 20px;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

.sidebar.open {
    right: 0;
}

.sidebar h4 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.photo-list {
    margin-top: 20px;
}

.photo-list-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

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

.photo-list-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}

.photo-list-info {
    flex-grow: 1;
}

.photo-list-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.photo-list-location {
    font-size: 12px;
    color: #7f8c8d;
}

.photo-list-actions {
    display: flex;
    gap: 5px;
}

.photo-list-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #7f8c8d;
}

.photo-list-btn:hover {
    color: #3498db;
}

/* 确保预览项不会被压缩 */
.preview-item {
    flex: 0 0 auto;
}

/* 添加滚动条样式 */
.photo-preview::-webkit-scrollbar {
    height: 8px;
}

.photo-preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.photo-preview::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.photo-preview::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.photo-preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 90%;
    max-width: 600px;
    margin-bottom: 20px;
}

/* 预览栏导航按钮 */
.preview-nav-btn {
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #2c3e50;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    border: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.preview-nav-btn:hover {
    opacity: 1;
    background-color: white;
}

.preview-prev-btn {
    left: -15px;
}

.preview-next-btn {
    right: -15px;
}

.preview-nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.preview-nav-btn.disabled:hover {
    background-color: rgba(255, 255, 255, 0.8);
    opacity: 0.3;
}

