/* 全局样式重置 */
body {
    margin: 0;
    padding: 0;
}

/* 地图容器 */
#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}

/* ==================== 地图控件 ==================== */

/* 自定义缩放等级控件 */
#zoom-level-control {
    position: absolute;
    top: 102px;
    right: 9px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 4px;
    border: 1px solid rgba(111, 111, 111, 0.6);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#zoom-level-display {
    width: 28px;
    height: 28px;
    line-height: 30px;
    text-align: center;
    font-size: 12px;
    color: #333;
    cursor: default;
}

/* ==================== 控制面板 ==================== */

/* 可折叠控制面板核心样式 */
.control-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.95);
    z-index: 100;
    max-width: 320px;
    width: 300px;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

/* 面板头部（折叠/展开开关） */
.panel-header {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.panel-header h3 {
    margin: 0;
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

/* 面板内容（可折叠） */
.panel-content {
    padding: 15px;
    max-height: 550px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.panel-content.collapsed {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
}

/* 滑动开关样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #f0f0f0;
    transition: .2s ease-in-out;
    border-radius: 20px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .2s ease-in-out;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

input:checked+.toggle-slider {
    background: #0e9a8a;
}

input:checked+.toggle-slider:before {
    transform: translateX(20px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

/* 信息提示框 */
.info-box {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin: 10px 0;
}

.info-box i {
    color: #e67e22;
    margin-right: 5px;
}

/* ==================== 控制项 ==================== */

/* 控制组样式 */
.control-group {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 1px;
}

/* 开关项布局 */
.control-group.switch-group {
    display: block;
    margin-bottom: 15px;
}

.control-group:last-child {
    margin-bottom: 0;
}

/* 标签样式 */
.control-group label:not(.toggle-switch) {
    flex: 0 0 auto;
    width: 60px;
    font-size: 12px;
    color: #444;
    margin-bottom: 0;
    white-space: nowrap;
}

/* 开关项的标签样式 */
.switch-wrapper {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.switch-wrapper label {
    font-size: 13px;
    color: #444;
}

/* 复选框样式 */
.control-group input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
    transform: scale(1.1);
}

/* 值显示 */
.value-display {
    text-align: right;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
    flex: 0 0 30px;
}

/* ==================== 滑块 ==================== */

/* 自定义滑块 - 通用样式 */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    min-width: 120px;
    flex: 1;
    height: 4px;
    background: #f0f0f0;
    border-radius: 3px;
    outline: none;
    background: linear-gradient(to right, #e5e6eb 0%, #e5e6eb var(--value), #f0f0f0 var(--value), #f0f0f0 100%);
}

/* Webkit内核浏览器 - 轨道样式 */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    border-radius: 3px;
    background: linear-gradient(to right, #e5e6eb, #e5e6eb) no-repeat #f0f0f0;
    background-size: var(--webkit-value) 100%;
}

/* 滑块按钮 - Chrome/Safari/Edge */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #999;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: background 0.2s;
    margin-top: -4px;
}

/* 滑块按钮 hover 效果 */
input[type="range"]::-webkit-slider-thumb:hover {
    background: #0e9a8a;
}

/* Firefox 兼容 - 滑块按钮 */
input[type="range"]::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #e5e6eb;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Firefox 兼容 - 已划过轨道 */
input[type="range"]::-moz-range-progress {
    height: 4px;
    border-radius: 3px;
    background: #e5e6eb;
}

/* Firefox 兼容 - 未划过轨道 */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    border-radius: 3px;
}

/* hover时同步已划过部分颜色 */
input[type="range"]:hover::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #45c4ae, #45c4ae) no-repeat #f0f0f0;
    background-size: var(--webkit-value) 100%;
}

input[type="range"]:hover::-moz-range-progress {
    background: #0e9a8a;
}

/* ==================== 颜色选择器 ==================== */

/* 颜色选择器容器 */
.color-control-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.color-control-row label {
    flex: 0 0 70px;
    font-size: 12px;
    color: #444;
}

.color-control-row .value-display {
    flex: 1;
    text-align: left;
    margin-top: 0;
    font-size: 11px;
}

/* 颜色选择器 */
.color-picker-wrapper {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    box-sizing: border-box;
}

.color-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
    transform: scale(4);
    transform-origin: top left;
}

.color-preview {
    width: 100%;
    height: 100%;
    background-color: var(--color-value, #000);
    border-radius: 0.5px;
}

/* ==================== 按钮 ==================== */

/* 按钮容器 */
.button-container {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin: 25px auto 0;
}

/* 按钮组 */
.first-two-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

/* 导出图片按钮 */
.export-btn {
    width: 100%;
    padding: 8px 12px;
    display: block;
    margin: 0;
    background-color: #0e9a8a;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    user-select: none;
}

.export-btn:hover {
    background-color: #45c4ae;
}

.export-btn:active {
    background-color: #36b09b;
}

/* 文字显示控制按钮 */
.text-control-btn {
    width: 100%;
    padding: 8px 12px;
    display: block;
    margin: 0;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.text-control-btn:hover {
    background-color: #5a6268;
}

.text-control-btn:active {
    background-color: #495057;
}

.text-control-btn.hidden {
    background-color: #dc3545;
}

.text-control-btn.hidden:hover {
    background-color: #c82333;
}

/* 按钮加载动画 */
.btn-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
    animation: spin 1s linear infinite;
    animation-play-state: running;
}

.export-btn.loading .btn-loading-spinner {
    opacity: 1;
}

/* 旋转动画 */
@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ==================== 模态框 ==================== */

/* 弹窗遮罩 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 弹窗容器 */
.modal-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
    width: 90%;
    max-width: 400px;
    padding: 24px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-container {
    transform: translateY(0);
}

/* 弹窗标题 */
.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title i {
    color: #0e9a8a;
    font-size: 20px;
}

/* 弹窗内容 */
.modal-content {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

/* 弹窗按钮容器 */
.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 弹窗按钮 */
.modal-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

/* 取消按钮 */
.modal-btn.cancel {
    background: #f8f9fa;
    color: #666;
}

.modal-btn.cancel:hover {
    background: #e9ecef;
}

/* 确认按钮 */
.modal-btn.confirm {
    background: #0e9a8a;
    color: white;
}

.modal-btn.confirm:hover {
    background: #45c4ae;
}

/* 成功/失败提示图标 */
.modal-icon-success {
    color: #28a745;
}

.modal-icon-error {
    color: #dc3545;
}

/* ==================== 操作说明弹窗 ==================== */

/* 操作说明弹窗遮罩 */
.modal-overlay.instructions-modal {
    background: rgba(0, 0, 0, 0.3);
}

.modal-container.instructions-container {
    max-width: 380px;
    padding: 20px;
}

/* 操作说明标题 */
.modal-title.instructions-title {
    color: #FF6F61;
    font-size: 16px;
    font-weight: bold;
    font-family: "SimHei", "Microsoft YaHei", sans-serif;
}

/* 操作说明内容 */
.modal-content.instructions-content {
    font-size: 13px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 0;
}

/* 移除操作说明弹窗的按钮区 */
.instructions-container .modal-buttons {
    display: none;
}

/* ==================== 浮动提示 ==================== */

/* 浮动卡片样式 */
.floating-instructions {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: white;
    padding: 15px 15px 25px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 350px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    pointer-events: none;
    font-size: 13px;
    line-height: 1.8;
}

/* 显示状态 */
.floating-instructions.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* 浮动提示标题 */
.floating-instructions h3 {
    font-size: 14px;
    margin: 0 0 8px 0;
    font-weight: bold;
    font-family: "SimHei", "Microsoft YaHei", sans-serif;
    color: #FF6F61;
}

/* 浮动提示内容 */
.floating-instructions p {
    margin-bottom: 4px;
}

.floating-instructions p:last-child {
    margin-bottom: 0;
}