/* 全局样式 */
:root {
    --primary-color: #4F46E5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.main-content {
    padding: 20px 0 60px;
}

.form-container {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 32px;
    max-width: 600px;
    margin: 0 auto;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
    text-align: center;
}

.form-subtitle {
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 32px;
    font-size: 15px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.required {
    color: var(--error);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background: var(--gray-50);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.error-message {
    color: var(--error);
    font-size: 13px;
    margin-top: 6px;
    min-height: 20px;
}

.error-message:not(:empty) {
    display: block;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-lg);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray-400);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-content h2 {
    font-size: 24px;
    color: var(--success);
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

#qrCodeContainer {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
}

/* 兑换码样式 */
.redemption-code-wrapper {
    width: 100%;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
}

.redemption-label {
    font-size: 14px;
    color: #0369a1;
    font-weight: 700;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.redemption-code {
    font-size: 24px;
    font-weight: 800;
    color: #0c4a6e;
    background: white;
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    padding: 16px 12px;
    margin: 12px 0;
    word-break: break-all;
    letter-spacing: 2px;
    box-shadow: inset 0 2px 4px rgba(59, 130, 246, 0.1);
}

.redemption-tip {
    font-size: 13px;
    color: #dc2626;
    font-weight: 600;
    margin: 12px 0 0 0;
    background: #fee2e2;
    padding: 10px 12px;
    border-radius: 6px;
    border-left: 4px solid #dc2626;
}

.btn-copy {
    display: inline-block;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-copy:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-copy:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: none;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 20px 0;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .container {
        padding: 0 12px;
    }

    .form-container {
        padding: 24px 20px;
        border-radius: 12px;
    }

    .form-title {
        font-size: 24px;
    }

    .modal-content {
        padding: 24px;
        width: 95%;
    }

    .logo-text {
        font-size: 20px;
    }
}
