/* ======================================================
   pages/jm_add.css — 禁摩区域手绘提交页专属样式
   ====================================================== */

/* 移除导航栏预留空白 */
body { padding-top: 0 !important; }
.map-type-toggle { top: 16px !important; }

/* ========== 城市搜索面板 ========== */
.city-search-panel {
    position: fixed;
    top: 10px;
    left: 16px;
    z-index: 1003;
    width: 300px;
    max-height: calc(100vh - 90px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.city-search-panel.collapsed {
    transform: translateX(-340px);
    opacity: 0;
    pointer-events: none;
}
.city-search-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.city-search-header h3 {
    font-size: 14px;
    margin: 0;
}
.city-search-header button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.city-search-header button:hover {
    background: rgba(255,255,255,0.4);
}
.city-search-body {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* ========== 切换面板按钮 ========== */
.toggle-panel-btn {
    position: fixed;
    top: 10px;
    left: 16px;
    z-index: 1004;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    font-size: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.toggle-panel-btn:hover { background: #f0f2ff; }
.toggle-panel-btn.show { display: flex; }

/* ========== 绘图工具栏 ========== */
.draw-toolbar {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1006;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 8px 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.draw-toolbar .draw-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.draw-toolbar .draw-btn:hover { background: #e8ecf4; }
.draw-toolbar .draw-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}
.draw-toolbar .draw-btn.danger {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}
.draw-toolbar .draw-btn.danger:hover { background: #ffeaa7; }
.draw-toolbar .draw-sep {
    width: 1px;
    height: 24px;
    background: #ddd;
}

/* 绘图模式提示 */
.draw-mode-hint {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1007;
    background: rgba(102,126,234,0.95);
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
    display: none;
    animation: hintPulse 2s ease-in-out infinite;
}
.draw-mode-hint.show { display: block; }
@keyframes hintPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ========== 提交表单面板 ========== */
.submit-panel {
    position: fixed;
    top: 10px;
    right: 16px;
    z-index: 1008;
    width: 300px;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.submit-panel.show { display: flex; }
.submit-panel-header {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.submit-panel-header h3 {
    font-size: 14px;
    margin: 0;
}
.submit-panel-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.submit-panel-body label {
    font-size: 12px;
    font-weight: 500;
    color: #555;
    margin-bottom: 2px;
}
.submit-panel-body input,
.submit-panel-body select,
.submit-panel-body textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}
.submit-panel-body input:focus,
.submit-panel-body select:focus,
.submit-panel-body textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102,126,234,0.1);
}
.submit-panel-body textarea {
    resize: vertical;
    min-height: 50px;
}
.submit-panel-body .form-group {
    display: flex;
    flex-direction: column;
}
.submit-panel-body .form-row {
    display: flex;
    gap: 8px;
}
.submit-panel-body .form-row .form-group { flex: 1; }
.submit-panel-body .coord-preview {
    font-size: 11px;
    color: #888;
    word-break: break-all;
    max-height: 60px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 6px 8px;
    border-radius: 4px;
}
.submit-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}
.submit-panel-footer .submit-actions {
    display: flex;
    gap: 8px;
}
.submit-panel-footer .submit-actions button {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.submit-panel-footer .submit-actions .btn-submit,
.submit-panel-body .btn-submit {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}
.submit-panel-footer .submit-actions .btn-submit:hover,
.submit-panel-body .btn-submit:hover {
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
    transform: translateY(-1px);
}
.submit-panel-footer .submit-actions .btn-cancel,
.submit-panel-body .btn-cancel {
    background: #f0f0f0;
    color: #555;
}
.submit-panel-footer .submit-actions .btn-cancel:hover,
.submit-panel-body .btn-cancel:hover { background: #e0e0e0; }

/* 道路吸附加载提示 */
.road-snap-loading {
    position: fixed;
    top: 170px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1007;
    background: rgba(102,126,234,0.95);
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
    display: none;
}
.road-snap-loading.show { display: block; }

/* ======================================================
   响应式 — 平板 (768px)
   ====================================================== */
@media (max-width: 768px) {
    /* 城市搜索面板：更窄 */
    .city-search-panel {
        width: 240px;
        top: 6px;
        left: 8px;
        max-height: calc(100vh - 80px);
    }
    .city-search-header {
        padding: 8px 10px;
    }
    .city-search-header h3 {
        font-size: 12px;
    }
    .city-search-body {
        padding: 8px;
    }

    /* 切换按钮 */
    .toggle-panel-btn {
        top: 6px;
        left: 8px;
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    /* 绘图工具栏：紧凑 */
    .draw-toolbar {
        top: 6px;
        padding: 6px 8px;
        gap: 4px;
        border-radius: 8px;
    }
    .draw-toolbar .draw-btn {
        padding: 4px 8px;
        font-size: 11px;
        border-radius: 6px;
    }
    .draw-toolbar .draw-sep {
        height: 20px;
    }

    /* 绘图模式提示 */
    .draw-mode-hint {
        top: 60px;
        padding: 6px 14px;
        font-size: 12px;
    }

    /* 提交面板：更窄 */
    .submit-panel {
        width: 240px;
        top: 6px;
        right: 8px;
        max-height: calc(100vh - 80px);
    }
    .submit-panel-header {
        padding: 10px 12px;
    }
    .submit-panel-header h3 {
        font-size: 12px;
    }
    .submit-panel-body {
        padding: 12px;
        gap: 8px;
    }
    .submit-panel-body label {
        font-size: 11px;
    }
    .submit-panel-body input,
    .submit-panel-body select,
    .submit-panel-body textarea {
        padding: 6px 8px;
        font-size: 12px;
    }
    .submit-panel-body .submit-actions button {
        padding: 8px 0;
        font-size: 12px;
    }

    /* 道路吸附提示 */
    .road-snap-loading {
        top: 100px;
        padding: 6px 14px;
        font-size: 12px;
    }
}

/* ======================================================
   响应式 — 手机 (480px)
   ====================================================== */
@media (max-width: 480px) {
    /* 城市搜索面板：底部抽屉 */
    .city-search-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 12px 12px 0 0;
    }
    .city-search-panel.collapsed {
        transform: translateY(100%);
    }
    .city-search-header {
        padding: 10px 12px;
    }
    .city-search-header h3 {
        font-size: 14px;
    }

    /* 切换按钮：更显眼 */
    .toggle-panel-btn {
        top: 6px;
        left: 6px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
    }

    /* 绘图工具栏：横向滚动或换行 */
    .draw-toolbar {
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 16px);
        padding: 6px;
        gap: 3px;
        justify-content: center;
        flex-wrap: wrap;
    }
    .draw-toolbar .draw-btn {
        padding: 6px 10px;
        font-size: 12px;
        flex: 0 0 auto;
    }
    .draw-toolbar .draw-sep {
        display: none;
    }

    /* 绘图模式提示 */
    .draw-mode-hint {
        top: 56px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 24px);
        text-align: center;
        padding: 6px 12px;
        font-size: 12px;
    }

    /* 提交面板：底部全宽抽屉 */
    .submit-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 80vh;
        border-radius: 12px 12px 0 0;
    }
    .submit-panel-header {
        padding: 12px;
    }
    .submit-panel-header h3 {
        font-size: 14px;
    }
    .submit-panel-body {
        padding: 12px;
        gap: 10px;
    }
    .submit-panel-body label {
        font-size: 12px;
    }
    .submit-panel-body input,
    .submit-panel-body select,
    .submit-panel-body textarea {
        padding: 8px 10px;
        font-size: 13px;
    }
    .submit-panel-body .form-row {
        flex-direction: column;
        gap: 0;
    }
    .submit-panel-body .submit-actions button {
        padding: 10px 0;
        font-size: 14px;
    }
    .submit-panel-body .coord-preview {
        font-size: 10px;
        max-height: 40px;
        padding: 4px 6px;
    }

    /* 道路吸附提示 */
    .road-snap-loading {
        top: 96px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 24px);
        text-align: center;
        padding: 6px 12px;
        font-size: 12px;
    }
}
