* {
    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(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.register-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
}

.register-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 35px 30px;
    text-align: center;
}

.register-header h1 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 8px;
}

.register-header p {
    font-size: 14px;
    opacity: 0.9;
}

.register-body {
    padding: 35px 30px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group label .required {
    color: #f44336;
    margin-left: 2px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-wrapper input::placeholder {
    color: #aaa;
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
}

/* 验证码区域 */
.captcha-group {
    display: flex;
    gap: 10px;
}

.captcha-input {
    flex: 1;
}

.captcha-btn {
    padding: 12px 20px;
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.captcha-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
}

.captcha-btn:disabled {
    background: #e0e0e0;
    cursor: not-allowed;
    color: #999;
}

/* 密码强度 */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-weak {
    width: 33%;
    background: #f44336;
}

.strength-medium {
    width: 66%;
    background: #ff9800;
}

.strength-strong {
    width: 100%;
    background: #4caf50;
}

.strength-text {
    font-size: 12px;
    margin-top: 4px;
    color: #999;
}

/* 协议复选框 */
.agreement {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
}

.agreement input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #667eea;
}

.agreement label {
    cursor: pointer;
    line-height: 1.5;
}

.agreement a {
    color: #667eea;
    text-decoration: none;
}

.agreement a:hover {
    text-decoration: underline;
}

/* 注册按钮 */
.register-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.register-btn:active {
    transform: translateY(0);
}

.register-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 已有账号 */
.login-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.login-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.login-link a:hover {
    text-decoration: underline;
}

/* 错误/成功提示 */
.error-message,
.success-message {
    display: none;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
    border-left: 4px solid;
}

.error-message {
    background: #fee;
    color: #c00;
    border-left-color: #c00;
}

.success-message {
    background: #efe;
    color: #060;
    border-left-color: #060;
}

/* 输入框验证状态 */
.input-wrapper.error input {
    border-color: #f44336;
}

.input-wrapper.success input {
    border-color: #4caf50;
}

.error-text {
    color: #f44336;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.input-wrapper.error .error-text {
    display: block;
}

/* 加载动画 */
.loading {
    display: none;
    text-align: center;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 480px) {
    .register-header {
        padding: 25px 20px;
    }

    .register-header h1 {
        font-size: 22px;
    }

    .register-body {
        padding: 25px 20px;
    }

    .captcha-group {
        flex-direction: column;
    }

    .captcha-btn {
        width: 100%;
    }
}

/* 动画效果 */
.form-group {
    animation: fadeInUp 0.5s ease-out;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.25s; }
.form-group:nth-child(5) { animation-delay: 0.3s; }
.form-group:nth-child(6) { animation-delay: 0.35s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 密码可见性切换 */
.toggle-password {
    cursor: pointer;
    user-select: none;
}

.toggle-password:hover {
    color: #667eea;
}