/* 注册页面布局 */
.register-page {
    background: #f5f5f5;
    min-height: 100vh;
}

.register-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式确保在注册页面生效 */
.register-page .header {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: center; /* 改为居中 */
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative; /* 添加相对定位 */
}

.register-page .header h1 {
    color: #333;
    font-size: 1.5rem;
    margin: 0;
}

.register-page .back-btn {
    color: #667eea;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #667eea;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    position: absolute; /* 绝对定位 */
    left: 20px; /* 距离左边20px */
}

.register-page .back-btn:hover {
    background: #667eea;
    color: white;
}

.form-section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-section h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    color: #333;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.required {
    color: #e74c3c;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* 坐标输入 */
.coord-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.coord-input input {
    flex: 1;
}

.coord-btn {
    padding: 10px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.coord-btn:hover {
    background: #5a6fd8;
}

.help-text {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

/* 图片上传 */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.upload-item label {
    margin-bottom: 8px;
}

.upload-box {
    position: relative;
    width: 150px;
    height: 150px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.3s;
}

.upload-box:hover {
    border-color: #667eea;
}

.upload-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-box:hover .upload-overlay {
    opacity: 1;
}

.upload-text {
    font-size: 14px;
}

/* 表单操作 */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

.submit-btn {
    padding: 12px 40px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

.submit-btn:hover {
    background: #5a6fd8;
}

.form-notice {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
}

.map-container {
    height: 300px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.map-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-primary {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary {
    padding: 8px 16px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 上传状态样式 */
.upload-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px;
    font-size: 12px;
    text-align: center;
}

.upload-status-uploading {
    background: rgba(52, 152, 219, 0.8);
}

.upload-status-success {
    background: rgba(46, 204, 113, 0.8);
}

.upload-status-error {
    background: rgba(231, 76, 60, 0.8);
}

/* 模拟地图样式 */
.mock-map {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.map-controls {
    padding: 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
}

.map-controls button {
    padding: 8px 12px;
    border: 1px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 4px;
    cursor: pointer;
}

.map-controls button:hover {
    background: #667eea;
    color: white;
}

.map-area {
    flex: 1;
    position: relative;
    background: #e9ecef;
    overflow: hidden;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    height: 100%;
}

.grid-cell {
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.grid-cell:hover {
    background: #f8f9fa;
}

.grid-cell.selected {
    background: #667eea;
}

.map-marker {
    position: absolute;
    font-size: 24px;
    display: none;
    transform: translate(-50%, -100%);
    pointer-events: none;
}

.location-info {
    padding: 10px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.map-error {
    text-align: center;
    padding: 40px;
}

/* 表单验证样式 */
input.error, select.error, textarea.error {
    border-color: #e74c3c !important;
}

.field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
}

.form-message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.form-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .upload-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .upload-box {
        width: 100%;
        height: 120px;
    }
}