:root {
    --main-color: #5D3FD3;
    --light-purple: #f0edff;
    --dark-purple: #4a2fb8;
    --gradient-primary: linear-gradient(135deg, #5D3FD3 0%, #8D71FF 100%);
}

/* 确保页面占满整个视口 */
html,
body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* 主要内容区域 */
.main-container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* 注册卡片 */
.register-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(93, 63, 211, 0.15);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.register-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-primary);
}

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

.register-title {
    font-size: 28px;
    font-weight: bold;
    color: var(--main-color);
    margin-bottom: 10px;
}

.register-subtitle {
    font-size: 16px;
    color: #666;
}

/* 表单样式 */
.register-form {
    width: 100%;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 20px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    background: white;
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(93, 63, 211, 0.1);
}

.input-icon {
    color: #666;
    margin-right: 12px;
    font-size: 18px;
    transition: color 0.3s ease;
    width: 20px;
    text-align: center;
}

.input-wrapper:focus-within .input-icon {
    color: var(--main-color);
}

.form-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #333;
    padding: 0;
}

.form-input::placeholder {
    color: #999;
}

.password-toggle {
    color: #ccc;
    cursor: pointer;
    padding: 0 5px;
    background: none;
    border: none;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #666;
}

/* 验证码行 */
.verification-row {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.verification-input {
    flex: 1;
}

.get-code-btn {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--dark-purple) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    min-width: 120px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(93, 63, 211, 0.3);
}

.get-code-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(93, 63, 211, 0.4);
}

.get-code-btn:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 密码强度提示 */
.password-tips {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    padding-left: 5px;
}

/* 协议同意 */
.agreement {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.agreement input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 3px;
    transform: scale(1.3);
    accent-color: var(--main-color);
}

.agreement a {
    color: var(--main-color);
    text-decoration: none;
    font-weight: 500;
}

.agreement a:hover {
    text-decoration: underline;
}

/* 注册按钮 */
.register-btn {
    width: 100%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(93, 63, 211, 0.3);
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(93, 63, 211, 0.4);
}

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

/* 登录链接 */
.login-link {
    text-align: center;
    font-size: 14px;
    color: #666;
}

.login-link a {
    color: var(--main-color);
    text-decoration: none;
    font-weight: 500;
}

.login-link a:hover {
    text-decoration: underline;
}

/* 验证提示 */
.field-validation-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* 算术验证码弹窗样式 - 全局生效 */
.captcha-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.captcha-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.captcha-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--main-color);
}

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

.captcha-body p {
    color: #666;
    margin-bottom: 15px;
}

.captcha-image-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

#captchaImage {
    flex: 1;
    min-width: 150px;
    max-width: 280px;
    height: 60px;
    border-radius: 10px;
    border: 1px solid #ddd;
    object-fit: contain;
    background: #f5f5f5;
}

.refresh-captcha {
    background: var(--light-purple);
    color: var(--main-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-captcha:hover {
    background: var(--main-color);
    color: white;
}

.captcha-input-group {
    display: flex;
    gap: 10px;
}

.captcha-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    outline: none;
    font-size: 16px;
}

.confirm-captcha-btn {
    background: var(--main-color);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
}

.captcha-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    height: 20px;
}

/* 响应式辅助 */
@media (max-width: 768px) {
    .main-container {
        padding: 30px 15px;
    }

    .register-card {
        padding: 30px 25px;
    }

    .verification-row {
        flex-direction: column;
    }

    .get-code-btn {
        min-width: 100%;
    }
}