* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #2c3e50;
}

.container {
    width: 100%;
    max-width: 400px;
}

.form-container {
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

h1 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #7f8c8d;
    margin-bottom: 32px;
    font-size: 15px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

input[type="tel"] {
    width: 100%;
    padding: 16px;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #f8f9fa;
    color: #2c3e50;
}

input[type="tel"]:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

input[type="tel"].error {
    border-color: #e74c3c;
    background: #fdf2f2;
}

.error-message {
    display: block;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    min-height: 15px;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 弹窗样式 - 优化版 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 92%;
    max-width: 340px;
    max-height: 98vh;
    overflow: visible;
    animation: slideIn 0.3s ease;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@keyframes slideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

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

.modal-header h2 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.close {
    color: #999;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px 24px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.qr-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.qr-image.qr-code {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
    background: white;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.qr-instruction {
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 4px;
    font-weight: 500;
    line-height: 1.4;
}

.qr-tip {
    color: #7f8c8d;
    font-size: 12px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.push-address-container {
    text-align: left;
    margin-top: 8px;
}

.push-address-container label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
    font-size: 13px;
}

.push-address-container input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #f8f9fa;
    color: #2c3e50;
}

.push-address-container input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.push-address-container input[type="text"].error {
    border-color: #e74c3c;
    background: #fdf2f2;
}

.error-message {
    display: block;
    color: #e74c3c;
    font-size: 11px;
    margin-top: 4px;
    min-height: 12px;
    line-height: 1.2;
}

.modal-footer {
    padding: 16px 24px 20px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}

.cancel-btn {
    padding: 10px 20px;
    background: #f8f9fa;
    color: #7f8c8d;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: auto;
    width: fit-content;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
    box-sizing: border-box;
}

.cancel-btn:hover {
    background-color: #e9ecef;
    border-color: #d1d9e0;
    color: #5a6c7d;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.cancel-btn:active {
    transform: translateY(0);
    box-shadow: none;
    background-color: #e2e6ea;
}

.modal-footer .submit-btn {
    padding: 10px 20px;
    font-size: 14px;
    min-width: 90px;
    font-weight: 500;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

/* 网页风格消息弹窗样式 */
.message-modal .modal-content {
    max-width: 350px;
    text-align: center;
    padding: 0;
    overflow: hidden;
}

.message-icon {
    font-size: 48px;
    margin: 20px 0 10px 0;
    line-height: 1;
}

.message-icon.success {
    color: #28a745;
}

.message-icon.error {
    color: #dc3545;
}

.message-icon.info {
    color: #17a2b8;
}

.message-modal .modal-body p {
    margin: 15px 0 25px 0;
    font-size: 16px;
    color: #333;
    line-height: 1.5;
}

.message-modal .modal-footer {
    justify-content: center;
    padding: 20px 24px;
}

.message-modal .submit-btn {
    margin: 0;
    min-width: 100px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .form-container {
        padding: 30px 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .qr-placeholder {
        width: 180px;
        height: 180px;
    }
    
    .qr-code {
        width: 148px;
        height: 148px;
    }
    
    .message-modal .modal-content {
        max-width: 320px;
    }
}