/* 登录弹窗样式 - 用于动态加载 */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center; /* 确保弹窗在页面中间 */
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto; /* 允许整个模态框在需要时滚动 */
    padding: 20px 0; /* 添加上下padding，确保有足够的滚动空间 */
}

/* 显示模态框时的样式 */
.login-modal.active {
    opacity: 1;
    visibility: visible;
    display: flex !important;
    align-items: center !important; /* 保持居中对齐 */
    justify-content: center !important;
    pointer-events: auto;
}

/* 模态框内容样式 */
.login-modal .modal-content {
    width: 900px; /* 适中的宽度 */
    max-width: 90%; /* 确保在不同设备上有合适的宽度 */
    max-height: 90vh; /* 增加最大高度，确保内容可见 */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    background: #fff;
    position: relative;
    z-index: 2001;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
    padding: 0;
    margin: auto; /* 确保在小屏幕上居中 */
}

/* 激活时的内容样式 */
.login-modal.active .modal-content {
    opacity: 1;
    transform: scale(1);
}

/* 关闭按钮样式 */
.login-modal .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2100;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    pointer-events: auto !important; /* 确保按钮可点击 */
}

.login-modal .modal-close:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
    transform: scale(1.1);
}

/* 左侧背景区域 */
.login-modal-left {
    width: 50%;
    background-image: url('/assets/image/login-background.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    min-height: 500px;
    overflow-y: auto; /* 允许左侧内容滚动 */
}

.login-modal-left-text {
    position: absolute;
    top: 20%;
    left: 10%;
    right: 10%;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background-color: rgba(60, 60, 70, 0.5);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 80%;
    z-index: 10; /* 确保文本在最上层 */
}

.login-modal-left-text h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.login-modal-left-text p {
    font-size: 0.9rem;
    opacity: 0.9;
    max-width: 80%;
}

/* 右侧表单区域 */
.login-modal-right {
    width: 50%;
    padding: 2.5rem 3rem; /* 增加内边距，使用更多可用空间 */
    background: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 确保内容在中间位置 */
    align-items: center; /* 水平居中 */
    overflow-y: auto; /* 允许右侧内容滚动 */
    box-sizing: border-box; /* 确保padding计入总宽度 */
}

/* 表单容器样式 */
.form-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 内容垂直居中 */
    align-items: center; /* 内容水平居中 */
    max-width: 95%; /* 增加表单最大宽度，更好利用空间 */
}

/* 登录/注册表单 */
.login-form, .register-form {
    width: 100%;
}

/* 表单标题 */
.login-form-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    color: #333;
    width: 100%;
}

/* 表单项目样式 */
.login-form-group {
    margin-bottom: 1.2rem;
    width: 100%;
}

/* 输入框样式 */
.login-form-control {
    width: 100%;
    padding: 14px 18px; /* 增加内边距，使控件更高 */
    border: 1px solid #ddd;
    border-radius: 6px; /* 稍微增加圆角 */
    font-size: 15px; /* 增加字体大小 */
    transition: all 0.3s;
    box-sizing: border-box;
}

.login-form-control:focus {
    border-color: #4e89ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(78, 137, 255, 0.1);
}

/* 验证码区域样式 */
.verify-code-container {
    display: flex;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.verify-code-input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    outline: none;
    box-shadow: none;
}

.verify-code-btn,
.form-container .verify-code-btn {
    border: none !important;
    border-radius: 0 !important;
    padding: 0 18px !important; /* 增加内边距 */
    background: #4e89ff !important;
    color: white !important;
    font-size: 15px !important; /* 增加字体大小 */
    cursor: pointer !important;
    white-space: nowrap !important;
    min-width: 120px !important; /* 增加最小宽度 */
    height: auto !important;
}

.verify-code-btn:hover {
    background: #3b7aff;
}

.verify-code-btn:disabled {
    background: #b9cdf8;
    cursor: not-allowed;
}

/* 记住我选项 */
.login-form-remember {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
    cursor: pointer;
}

.login-form-remember input {
    margin-right: 8px;
}

/* 协议同意选项 */
.login-form-agreement {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
    font-size: 14px;
    color: #666;
}

.login-form-agreement input {
    margin-right: 8px;
}

.login-form-agreement a {
    color: #4e89ff;
    text-decoration: none;
}

/* From Uiverse.io by Galahhad */ 

.ui-checkbox {
  --primary-color: #1677ff;
  --secondary-color: #fff;
  --primary-hover-color: #4096ff;
  /* checkbox */
  --checkbox-diameter: 20px;
  --checkbox-border-radius: 5px;
  --checkbox-border-color: #d9d9d9;
  --checkbox-border-width: 1px;
  --checkbox-border-style: solid;
  /* checkmark */
  --checkmark-size: 1.2;
  margin-right: 8px;
  margin-top: 0;
  vertical-align: middle;
}

.ui-checkbox, 
.ui-checkbox *, 
.ui-checkbox *::before, 
.ui-checkbox *::after {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.ui-checkbox {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: var(--checkbox-diameter);
  height: var(--checkbox-diameter);
  border-radius: var(--checkbox-border-radius);
  background: var(--secondary-color);
  border: var(--checkbox-border-width) var(--checkbox-border-style) var(--checkbox-border-color);
  -webkit-transition: all 0.3s;
  -o-transition: all 0.3s;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}

.ui-checkbox::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  -webkit-box-shadow: 0 0 0 calc(var(--checkbox-diameter) / 2.5) var(--primary-color);
  box-shadow: 0 0 0 calc(var(--checkbox-diameter) / 2.5) var(--primary-color);
  border-radius: inherit;
  opacity: 0;
  -webkit-transition: all 0.5s cubic-bezier(0.12, 0.4, 0.29, 1.46);
  -o-transition: all 0.5s cubic-bezier(0.12, 0.4, 0.29, 1.46);
  transition: all 0.5s cubic-bezier(0.12, 0.4, 0.29, 1.46);
}

.ui-checkbox::before {
  top: 40%;
  left: 50%;
  content: "";
  position: absolute;
  width: 4px;
  height: 7px;
  border-right: 2px solid var(--secondary-color);
  border-bottom: 2px solid var(--secondary-color);
  -webkit-transform: translate(-50%, -50%) rotate(45deg) scale(0);
  -ms-transform: translate(-50%, -50%) rotate(45deg) scale(0);
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  opacity: 0;
  -webkit-transition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6),opacity 0.1s;
  -o-transition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6),opacity 0.1s;
  transition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6),opacity 0.1s;
}

/* actions */

.ui-checkbox:hover {
  border-color: var(--primary-color);
}

.ui-checkbox:checked {
  background: var(--primary-color);
  border-color: transparent;
}

.ui-checkbox:checked::before {
  opacity: 1;
  -webkit-transform: translate(-50%, -50%) rotate(45deg) scale(var(--checkmark-size));
  -ms-transform: translate(-50%, -50%) rotate(45deg) scale(var(--checkmark-size));
  transform: translate(-50%, -50%) rotate(45deg) scale(var(--checkmark-size));
  -webkit-transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;
  -o-transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;
  transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;
}

.ui-checkbox:active:not(:checked)::after {
  -webkit-transition: none;
  -o-transition: none;
  -webkit-box-shadow: none;
  box-shadow: none;
  transition: none;
  opacity: 1;
}

/* Apply ui-checkbox styles to the specific checkboxes */
#rememberMe,
#agreement {
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* 确保复选框在所有状态下都有正确的ui-checkbox样式 */
.form-container #rememberMe.ui-checkbox,
.form-container #agreement.ui-checkbox {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  width: var(--checkbox-diameter) !important;
  height: var(--checkbox-diameter) !important;
  border-radius: var(--checkbox-border-radius) !important;
  background: var(--secondary-color) !important;
  border: var(--checkbox-border-width) var(--checkbox-border-style) var(--checkbox-border-color) !important;
  transition: all 0.3s !important;
  cursor: pointer !important;
  position: relative !important;
  margin-right: 8px !important;
  vertical-align: middle !important;
  top: -1px !important;
}

.form-container #rememberMe.ui-checkbox:hover,
.form-container #agreement.ui-checkbox:hover {
  border-color: var(--primary-color) !important;
}

.form-container #rememberMe.ui-checkbox:checked,
.form-container #agreement.ui-checkbox:checked {
  background: var(--primary-color) !important;
  border-color: transparent !important;
}

/* 按钮样式 */
.login-submit-btn {
    width: 100%;
    padding: 12px 15px;
    background: #4e89ff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: background 0.3s;
}

.login-submit-btn:hover {
    background: #3b7aff;
}

/* 底部注册/登录切换 */
.login-form-register {
    text-align: center;
    width: 100%;
    font-size: 14px;
    color: #666;
    margin-top: 1rem;
}

.login-form-register a {
    color: #4e89ff;
    text-decoration: none;
    font-weight: 500;
}

/* 表单容器显示控制 */
.form-container.login-container {
    display: flex !important;
    flex-direction: column;
    width: 100%;
}

.form-container.register-container {
    display: none !important;
    flex-direction: column;
    width: 100%;
}

/* 当注册容器激活时 */
.form-container.register-container.active {
    display: flex !important;
}

/* 当登录容器隐藏时 */
.form-container.login-container.hidden {
    display: none !important;
}

/* 确保表单元素在所有状态下都有正确的样式 */
.form-container .login-form-control,
.form-container .verify-code-input {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    transition: all 0.3s !important;
    box-sizing: border-box !important;
    background: #fff !important;
}

.form-container .login-form-control:focus,
.form-container .verify-code-input:focus {
    border-color: #4e89ff !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(78, 137, 255, 0.1) !important;
}

/* 确保按钮样式在所有状态下正确显示 */
.form-container .login-submit-btn {
    width: 100% !important;
    padding: 12px !important;
    background: #4e89ff !important;
    color: white !important;
    border: none !important;
    border-radius: 5px !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    margin-top: 10px !important;
}

.form-container .login-submit-btn:hover {
    background: #3b7aff !important;
}

/* 确保验证码容器和按钮样式 */
.form-container .verify-code-container {
    display: flex !important;
    width: 100% !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    overflow: hidden !important;
}

.form-container .verify-code-btn {
    border: none !important;
    border-radius: 0 !important;
    padding: 0 15px !important;
    background: #4e89ff !important;
    color: white !important;
    font-size: 14px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    min-width: 110px !important;
}

.form-container .verify-code-btn:hover {
    background: #3b7aff !important;
}

.form-container .verify-code-btn:disabled {
    background: #b9cdf8 !important;
    cursor: not-allowed !important;
}

/* 表单组样式 */
.form-container .login-form-group {
    margin-bottom: 1.2rem !important;
}

/* 响应式调整 */
@media (max-width: 992px) { /* 提高断点，确保平板也有良好体验 */
    .login-modal {
        align-items: center; /* 确保在小屏幕上也是居中对齐 */
        padding: 15px 0; /* 确保有足够的滚动空间 */
    }
    
    .login-modal .modal-content {
        flex-direction: column;
        width: 95%;
        max-width: 400px;
        max-height: 90vh; /* 增加最大高度，确保内容可见 */
        overflow: hidden; /* 整体容器不滚动 */
    }
    
    .login-modal-left, 
    .login-modal-right {
        width: 100%;
    }
    
    .login-modal-left {
        min-height: 120px; /* 减小左侧背景高度 */
        max-height: 120px; /* 限制左侧背景高度 */
        background-position: center top;
        background-size: cover;
        margin: 0;
        padding: 0;
        position: relative; /* 确保定位上下文正确 */
        overflow-y: visible; /* 在移动端不需要滚动 */
    }
    
    .login-modal-right {
        padding: 1rem;
        max-height: none; /* 移除最大高度限制 */
        overflow-y: auto; /* 确保右侧可滚动 */
        justify-content: center; /* 确保内容垂直居中 */
        align-items: center; /* 确保内容水平居中 */
    }
    
    .login-modal-left-text {
        display: none !important; /* 移动端不显示文字框 */
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .login-modal-left-text h2 {
        display: none !important;
    }
    
    .login-modal-left-text p {
        display: none !important;
    }
    
    /* 移动端验证码按钮样式 */
    .verify-code-btn {
        min-width: 80px;
        font-size: 12px;
        padding: 0 8px;
    }

    /* 确保在小屏幕设备上表单元素有合适的间距 */
    .login-form-group {
        margin-bottom: 0.8rem;
    }

    /* 确保表单标题在小屏幕上大小合适 */
    .login-form-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
}

/* 在更小的屏幕上进一步优化 */
@media (max-width: 480px) {
    .login-modal {
        padding: 10px 0; /* 确保有足够的滚动空间 */
    }
    
    .login-modal .modal-content {
        width: 95%;
        max-width: 320px;
        max-height: 90vh;
    }

    .login-modal-left {
        min-height: 100px;
        max-height: 100px;
    }

    .login-modal-right {
        max-height: none; /* 移除最大高度限制 */
        padding: 0.8rem;
        overflow-y: auto; /* 确保可滚动 */
        justify-content: center; /* 确保内容垂直居中 */
        align-items: center; /* 确保内容水平居中 */
    }

    .login-form-title {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }

    .login-form-group {
        margin-bottom: 0.6rem;
    }

    /* 确保输入框在小屏幕上不会太高 */
    .login-form-control {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* 验证码按钮在小屏幕上调整 */
    .verify-code-btn {
        min-width: 70px;
        font-size: 11px;
        padding: 0 5px;
    }

    .login-modal-left-text {
        display: none !important; /* 移动端不显示文字框 */
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .login-modal-left-text h2 {
        display: none !important;
    }
    
    .login-modal-left-text p {
        display: none !important;
    }
}

/* 标题样式 */
.form-container .login-form-title {
    text-align: center !important;
    font-size: 1.8rem !important;
    margin-bottom: 1.5rem !important;
    font-weight: 500 !important;
    color: #333 !important;
    width: 100% !important;
} 