/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

/* 容器样式 - 响应式布局 */
.container {
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 标题样式 */
h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

/* 表单组样式 - 字段间距20px */
.form-group {
    margin-bottom: 20px;
}

/* 标签样式 */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 16px;
}

/* 必填标识 - 红色星号 */
.required {
    color: #dc3545;
    margin-left: 2px;
}

/* 输入框和下拉框样式 - 触摸目标最小44px */
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.3s;
}

/* 输入框聚焦状态 */
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 输入框错误状态 */
.form-group input.error,
.form-group select.error {
    border-color: #dc3545;
}

.form-group input.error:focus,
.form-group select.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* 错误提示样式 - 红色 */
.error-message {
    display: none;
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    min-height: 20px;
}

/* 提交按钮样式 - 蓝色 */
.submit-btn {
    width: 100%;
    min-height: 44px;
    padding: 12px;
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

/* 提交按钮悬停状态 */
.submit-btn:hover {
    background-color: #0056b3;
}

/* 提交按钮禁用状态 */
.submit-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 消息提示样式 */
.message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
    display: none;
}

/* 成功消息 */
.message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 错误消息 */
.message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 移动端适配 - 小于768px全宽布局 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
        border-radius: 0;
        box-shadow: none;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 15px;
    }
    
    .form-group input[type="text"],
    .form-group input[type="tel"],
    .form-group select {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 18px;
    }
}

/* 地图选择器样式 */
#map-container {
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background-color: #f9f9f9;
}

#map-search {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#map-search-input {
    flex: 1;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#map-search-btn {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 16px;
    color: #fff;
    background-color: #28a745;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#map-search-btn:hover {
    background-color: #218838;
}

#amap {
    border-radius: 4px;
    margin-bottom: 10px;
}

#map-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

#map-confirm-btn,
#map-cancel-btn {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#map-confirm-btn {
    color: #fff;
    background-color: #007bff;
}

#map-confirm-btn:hover {
    background-color: #0056b3;
}

#map-cancel-btn {
    color: #333;
    background-color: #e0e0e0;
}

#map-cancel-btn:hover {
    background-color: #d0d0d0;
}

/* 只读输入框样式 */
input[readonly] {
    background-color: #f5f5f5;
    cursor: pointer;
}

input[readonly]:hover {
    background-color: #e9ecef;
}


/* 微信风格地图选择器 - 全屏覆盖层 */
.map-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.map-picker-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 顶部搜索栏 */
.map-header {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.map-back-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    padding: 0;
}

.map-back-btn:active {
    opacity: 0.6;
}

.map-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 22px;
    padding: 0 15px;
    height: 44px;
    margin-left: 5px;
}

.search-icon {
    color: #999;
    margin-right: 8px;
    flex-shrink: 0;
}

.map-search-box input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 16px;
    color: #333;
    min-height: auto;
    padding: 0;
}

.map-search-box input::placeholder {
    color: #999;
}

/* 地图画布 */
.map-canvas {
    flex: 1;
    width: 100%;
    position: relative;
}

/* 中心定位图标 */
.map-center-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 5;
    pointer-events: none;
    animation: markerDrop 0.3s ease-out;
}

@keyframes markerDrop {
    0% {
        transform: translate(-50%, -120%);
    }
    100% {
        transform: translate(-50%, -100%);
    }
}

/* 底部地址信息卡片 */
.map-address-card {
    background-color: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 10;
}

.address-info {
    margin-bottom: 15px;
}

.address-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}

.address-detail {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.map-confirm-button {
    width: 100%;
    height: 50px;
    background-color: #07C160;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.map-confirm-button:active {
    background-color: #06AD56;
}

.map-confirm-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 搜索结果列表 */
.search-results {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff;
    z-index: 15;
    display: flex;
    flex-direction: column;
}

.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.close-search-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.close-search-btn:active {
    opacity: 0.6;
}

.search-results-list {
    flex: 1;
    overflow-y: auto;
}

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:active {
    background-color: #f5f5f5;
}

.search-result-name {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
    font-weight: 500;
}

.search-result-address {
    font-size: 14px;
    color: #999;
    line-height: 1.4;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .map-header {
        padding: 8px;
    }
    
    .map-address-card {
        padding: 15px;
    }
    
    .address-title {
        font-size: 16px;
    }
    
    .address-detail {
        font-size: 13px;
    }
    
    .map-confirm-button {
        height: 48px;
        font-size: 16px;
    }
}
