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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(180deg, #fef9f2 0%, #fdf3e5 15%, #fef8f0 30%, #fdf4e6 50%, #fef9f2 70%, #fdf3e5 90%, #fef8f0 100%);
    color: #3d2b1a;
    min-height: 100vh;
    padding: 15px;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    padding: 20px 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.header-logo {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

.header-logo img {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    object-fit: contain !important;
}

.header-brand-text {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    letter-spacing: 0.5px;
}

.header h1 {
    color: #333;
    font-size: 24px;
    margin-bottom: 8px;
}

.header p {
    color: #666;
    font-size: 14px;
}

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

.form-item label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-item label span {
    color: #ff4757;
}

.form-item input,
.form-item textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    outline: none;
}

.form-item input:focus,
.form-item textarea:focus {
    border-color: #667eea;
}

.form-item input.error,
.form-item textarea.error {
    border-color: #ff4757;
}

.form-item .error-msg {
    color: #ff4757;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-item .error-msg.show {
    display: block;
}

.form-item textarea {
    resize: none;
    height: 80px;
}

.number-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.number-input input {
    width: 60%;
    text-align: center;
}

.number-btn {
    width: 35%;
    display: flex;
    justify-content: space-between;
}

.number-btn button {
    width: 45px;
    height: 45px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.number-btn button:active {
    background: #667eea;
    color: white;
}

.number-btn .count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.submit-btn {
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF4757 100%);
    color: white;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 5px;
    transition: all 0.3s;
    box-shadow: 0 3px 12px rgba(255, 71, 87, 0.35);
}

.submit-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

.submit-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 40px 50px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-content.success {
    border-top: 4px solid #2ed573;
}

.modal-content.error {
    border-top: 4px solid #ff4757;
}

.modal-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.modal-message {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.modal-btn {
    padding: 10px 30px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.modal-btn.confirm {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF4757 100%);
    color: white;
}

.modal-qrcode {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
}

.modal-qrcode img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
}

.modal-qrcode p {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wechat-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    margin-left: auto;
}

.wechat-qr-thumb {
    width: 40px;
    height: 40px;
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: contain;
}

.wechat-label {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.wechat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.wechat-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.wechat-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.wechat-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wechat-modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.wechat-modal-qrcode {
    margin-bottom: 15px;
}

.wechat-modal-qrcode img {
    width: 200px;
    height: 200px;
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    object-fit: contain;
}

.wechat-modal-tip {
    font-size: 14px;
    color: #666;
}

@media screen and (max-width: 480px) {
    .container {
        padding: 20px 15px !important;
    }
    
    .header-top {
        align-items: center !important;
        display: flex !important;
        justify-content: space-between !important;
    }
    
    .header-logo {
        width: 32px !important;
        height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
    }
    
    .header-logo img {
        width: 26px !important;
        height: 26px !important;
        max-width: 26px !important;
        max-height: 26px !important;
    }
    
    .header-brand-text {
        font-size: 13px !important;
    }
    
    .wechat-btn {
        padding: 4px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2px !important;
        margin-left: auto !important;
        position: static !important;
        top: auto !important;
        right: auto !important;
    }
    
    .wechat-qr-thumb {
        width: 32px !important;
        height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        object-fit: contain !important;
    }
    
    .wechat-label {
        font-size: 10px !important;
    }
    
    .wechat-modal-qrcode img {
        width: 180px !important;
        height: 180px !important;
    }
}