/* main.html 页面样式 */

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

/* 地图字体覆盖样式 */
.amap-marker-label {
    font-size: 10px !important;
    font-weight: normal !important;
    border: 1px solid #ccc;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 2px 4px;
    border-radius: 4px;
}

/* 优化地图容器样式 */
#map-container {
    width: 100%;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
}

/* 隐藏地图错误提示 */
.amap-error {
    display: none !important;
}

/* 自定义地图加载失败提示 */
.map-init-error {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 80, 80, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1000;
    text-align: center;
    max-width: 80%;
    display: none;
}

.page-container {
    max-width: 100%;
    margin: 0 auto;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.map-wrapper {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    box-shadow: none;
    flex: 1;
    position: relative;
}

.map-controls {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-control-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.map-control-btn.active {
    background: #e0e0e0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.user-info {
    position: absolute;
    left: 20px;
    top: 20px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    z-index: 9999;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    min-width: 40px;
    max-width: 200px;
}

.user-info:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-name {
    color: #333;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.weather-info {
    position: absolute;
    top: 20px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 5px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    z-index: 555;
}

.button-container {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 0;
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.95);
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #4CAF50;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background: #45a049;
}

.status-message {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: rgba(76, 175, 80, 0.9);
    color: white;
    border-radius: 4px;
    font-size: 14px;
    display: none;
    z-index: 1500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    opacity: 1;
    transition: opacity 0.5s;
}

/* 标记弹窗样式 */
.marker-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 2000; /* 标记弹窗保持原有的z-index值 */
    width: 85%;
    max-width: 400px;
    display: none;
    box-sizing: border-box;
    overflow: hidden;
}

.popup-header {
    font-size: 16px;
    font-weight: normal;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    background-color: #fff;
    position: relative;
}

.popup-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.popup-image {
    width: 100%;
    height: 200px;
    background-color: #0096e0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* 图片轮播控制按钮 */
.image-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    background: rgba(0,0,0,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.popup-image:hover .image-nav {
    opacity: 1;
}

.image-nav-prev {
    left: 0;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
}

.image-nav-next {
    right: 0;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
}

.image-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    z-index: 5;
}

.popup-content {
    padding: 0;
}

.marker-info-row {
    display: flex;
    padding: 10px 15px;
    font-size: 14px;
    position: relative;
}

.marker-info-label {
    width: 70px;
    color: #333;
}

.marker-info-value {
    flex: 1;
    color: #333;
}

.marker-time {
    position: absolute;
    right: 15px;
    color: #333;
}

.marker-remark {
    background-color: #f5f5f5;
    padding: 12px 15px;
    color: #666;
    font-size: 14px;
    margin-top: 0;
}

.maintenance-status {
    display: inline-block;
    background-color: #ff5252;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 10;
}

.popup-buttons {
    display: flex;
    padding: 0;
    margin: 15px;
}

.popup-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    margin: 0 5px;
    border-radius: 5px;
}

.popup-btn.edit {
    background: #4CAF50;
    color: white;
}

.popup-btn.edit[disabled] {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
}

.popup-btn.delete {
    background: #F44336;
    color: white;
}

.popup-btn.delete[disabled] {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    display: none;
}

/* 调整PhotoSwipe的z-index，确保它高于弹窗 */
.pswp {
    z-index: 10000; /* 确保高于标记弹窗的z-index */
}

.image-loading-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px 16px;
    border-radius: 20px;
    color: white;
    text-align: center;
    z-index: 20;
}

.loading-progress-text {
    font-size: 15px;
    font-weight: normal;
    white-space: nowrap;
}

.progress-bar-fill {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s ease;
}

.loading-progress-text {
    font-size: 14px;
    font-weight: bold;
}

/* P
hotoSwipe 图片查看器样式增强 */
.popup-image.clickable {
    cursor: zoom-in;
}

.popup-image.clickable::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffffff"><path d="M3 15h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V9H3v2zm0-6v2h18V5H3z"/></svg>');
    background-size: contain;
    opacity: 0.7;
    pointer-events: none;
}

/* 给PhotoSwipe元素更高的层级 */
.pswp__bg,
.pswp__scroll-wrap,
.pswp__container,
.pswp__item,
.pswp__ui {
    z-index: 10001 !important;
}

/* 更新对话框样式 */
.update-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.update-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    width: 80%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.update-description {
    margin: 15px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

.update-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.btn-primary {
    background: #3C9BFD;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    touch-action: manipulation;
    user-select: none;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    touch-action: manipulation;
    user-select: none;
}

.btn-primary:active {
    background: #3080D0;
}

.btn-secondary:active {
    background: #e0e0e0;
}

/* 下载进度对话框样式 */
.progress-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.progress-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    width: 80%;
    max-width: 300px;
    text-align: center;
}

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

.progress-bar {
    height: 100%;
    background: #3C9BFD;
    width: 0%;
    transition: width 0.3s;
}
