/* ============================================================
   有点追求商城 - 商家后台登录页样式 (v2 质感优化)
   作用域: body.merchant-login-body
   配色: 主标题#132F55 / 正文#344866 / 辅助#8091AA / 占位#A7B3C4
         品牌#3478F6 / 成功#2DBE74
   ============================================================ */
.merchant-login-body {
    --c-title: #132F55;
    --c-text: #344866;
    --c-aux: #8091AA;
    --c-placeholder: #A7B3C4;
    --c-brand: #3478F6;
    --c-brand-dark: #2f6fe8;
    --c-success: #2DBE74;
    --c-border: rgba(31, 64, 104, 0.06);
    --c-shadow: 0 12px 40px rgba(31, 64, 104, 0.08);
    margin: 0;
    padding: 0;
    background: #fff;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
}

/* 隐藏默认 frontend 布局的 navbar/footer */
.merchant-login-body .navbar,
.merchant-login-body .footer,
.merchant-login-body .content { display: none !important; }

/* ===== 整体容器 ===== */
.ml-wrap {
    display: flex;
    width: 100vw;
    height: 100vh;
    min-height: 650px;
    overflow: hidden;
}

/* ============================================================
   左侧品牌宣传区 (44%)
   ============================================================ */
.ml-brand {
    position: relative;
    flex: 0 0 44%;
    height: 100vh;
    min-height: 650px;
    overflow: hidden;
    background: #e9ebee;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ml-brand-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    user-select: none;
    -webkit-user-drag: none;
}

.ml-brand-bg { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.ml-deco { position: absolute; border-radius: 50%; }
.ml-deco-1 {
    width: 280px; height: 280px; left: -80px; top: -60px;
    background: radial-gradient(circle at 30% 30%, rgba(52, 120, 246, 0.14), rgba(52, 120, 246, 0) 70%);
    animation: mlDrift 14s ease-in-out infinite;
}
.ml-deco-2 {
    width: 220px; height: 220px; right: -50px; bottom: -40px;
    background: radial-gradient(circle at 50% 50%, rgba(52, 199, 214, 0.16), rgba(52, 199, 214, 0) 70%);
    animation: mlDrift 17s ease-in-out infinite reverse;
}

.ml-brand-inner {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 52px 80px 44px;
    box-sizing: border-box;
}

.ml-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ml-logo-icon { filter: drop-shadow(0 4px 10px rgba(52, 120, 246, 0.22)); }
.ml-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--c-title);
    letter-spacing: .5px;
}

.ml-brand-mid {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.ml-hero {
    text-align: center;
    margin-bottom: 24px;
}
.ml-version-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-brand);
    background: rgba(52, 120, 246, 0.12);
    border-radius: 20px;
    margin-bottom: 20px;
}
.ml-hero-title {
    margin: 0;
    font-size: 36px;
    font-weight: 800;
    color: var(--c-title);
    letter-spacing: 1.5px;
    line-height: 1.25;
}
.ml-hero-sub {
    margin: 14px 0 0;
    font-size: 16px;
    color: var(--c-text);
    letter-spacing: .5px;
}

.ml-illustration {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
    animation: mlFloatY 3.6s ease-in-out infinite;
}
.ml-illustration svg {
    width: 100%;
    max-width: 440px;
    height: auto;
    filter: drop-shadow(0 20px 34px rgba(31, 75, 150, 0.18));
}

.ml-brand-foot {
    font-size: 13px;
    color: var(--c-aux);
    letter-spacing: .3px;
}

/* ============================================================
   右侧登录功能区 (56%)
   ============================================================ */
.ml-main {
    position: relative;
    flex: 0 0 56%;
    height: 100vh;
    min-height: 650px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mlFadeLeft .55s ease both;
}

/* 顶部导航 */
.ml-topnav {
    position: absolute;
    top: 32px;
    right: 48px;
    display: flex;
    gap: 28px;
    z-index: 5;
}
.ml-topnav a {
    font-size: 14px;
    color: var(--c-aux);
    text-decoration: none;
    transition: color .2s;
}
.ml-topnav a:hover { color: var(--c-brand); }

/* ===== 登录卡片 ===== */
.ml-card {
    position: relative;
    width: 100%;
    max-width: calc(100vw - 40px);
    min-height: 100%;
    padding: 44px 48px;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--c-shadow);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.ml-card-head { position: relative; margin-bottom: 22px; }
.ml-welcome {
    margin: 0;
    font-size: 31px;
    font-weight: 600;
    color: var(--c-title);
    letter-spacing: 1px;
    line-height: 1.2;
}
.ml-welcome-sub {
    margin: 12px 0 0;
    font-size: 15px;
    color: var(--c-aux);
}

/* 右上角切换图标 + Tooltip */
.ml-qr-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: #f7f9fc;
    color: var(--c-aux);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .25s;
}
.ml-qr-toggle:hover { color: var(--c-brand); border-color: #bcd8ff; background: #eef4ff; transform: rotate(-4deg); }
.ml-qr-toggle .ml-ic-pc { display: none; }
.merchant-login-body.is-qr-mode .ml-qr-toggle .ml-ic-qr { display: none; }
.merchant-login-body.is-qr-mode .ml-qr-toggle .ml-ic-pc { display: block; }
.ml-qr-toggle::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 4px;
    background: var(--c-title);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity .2s, transform .2s;
    z-index: 20;
}
.ml-qr-toggle:hover::after { opacity: 1; transform: translateY(0); }

/* ===== 三 Tab 切换 ===== */
.ml-tabs {
    position: relative;
    display: flex;
    gap: 36px;
    margin-bottom: 26px;
    border-bottom: 1px solid #eef2f7;
}
.ml-tab {
    position: relative;
    height: 44px;
    line-height: 44px;
    font-size: 16px;
    color: var(--c-aux);
    text-decoration: none;
    cursor: pointer;
    transition: color .2s;
    padding: 0;
}
.ml-tab.active { color: var(--c-brand); font-weight: 600; }
.ml-tab:hover { color: var(--c-brand); }
.ml-tab-line {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--c-brand);
    border-radius: 2px;
    transition: left .22s ease, width .22s ease;
}

/* ===== 面板区(固定高度防跳) ===== */
.ml-panels {
    flex: 1;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ml-panel { display: none; width: 100%; }
.ml-panel.active {
    display: block;
    animation: mlFade .2s ease both;
}

/* ===== 输入框 ===== */
.ml-field { margin-bottom: 16px; }
.ml-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    border-radius: 8px;
    background: #f7f9fc;
    border: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.ml-input-wrap:hover { border-color: #bcd8ff; }
.ml-input-wrap.ml-focus {
    background: #fff;
    border-color: var(--c-brand);
    box-shadow: 0 0 0 4px rgba(52, 120, 246, 0.12);
}
.ml-input-wrap.ml-error {
    border-color: #f56c6c !important;
    background: #fef0f0;
    box-shadow: 0 0 0 4px rgba(245, 108, 108, 0.1);
}
.ml-input-ic {
    margin: 0 12px;
    color: var(--c-placeholder);
    flex-shrink: 0;
    transition: color .2s;
}
.ml-input-wrap.ml-focus .ml-input-ic { color: var(--c-brand); }
.ml-input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--c-text);
    padding-right: 14px;
}
.ml-input::placeholder { color: var(--c-placeholder); }

/* 密码显隐 */
.ml-pwd-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0 14px;
    color: var(--c-placeholder);
    display: flex;
    align-items: center;
    height: 100%;
    transition: color .2s;
}
.ml-pwd-toggle:hover { color: var(--c-brand); }
.ml-pwd-toggle .ml-eye-off { display: none; }
.ml-pwd-toggle.is-visible .ml-eye { display: none; }
.ml-pwd-toggle.is-visible .ml-eye-off { display: block; }

/* 验证码 */
.ml-input-wrap-code .ml-input { padding-right: 8px; }
.ml-code-btn {
    flex-shrink: 0;
    margin-right: 8px;
    padding: 0 14px;
    height: 34px;
    border: 1px solid var(--c-brand);
    background: #fff;
    color: var(--c-brand);
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.ml-code-btn:hover:not(:disabled) { background: var(--c-brand); color: #fff; }
.ml-code-btn:disabled { cursor: not-allowed; border-color: #d6dbe6; color: var(--c-placeholder); background: #f7f9fc; }
.ml-code-btn.ml-sending { color: var(--c-placeholder); border-color: #d6dbe6; }

/* 错误提示 */
.ml-err {
    min-height: 0;
    margin-top: 6px;
    font-size: 13px;
    color: #f56c6c;
    line-height: 18px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s, transform .2s;
}
.ml-err.ml-show { opacity: 1; transform: none; min-height: 18px; }

/* ===== 辅助操作 ===== */
.ml-aux {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 20px;
}
.ml-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--c-aux);
    cursor: pointer;
    user-select: none;
}
.ml-remember input { accent-color: var(--c-brand); cursor: pointer; }
.ml-aux-links { display: flex; align-items: center; gap: 8px; }
.ml-link {
    font-size: 14px;
    color: var(--c-aux);
    text-decoration: none;
    transition: color .2s;
}
.ml-link:hover { color: var(--c-brand); }
.ml-vline { color: #dfe5ef; font-style: normal; }

/* ===== 登录按钮 ===== */
.ml-submit {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 24px;
    background: linear-gradient(90deg, #4a86f7, var(--c-brand));
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    transition: transform .15s, box-shadow .2s, opacity .2s;
    box-shadow: 0 6px 16px rgba(52, 120, 246, 0.26);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ml-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(52, 120, 246, 0.34); }
.ml-submit:active { transform: translateY(0); }
.ml-submit:disabled { cursor: not-allowed; opacity: .85; transform: none; }
.ml-submit.ml-loading .ml-submit-txt { opacity: 0; }
.ml-submit.ml-loading .ml-submit-spin { display: inline-block; }
.ml-submit-spin {
    display: none;
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mlSpin .7s linear infinite;
}

/* ===== 扫码登录 ===== */
.ml-panel-qr { text-align: center; }
.ml-qr-head { margin-bottom: 18px; }
.ml-qr-title { font-size: 16px; font-weight: 600; color: var(--c-title); }
.ml-qr-desc { margin-top: 6px; font-size: 13px; color: var(--c-aux); }
.ml-qr-box { display: flex; flex-direction: column; align-items: center; }
.ml-qr-img-wrap {
    position: relative;
    width: 216px;
    height: 216px;
    padding: 8px;
    background: #fff;
    border: 1px solid rgba(31, 64, 104, 0.08);
    border-radius: 12px;
    box-sizing: border-box;
}
.ml-qr-img { width: 100%; height: 100%; display: block; }
.ml-qr-mask {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: mlFade .25s ease both;
}
.ml-qr-mask-icon { color: #f0a020; }
.ml-qr-mask-icon.ml-fail { color: #f56c6c; }
.ml-qr-mask-icon.ml-ok { color: var(--c-success); }
.ml-qr-mask-txt { font-size: 15px; color: var(--c-title); font-weight: 500; }
.ml-qr-refresh {
    margin-top: 4px;
    padding: 6px 18px;
    border: 1px solid var(--c-brand);
    background: #fff;
    color: var(--c-brand);
    font-size: 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: all .2s;
}
.ml-qr-refresh:hover { background: var(--c-brand); color: #fff; }
.ml-qr-status { margin-top: 16px; font-size: 15px; color: var(--c-text); font-weight: 500; }
.ml-qr-sub { margin-top: 4px; font-size: 13px; color: var(--c-placeholder); }
.ml-qr-status.ml-ok { color: var(--c-success); }
.ml-qr-status.ml-warn { color: #f0a020; }
.ml-qr-status.ml-fail { color: #f56c6c; }

/* ===== 底部入口(降权) ===== */
.ml-foot-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #f2f5f9;
    font-size: 14px;
    color: var(--c-aux);
}
.ml-foot-item { white-space: nowrap; }
.ml-foot-item .ml-link { font-size: 14px; }

/* ============================================================
   动画
   ============================================================ */
@keyframes mlFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}
@keyframes mlFadeLeft {
    from { opacity: 0; transform: translateX(28px); }
    to { opacity: 1; transform: none; }
}
@keyframes mlFade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes mlFloatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes mlDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(16px, -12px) scale(1.05); }
}
@keyframes mlSpin { to { transform: rotate(360deg); } }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1200px) {
    .ml-brand { flex: 0 0 40%; }
    .ml-main { flex: 0 0 60%; }
    .ml-brand-inner { padding: 44px 48px 36px; }
    .ml-illustration svg { max-width: 340px; }
    .ml-hero-title { font-size: 30px; }
}

@media (max-width: 768px) {
    .ml-wrap { flex-direction: column; min-height: 100vh; height: auto; }
    .ml-brand { display: none; }
    .ml-main {
        flex: 1;
        width: 100%;
        height: 100vh;
        min-height: 100vh;
        padding: 0 20px;
        box-sizing: border-box;
    }
    .ml-card {
        width: 100%;
        max-width: 100%;
        min-height: 0;
        padding: 28px 22px;
        box-shadow: none;
        border: none;
    }
    .ml-topnav { top: 18px; right: 22px; gap: 18px; }
    .ml-panels { min-height: 300px; }
}
