/* ============================================
   后台登录模板 - 左右分屏布局样式
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 主容器 */
.login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ============================================
   左侧品牌展示区
   ============================================ */
.login-brand {
    position: relative;
    width: 45%;
    min-height: 100vh;
    background: linear-gradient(315deg, var(--bg-start, #abdcff) 0%, var(--bg-end, #20a2ff) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brand-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%);
}

.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
    color: #fff;
    max-width: 420px;
}

/* Logo */
.brand-logo {
    margin-bottom: 32px;
}

.logo-icon {
    display: inline-block;
    width: 72px;
    height: 72px;
    animation: logoFloat 6s ease-in-out infinite;
}

.logo-img {
    display: inline-block;
    max-width: 120px;
    max-height: 120px;
    border-radius: 16px;
    animation: logoFloat 6s ease-in-out infinite;
    object-fit: contain;
}

.logo-text-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

/* 标题 */
.brand-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.brand-subtitle {
    font-size: 16px;
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 48px;
}

/* 特性列表 */
.brand-features {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: rgba(255,255,255,0.12);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(6px);
}

.feature-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feature-text strong {
    font-size: 15px;
    font-weight: 600;
}

.feature-text span {
    font-size: 13px;
    opacity: 0.75;
}

/* 装饰圆圈 */
.brand-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.deco-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
}

.deco-circle-1 {
    width: 300px;
    height: 300px;
    top: -80px;
    left: -80px;
    animation: decoRotate 20s linear infinite;
}

.deco-circle-2 {
    width: 200px;
    height: 200px;
    bottom: -60px;
    right: -40px;
    border-width: 2px;
    border-color: rgba(255,255,255,0.08);
    animation: decoRotate 15s linear infinite reverse;
}

.deco-circle-3 {
    width: 150px;
    height: 150px;
    top: 30%;
    right: -30px;
    border-color: rgba(255,255,255,0.06);
    animation: decoPulse 8s ease-in-out infinite;
}

@keyframes decoRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes decoPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* ============================================
   右侧登录表单区
   ============================================ */
.login-form-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #f7f8fc;
    position: relative;
}

.login-form-inner {
    width: 100%;
    max-width: 420px;
}

/* 表单头部 */
.form-header {
    margin-bottom: 36px;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.form-desc {
    font-size: 15px;
    color: #8c8c9e;
}

/* 表单组 */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #4a4a5a;
    margin-bottom: 8px;
}

.label-icon {
    width: 16px;
    height: 16px;
    color: #8c8c9e;
}

/* 输入框 */
.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    color: #333;
    background: #fff;
    border: 2px solid #e8e8ef;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: #b8b8c8;
}

.form-input:focus {
    border-color: var(--bg-start, #abdcff);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

.form-input:hover:not(:focus) {
    border-color: #d0d0de;
}

/* 密码切换按钮 */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8b8c8;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #666;
}

.eye-icon {
    width: 20px;
    height: 20px;
}

/* 验证码 */
.verify-wrapper {
    display: flex;
    gap: 12px;
}

.verify-input {
    flex: 1;
}

.verify-img {
    height: 48px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid #e8e8ef;
    transition: border-color 0.2s;
}

.verify-img:hover {
    border-color: #d0d0de;
}

/* 选项行 */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

/* 自定义复选框 */
.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #d0d0de;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remember-me input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--bg-start, #abdcff);
    border-color: var(--bg-start, #abdcff);
}

.remember-me input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

.remember-text {
    font-size: 14px;
    color: #6a6a7a;
}

/* 登录按钮 */
.btn-login {
    width: 100%;
    height: 50px;
    background: linear-gradient(315deg, var(--bg-start, #abdcff) 0%, var(--bg-end, #20a2ff) 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 4px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 消息提示 */
.form-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.form-message.error {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.form-message.success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 扩展区域（第三方登录等） */
.login-extra {
    margin-top: 24px;
    text-align: center;
}

.login-extra:empty {
    display: none;
}

/* 底部版权 */
.login-footer {
    margin-top: 40px;
    text-align: center;
    font-size: 13px;
    color: #b8b8c8;
}

.login-footer a {
    color: #999;
    text-decoration: none;
}

.login-footer a:hover {
    color: #abdcff;
}

.login-footer p {
    font-size: 13px;
    color: #b8b8c8;
}

/* 兼容Layui等插件注入的表单项样式 */
.login-form .layui-form-item {
    margin-bottom: 20px;
}

.login-form .layui-input {
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    border: 2px solid #e8e8ef;
    border-radius: 10px;
}

.login-form .layui-input:focus {
    border-color: var(--bg-start, #abdcff) !important;
}

/* ============================================
   响应式布局
   ============================================ */
@media screen and (max-width: 1024px) {
    .login-brand {
        width: 40%;
    }

    .brand-features {
        display: none;
    }

    .brand-subtitle {
        margin-bottom: 0;
    }
}

@media screen and (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .login-brand {
        width: 100%;
        min-height: auto;
        padding: 60px 20px 40px;
    }

    .brand-content {
        padding: 20px;
    }

    .brand-title {
        font-size: 24px;
    }

    .brand-subtitle {
        font-size: 14px;
        margin-bottom: 0;
    }

    .brand-features {
        display: none;
    }

    .brand-logo {
        margin-bottom: 20px;
    }

    .logo-icon {
        width: 56px;
        height: 56px;
    }

    .login-form-wrapper {
        padding: 30px 20px;
    }

    .form-title {
        font-size: 24px;
    }
}

@media screen and (max-width: 480px) {
    .login-form-wrapper {
        padding: 24px 16px;
    }

    .form-input {
        height: 44px;
        font-size: 14px;
    }

    .btn-login {
        height: 46px;
        font-size: 15px;
    }
}

/* ============================================
   入场动画
   ============================================ */
.login-brand {
    animation: slideInLeft 0.6s ease-out;
}

.login-form-wrapper {
    animation: slideInRight 0.6s ease-out;
}

.form-group {
    animation: fadeInUp 0.5s ease-out both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }

.form-options { animation: fadeInUp 0.5s ease-out 0.35s both; }
.btn-login { animation: fadeInUp 0.5s ease-out 0.45s both; }

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
