* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: #fff;
    z-index: 1600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.top-bar-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.top-bar-title-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.top-bar-title-main {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
}

.top-bar-subtitle {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
}

.top-bar-tip {
    font-size: 11px;
    opacity: 0.85;
}

.top-bar-author {
    font-size: 14px;
    opacity: 0.9;
}

.top-bar-feedback-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    margin-right: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffeb3b;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.top-bar-feedback-link:hover {
    background: rgba(255, 255, 255, 0.24);
    color: #fff59d;
    opacity: 1;
}

.top-bar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    transform: translateX(-8%);
}

.top-bar-stats {
    font-size: 16px;
    padding: 4px 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

.top-bar-stats-number {
    font-size: 22px;
    font-weight: 700;
}

.map-section {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#mapContainer {
    width: 100%;
    height: 100%;
}

/* 地图上图片标记的外框样式（仅应用于非 SVG 的图片图标） */
.amap-marker img[src^="data:image/"]:not([src*="svg+xml"]),
.amap-marker img[src^="https"] {
    border-radius: 8px !important;
    border: 3px solid #667eea;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.45);
    background-color: #ffffff;
}

/* 确保底图四角也被圆角裁剪 */
.amap-marker .amap-icon,
.amap-marker .amap-marker-content {
    border-radius: 8px;
    overflow: hidden;
}

/* 覆盖高德默认 label 样式，使叠加内容背景透明且无边框（保留以防后续使用） */
.amap-marker-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* 多张照片标记缩略图的专用外框样式 */
.multi-photo-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid #ff9800;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
    background-color: #000;
}

.multi-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* 多张照片缩略图右下角的“...”标记 */
.multi-photo-more {
    position: absolute;
    right: 4px;
    bottom: 3px;
    font-size: 16px;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

/* 浮窗上传界面（点击按钮弹出，可关闭） */
.upload-float-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    left: auto;
    width: 380px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.upload-float-panel.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.upload-float-panel.minimized .upload-panel-content {
    display: none;
}

.upload-float-panel.minimized {
    height: auto;
}

.upload-panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
}

.upload-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.upload-panel-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.upload-area {
    width: 100%;
}

.description-input {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    resize: vertical;
    min-height: 80px;
}

.description-input:focus {
    outline: none;
    border-color: #667eea;
}

.description-label {
    display: block;
    margin-top: 15px;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-input {
    display: none;
}

.file-label {
    display: block;
    padding: 15px 20px;
    background: white;
    border: 2px dashed #667eea;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: #667eea;
    font-weight: 500;
}

.file-label:hover {
    background: #f0f4ff;
    border-color: #764ba2;
}

.file-label.has-file {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.preview-area {
    margin-top: 15px;
    text-align: center;
}

.preview-image {
    max-width: 110px;
    max-height: 110px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 10px auto;
    display: block;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-direction: column;
    width: 100%;
    margin-top: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 打开浮窗按钮 */
.open-upload-btn {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1500;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.open-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.open-upload-btn.hidden {
    display: none;
}

.info-panel {
    position: absolute;
    top: 80px;
    left: 20px;
    right: auto;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1500;
    max-width: 360px;
    display: none;
}

.info-panel.show {
    display: block;
}

.info-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.info-panel-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-panel-close-btn:hover {
    color: #333;
}

.info-panel h3 {
    margin-bottom: 10px;
    color: #667eea;
    font-size: 16px;
}

.info-panel p {
    margin: 5px 0;
    font-size: 13px;
    color: #666;
}

.info-panel img {
    width: 100%;
    border-radius: 5px;
    margin-top: 10px;
    max-height: 260px;
    object-fit: contain;
}

.photo-loading-spinner {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    animation: photo-spin 0.8s linear infinite;
    margin: 60px auto 10px;
}

@keyframes photo-spin {
    to {
        transform: rotate(360deg);
    }
}

.info-photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.info-photos-grid img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.status-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-size: 13px;
    text-align: center;
}

.upload-location {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f5f7ff;
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

.upload-progress {
    margin-top: 10px;
    padding: 6px 0;
}

.upload-progress-bar-wrapper {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    overflow: hidden;
}

.upload-progress-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.2s ease;
}

.upload-progress-text {
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    text-align: right;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.r2-notice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2100;
}

.r2-notice-overlay.show {
    display: flex;
}

.r2-notice-dialog {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 24px;
    max-width: 360px;
    width: calc(100% - 40px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.r2-notice-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #667eea;
}

.r2-notice-actions {
    margin-top: 14px;
    text-align: right;
}

.r2-notice-close-btn {
    padding: 6px 14px;
    border-radius: 16px;
    border: none;
    background: #667eea;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
}

.r2-notice-close-btn:hover {
    background: #5563d6;
}

.cluster-modal-overlay {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.cluster-modal-overlay.show {
    display: flex;
}

.cluster-modal-dialog {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 600px;
    width: calc(100% - 40px);
    max-height: 80vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
}

.cluster-modal-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cluster-modal-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(5, 90px);
    grid-auto-rows: 90px;
    gap: 8px;
    /* 最多可见 3 行，超出部分使用滚动条 */
    max-height: calc(3 * 90px + 2 * 8px);
    overflow-y: auto;
    justify-content: flex-start;
}

.cluster-modal-grid img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.cluster-modal-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cluster-modal-close-btn:hover {
    color: #333;
}

copyright {
    position: fixed;
    right: 12px;
    bottom: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    z-index: 1500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.refresh-tip {
    position: fixed;
    left: 3px;
    bottom: 3px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.95);
    z-index: 1500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    background-color: #667eea;
    padding: 6px 10px;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .upload-float-panel {
        width: calc(100vw - 40px);
        top: 70px;
        right: 10px;
        left: auto;
        max-height: calc(100vh - 90px);
    }

    .open-upload-btn {
        top: 70px;
        right: 10px;
        padding: 12px 20px;
        font-size: 14px;
    }

    .button-group {
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .top-bar {
        height: auto;
        padding: 6px 10px;
        flex-wrap: wrap;
        gap: 4px 8px;
    }

    .top-bar-title-main {
        font-size: 18px;
    }

    .top-bar-subtitle {
        font-size: 11px;
    }

    .top-bar-tip {
        display: none;
    }

    .top-bar-center {
        order: 2;
        flex: 0 0 100%;
        margin-left: 0;
        margin-top: 0;
        transform: none;
        display: flex;
        justify-content: center;
    }

    .top-bar-stats {
        font-size: 13px;
        padding: 4px 10px;
    }

    .top-bar-author {
        order: 3;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 4px;
        font-size: 12px;
    }

    .top-bar-feedback-link {
        margin-right: 0;
        padding: 2px 8px;
        font-size: 11px;
    }

    .info-panel {
        top: 72px;
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .info-panel img {
        max-height: 200px;
    }

    .cluster-modal-dialog {
        max-width: 100%;
        width: calc(100% - 24px);
        padding: 12px 14px;
    }

    .cluster-modal-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 90px;
    }

    .cluster-modal-grid img {
        width: 100%;
        height: 100%;
    }

    .upload-float-panel {
        top: 68px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .open-upload-btn {
        top: 68px;
        right: 10px;
        padding: 10px 16px;
        font-size: 13px;
    }

    .copyright,
    .refresh-tip {
        font-size: 11px;
    }

    .refresh-tip {
        left: 8px;
        bottom: 8px;
        padding: 4px 8px;
    }
}
