/* ========== 模态框样式（不影响页面其他部分） ========== */
.register-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 模态框显示时 */
.register-modal[style*="display: flex"] {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* 半透明背景 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

/* 模态框内容容器 */
.modal-content {
    position: relative;
    z-index: 9999;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-in-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 模态框内层 */
.modal-inner {
    padding: 24px 20px;
}

/* 关闭按钮 */
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

/* ========== 模态框内表单样式 ========== */

/* 模态框内标题 */
.modal-inner .header {
    text-align: center;
    margin-bottom: 16px;
}

.modal-inner .header h1 {
    color: #333;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

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

/* 模态框内表单组 */
.modal-inner .form-group {
    margin-bottom: 12px;
    position: relative;
}

.modal-inner .form-group label {
    display: block;
    color: #333;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
}

/* 模态框内输入框 */
.modal-inner .input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.modal-inner .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.modal-inner .form-control:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-inner .form-control::placeholder {
    color: #999;
}

/* 验证码输入框组 */
.modal-inner .verification-group {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.modal-inner .verification-group .form-control {
    flex: 1;
}

/* 发送验证码按钮 */
.modal-inner .btn-send-code {
    padding: 10px 12px;
    background: linear-gradient(135deg, #ff6a00, #ee0979);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 80px;
    height: 40px;
    flex-shrink: 0;
}

.modal-inner .btn-send-code:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 106, 0, 0.25);
}

.modal-inner .btn-send-code:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 注册提交按钮 */
.modal-inner .btn-register {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ff6a00, #ee0979);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 6px;
}

.modal-inner .btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 106, 0, 0.25);
}

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

/* 错误提示 */
.modal-inner .error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

/* 成功提示 */
.modal-inner .success-message {
    color: #27ae60;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

/* 加载动画 */
.modal-inner .loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

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

/* 倒计时 */
.modal-inner .countdown {
    color: #999;
    font-size: 12px;
}

/* 结果提示框 */
.modal-inner .result-message {
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
}

.modal-inner .result-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.modal-inner .result-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========== 响应式设计 ========== */

/* 移动端 */
@media (max-width: 600px) {
    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 16px 16px 0 0;
    }

    .modal-inner {
        padding: 20px 16px;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 32px;
        top: 8px;
        right: 8px;
    }

    .modal-inner .header h1 {
        font-size: 20px;
    }

    .modal-inner .btn-send-code {
        padding: 12px 14px;
        min-width: 90px;
        height: 44px;
    }

    .modal-inner .btn-register {
        padding: 12px;
        font-size: 15px;
    }

    .modal-inner .form-control {
        padding: 10px 12px;
        font-size: 15px;
    }
}
