/**
 * login-page.css - 登录页左右分栏布局
 * 
 * PC端：左侧品牌展示区 + 右侧登录表单
 * 移动端：品牌区缩为顶部横幅 + 表单在下方
 * 
 * @author     之马工场
 * @createtime 2026-02-26
 */

/* ========== 页面容器 ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(29, 78, 216, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(2, 132, 199, 0.04) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-2%, -2%) rotate(3deg); }
}

/* ========== 分栏容器 ========== */
.login-split {
    position: relative;
    z-index: 10;
    display: flex;
    width: 960px;
    max-width: calc(100vw - 40px);
    min-height: 600px;
    max-height: 90vh;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* ========== 左侧品牌区 ========== */
.login-brand {
    flex: 0 0 420px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 40px 32px;
    background: linear-gradient(160deg, #0c1929 0%, #152a4a 38%, #1e40af 72%, #0369a1 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
}

.login-brand::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
}

.login-brand-inner {
    position: relative;
    z-index: 1;
}

/* Logo */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    margin-bottom: 40px;
    transition: color 0.2s ease, filter 0.2s ease;
}

/* 覆盖 basic.css 全局 a:hover（深色主色在品牌区几乎不可见） */
.login-brand .brand-logo:hover,
.login-brand .brand-logo:focus-visible {
    color: #f0f9ff;
    outline: none;
}

.login-brand .brand-logo:hover .brand-logo-icon,
.login-brand .brand-logo:focus-visible .brand-logo-icon {
    background: rgba(255, 255, 255, 0.26);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.login-brand .brand-logo:focus-visible {
    box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.65);
    border-radius: var(--radius-md);
}

.brand-logo-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.brand-logo-name {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 标题 */
.brand-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
    color: #fff;
}

.brand-title .highlight {
    color: #7dd3fc;
}

.brand-desc {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 40px;
    line-height: 1.6;
}

/* 特性列表 */
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.brand-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
}

.brand-feature-item svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.6);
}

/* 品牌区底部 */
.brand-footer {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.brand-footer a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.brand-footer a:hover {
    color: rgba(255, 255, 255, 0.8);
}

.brand-footer span {
    margin: 0 6px;
}

/* ========== 右侧表单区 ========== */
.login-form-side {
    flex: 1;
    min-height: 0; /* flex 子项可滚动 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 32px 0;
}

/* 内容较少时垂直居中；超出时 auto 边距归零，从顶部完整展示并可滚动 */
.login-form-side-inner {
    width: 100%;
    max-width: 380px;
    padding: 0 40px;
    margin-top: auto;
    margin-bottom: auto;
    flex-shrink: 0;
}

.login-form-header {
    margin-bottom: 24px;
}

.login-form-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.login-form-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* 覆盖 login.css 中 login-modal 的限制 */
.login-page .login-modal-footer {
    margin-top: 12px;
    padding-top: 12px;
}

/* ========== 响应式：平板 ========== */
@media (max-width: 960px) {
    .login-split {
        width: 100%;
        max-width: 520px;
        min-height: auto;
        max-height: none;
        flex-direction: column;
        border-radius: var(--radius-lg);
    }

    .login-brand {
        flex: none;
        padding: 32px 32px 24px;
    }

    .brand-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .brand-desc {
        margin-bottom: 0;
        font-size: 0.875rem;
    }

    .brand-features {
        display: none;
    }

    .brand-footer {
        display: none;
    }

    .brand-logo {
        margin-bottom: 20px;
    }

    .login-form-side {
        padding: 24px 0;
    }

    .login-form-side-inner {
        padding: 0 32px;
        max-width: 100%;
    }
}

/* ========== 响应式：手机 ========== */
@media (max-width: 580px) {
    .login-page {
        align-items: flex-start;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        min-height: 100vh;
        height: auto;
    }

    .login-split {
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
        overflow: visible;
    }

    .login-brand {
        padding: 24px 24px 20px;
        border-radius: 0;
    }

    .brand-logo-icon {
        width: 40px;
        height: 40px;
    }

    .brand-logo-icon svg {
        width: 22px !important;
        height: 22px !important;
    }

    .brand-logo-name {
        font-size: 1.125rem;
    }

    .brand-title {
        font-size: 1.25rem;
    }

    .login-form-side {
        padding: 20px 0 28px;
        overflow-y: visible;
    }

    .login-form-side-inner {
        padding: 0 24px;
    }

    .login-form-header {
        padding-top: env(safe-area-inset-top, 0);
    }

    .login-form-header h2 {
        font-size: 1.25rem;
    }

    .brand-quote {
        display: none;
    }
}

/* 登录页科研名言 */
.brand-quote {
    margin-top: 28px;
    padding: 16px 20px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    border-left: 3px solid rgba(125, 211, 252, 0.55);
}

.brand-quote-text {
    font-size: 0.95rem;
    font-style: italic;
    line-height: 1.6;
    color: rgba(255,255,255,0.85);
    margin: 0 0 6px;
}

.brand-quote-author {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin: 0;
    text-align: right;
}

/* 注册：短信验证码行 */
.login-form-side .reg-sms-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.login-form-side .reg-sms-input {
    flex: 1;
    min-width: 0;
}

.login-form-side .reg-sms-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 0.8125rem;
    min-width: 108px;
}

/* 登录方式切换：容器顶部靠右 */
.login-form-container {
    position: relative;
}

.login-auth-top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0 0 6px;
    padding: 0 0 4px;
}

.login-auth-top-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

/* 短信登录界面说明（切换为短信后显示在表单上方） */
.login-auth-sms-hint {
    margin: 0 0 14px;
    padding: 0 2px;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.6;
    color: #64748b;
    text-align: left;
    letter-spacing: 0.02em;
}

.login-auth-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* 顶部入口：更大字号、品牌色、易点按 */
.login-auth-switch--top {
    padding: 5px 14px;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: color 0.22s ease, background 0.22s ease, transform 0.2s ease;
}

.login-auth-switch--sms {
    color: #1d4ed8;
}

.login-auth-switch--sms:hover {
    color: #1e3a8a;
    background: rgba(29, 78, 216, 0.09);
}

.login-auth-switch--pwd {
    color: #0f172a;
}

.login-auth-switch--pwd:hover {
    color: #1e293b;
    background: rgba(15, 23, 42, 0.06);
}

.login-auth-switch-symbol {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: currentColor;
    opacity: 0.92;
    transition: transform 0.22s ease, opacity 0.2s ease;
}

.login-auth-switch--top:hover .login-auth-switch-symbol {
    opacity: 1;
    transform: scale(1.06);
}

.login-auth-switch--top span {
    position: relative;
    padding-bottom: 2px;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 1.5px;
    transition: background-size 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-auth-switch--top:hover span {
    background-size: 100% 1.5px;
}

.login-submit-premium {
    margin-top: 4px;
    letter-spacing: 0.14em;
    font-weight: 600;
    box-shadow: 0 8px 24px -8px rgba(29, 78, 216, 0.42);
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.login-submit-premium:hover:not(:disabled) {
    box-shadow: 0 12px 28px -10px rgba(29, 78, 216, 0.5);
    transform: translateY(-1px);
}

.login-submit-premium:active:not(:disabled) {
    transform: translateY(0);
}

.login-form-side .form-hint-inline {
    margin: 8px 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}
