/*!
 * YtLogin 弹窗登录 - 样式（左右分栏，支持换肤）
 * --------------------------------------------------
 * 换肤：在弹窗根节点 .ytl 上设置 data-ytlogin-skin 属性即可切换，
 *  依次内置：scenic（风景大图）、illustration（插画风）、minimal（极简白）。
 *  也可自行在下方追加新的皮肤主题。
 * --------------------------------------------------
 */

/* ========== 变量 ========== */
:root {
    --ytl-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
        "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 默认皮肤：scenic（风景大图 + 青绿按钮） */
.ytl {
    --ytl-primary: #20B2AA;
    --ytl-primary-hover: #1a9e97;
    --ytl-success: #34C759;
    --ytl-warning: #FF9500;
    --ytl-danger: #FF3B30;
    --ytl-bg: #FFFFFF;
    --ytl-border: #E5E5EA;
    --ytl-text: #1D1D1F;
    --ytl-text-2nd: #6E6E73;
    --ytl-field-bg: #F5F5F7;
    --ytl-field-border: #E5E5EA;
    --ytl-field-focus: rgba(32, 178, 170, 0.12);
    --ytl-btn-text: #FFFFFF;
    --ytl-btn-shadow: 0 4px 14px rgba(32, 178, 170, 0.35);
    --ytl-radius: 16px;
    --ytl-radius-sm: 10px;
    --ytl-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    --ytl-overlay: rgba(0, 0, 0, 0.65);
    --ytl-left-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --ytl-social-qq: #12B7F5;
    --ytl-social-wx: #07C160;
}

/* 插画风 */
.ytl[data-ytlogin-skin="illustration"] {
    --ytl-primary: #5B9BFF;
    --ytl-primary-hover: #4a8aee;
    --ytl-btn-shadow: 0 4px 14px rgba(91, 155, 255, 0.35);
    --ytl-field-focus: rgba(91, 155, 255, 0.12);
    --ytl-left-bg: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
    --ytl-social-qq: #12B7F5;
    --ytl-social-wx: #07C160;
}

/* 极简白 */
.ytl[data-ytlogin-skin="minimal"] {
    --ytl-primary: #1D1D1F;
    --ytl-primary-hover: #3a3a3c;
    --ytl-btn-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    --ytl-field-focus: rgba(0, 0, 0, 0.08);
    --ytl-left-bg: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --ytl-social-qq: #12B7F5;
    --ytl-social-wx: #07C160;
}

/* ========== 显隐控制 ========== */
.ytl [hidden] { display: none !important; }
.ytl .hide { display: none !important; }
.ytl-captcha:not(.on) { display: none !important; }

/* ========== 遮罩与容器 ========== */
.ytl {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: var(--ytl-font);
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}
.ytl * { box-sizing: border-box; }
.ytl.open { opacity: 1; visibility: visible; }

.ytl-backdrop {
    position: absolute;
    inset: 0;
    background: var(--ytl-overlay);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* ========== 包裹层（居中 + 定位上下文） ========== */
.ytl-wrap {
    position: relative;
    display: flex;
    align-items: flex-start;
    animation: ytl-pop 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: center;
}
@keyframes ytl-pop {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ========== 面板（左右分栏） ========== */
.ytl-panel {
    position: relative;
    display: flex;
    width: 780px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    border-radius: var(--ytl-radius);
    box-shadow: var(--ytl-shadow);
    overflow: hidden;
}

/* 左侧图 */
.ytl-left {
    flex: 0 0 45%;
    background: var(--ytl-left-bg) center/cover no-repeat;
    position: relative;
}
.ytl-left::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.35) 0%, transparent 50%);
}

/* 右侧表单 */
.ytl-right {
    flex: 1;
    background: var(--ytl-bg);
    padding: 36px 32px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* 关闭按钮（相对于 .ytl-wrap 定位到面板右侧外面） */
.ytl-close {
    position: absolute;
    top: 12px;
    left: 100%;
    margin-left: 6px;
    z-index: 3;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease;
    padding: 0;
    flex-shrink: 0;
    opacity: 0.85;
}
.ytl-close:hover { opacity: 1; transform: scale(1.1); }
.ytl-close svg {width: 30px;height: 30px;stroke: #fff !important;stroke-width: 2.2;}
.ytl-icon { display: block; }

/* ========== 头部 ========== */
.ytl-head { margin-bottom: 24px; }
.ytl-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ytl-text);
}
.ytl-sub {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--ytl-text-2nd);
}

/* ========== 状态提示 ========== */
.ytl-status {
    min-height: 20px;
    margin-bottom: 4px;
    font-size: 13px;
    text-align: center;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.16s ease;
}
.ytl-status.ok, .ytl-status.error { opacity: 1; transform: none; }
.ytl-status.ok { color: var(--ytl-success); }
.ytl-status.error { color: var(--ytl-danger); }

/* ========== 表单 ========== */
.ytl-form { display: flex; flex-direction: column; gap: 12px; flex: 1; }

.ytl-field {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--ytl-field-bg);
    border: 1px solid var(--ytl-field-border);
    border-radius: var(--ytl-radius-sm);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.ytl-field:focus-within {
    border-color: var(--ytl-primary);
    box-shadow: 0 0 0 3px var(--ytl-field-focus);
}
.ytl-field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    flex-shrink: 0;
    color: #999;
}
.ytl-field input {
    flex: 1;
    height: 44px;
    padding: 0 14px 0 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--ytl-text);
    font-size: 14px;
    font-family: inherit;
}
.ytl-field input:disabled { opacity: 0.5; }
.ytl-field input::placeholder { color: #aaa; }

/* 验证码 */
.ytl-captcha { padding-right: 8px; }
.ytl-captcha-img {
    flex-shrink: 0;
    height: 32px;
    margin-left: 8px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--ytl-border);
}
.ytl-captcha-img[src=""] { visibility: hidden; }

/* 行 */
.ytl-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    margin-top: 2px;
}
.ytl-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ytl-text-2nd);
    cursor: pointer;
    user-select: none;
}
.ytl-check input { accent-color: var(--ytl-primary); width: 14px; height: 14px; }
.ytl-link {
    color: var(--ytl-text-2nd);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
}
.ytl-link:hover { color: var(--ytl-primary); }
.ytl-agree { margin-top: -2px; }

/* 提交按钮 */
.ytl-btn {
    height: 46px;
    border: none;
    border-radius: var(--ytl-radius-sm);
    background: var(--ytl-primary);
    color: var(--ytl-btn-text);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.1em;
    cursor: pointer;
    box-shadow: var(--ytl-btn-shadow);
    transition: background 0.16s ease, transform 0.14s ease, opacity 0.14s ease;
    margin-top: 4px;
}
.ytl-btn:hover { background: var(--ytl-primary-hover); }
.ytl-btn:active { transform: scale(0.99); }
.ytl-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

/* ========== 底部区域 ========== */
.ytl-bottom {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--ytl-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 社交登录 */
.ytl-social {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ytl-social-label {
    color: var(--ytl-text-2nd);
    font-size: 13px;
}
.ytl-social-btns {
    display: flex;
    gap: 10px;
}
.ytl-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ytl-field-bg);
    color: var(--ytl-text-2nd);
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
}
.ytl-social-btn:hover { background: var(--ytl-field-focus); }
.ytl-social-btn.ytl-qq:hover { color: var(--ytl-social-qq); }
.ytl-social-btn.ytl-wx:hover { color: var(--ytl-social-wx); }

/* 注册链接 */
.ytl-register {
    display: block;
    text-align: right;
    color: var(--ytl-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.ytl-register:hover { text-decoration: underline; }

/* 版权 */
.ytl-copyright {
    margin: 0;
    font-size: 11px;
    color: #bbb;
    text-align: center;
    line-height: 1.5;
}

/* ========== 微信扫码 ========== */
.ytl-wx { text-align: center; padding: 10px 0; }
.ytl-wx-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 170px;
    margin: 0 auto;
}
.ytl-wx-qr img {
    width: 160px;
    height: 160px;
    border-radius: 10px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--ytl-border);
}
.ytl-wx-loading { color: var(--ytl-text-2nd); font-size: 14px; }
.ytl-wx-fail { color: var(--ytl-danger); font-size: 14px; }
.ytl-wx-success { color: var(--ytl-success); font-size: 16px; font-weight: 600; }
.ytl-wx-tip { margin: 8px 0 4px; color: var(--ytl-text-2nd); font-size: 13px; }
.ytl-wx-back { font-size: 13px; }

/* ========== 多视图（登录 / 注册 / 忘记密码） ========== */
.ytl-view { flex: 1; display: flex; flex-direction: column; gap: 12px; }

/* 返回按钮（用于在登录头部动态切换显隐） */
.ytl-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    padding: 4px 6px;
    border: none;
    background: transparent;
    color: var(--ytl-text-2nd);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.14s ease, background 0.14s ease;
}
.ytl-back:hover { color: var(--ytl-primary); background: var(--ytl-field-focus); }
.ytl-back svg { width: 15px; height: 15px; }

/* 注册 / 忘记面板内的说明与分隔 */
.ytl-pane-split {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ytl-text-2nd);
    font-size: 12px;
}
.ytl-pane-split::before,
.ytl-pane-split::after { content: ""; flex: 1; height: 1px; background: var(--ytl-border); }

/* 发送验证码的行（验证码图 + 发送按钮）：允许换行，避免盖/溢出格子 */
.ytl-code-row {
    padding-right: 8px;
    flex-wrap: wrap;
    row-gap: 6px;
}
.ytl-code-row > input[name="regcaptcha"] { flex: 1; min-width: 60px; }
.ytl-code-row .ytl-captcha-img { flex-shrink: 0; margin-left: 8px; }
.ytl-code-btn {
    flex-shrink: 0;
    height: 32px;
    margin-left: 8px;
    padding: 0 12px;
    border: 1px solid var(--ytl-primary);
    border-radius: 6px;
    background: transparent;
    color: var(--ytl-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.14s ease, color 0.14s ease;
}
.ytl-code-btn:hover { background: var(--ytl-primary); color: var(--ytl-btn-text); }
.ytl-code-btn:disabled { opacity: 0.5; cursor: default; background: transparent; color: var(--ytl-text-2nd); border-color: var(--ytl-border); }

/* 注册 / 忘记面板底部（返回登录） */
.ytl-pane-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--ytl-border);
    margin-top: 2px;
    font-size: 13px;
    color: var(--ytl-text-2nd);
}
.ytl-tip {
    margin: 0;
    font-size: 12px;
    color: var(--ytl-text-2nd);
    text-align: left;
    line-height: 1.5;
}

/* ========== 交互皮肤：aurora（极光渐变） ========== */
.ytl[data-ytlogin-skin="aurora"] {
    --ytl-primary: #6C5CE7;
    --ytl-primary-hover: #5a4bd0;
    --ytl-field-focus: rgba(108, 92, 231, 0.14);
    --ytl-btn-text: #fff;
    --ytl-btn-shadow: 0 12px 26px rgba(108, 92, 231, 0.38);
    --ytl-shadow: 0 30px 70px rgba(0, 0, 0, 0.32);
    --ytl-left-bg: linear-gradient(135deg, #6C5CE7 0%, #a855f7 35%, #ec4899 65%, #f59e0b 100%);
}
/* 左侧：浅色静态背景（去掉原动态流动渐变与呼吸光斑动画） */
.ytl[data-ytlogin-skin="aurora"] .ytl-left {
    background-image: linear-gradient(155deg, #d9d5e0 0%, #c6c1cf 55%, #b4aebb 100%);
    background-size: cover;
}
/* 标题：渐变文字 */
.ytl[data-ytlogin-skin="aurora"] .ytl-title {
    background: linear-gradient(120deg, #6C5CE7, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
/* 输入框：聚焦上浮 + 光晕 */
.ytl[data-ytlogin-skin="aurora"] .ytl-field {
    transition: transform .2s cubic-bezier(.22, 1, .36, 1), border-color .2s ease, box-shadow .2s ease;
}
.ytl[data-ytlogin-skin="aurora"] .ytl-field:focus-within {
    transform: translateY(-2px);
    border-color: var(--ytl-primary);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.12), 0 0 0 3px var(--ytl-field-focus);
}
/* 提交按钮：渐变 + 悬停上浮 + 光带扫过 */
.ytl[data-ytlogin-skin="aurora"] .ytl-btn {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #6C5CE7, #a855f7);
    box-shadow: var(--ytl-btn-shadow);
    transition: transform .22s cubic-bezier(.22, 1, .36, 1), box-shadow .22s ease, opacity .16s ease;
}
.ytl[data-ytlogin-skin="aurora"] .ytl-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(108, 92, 231, 0.45);
}
.ytl[data-ytlogin-skin="aurora"] .ytl-btn:active { transform: translateY(0) scale(.98); }
.ytl[data-ytlogin-skin="aurora"] .ytl-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -130%;
    width: 80%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: skewX(-20deg);
    transition: left .65s ease;
}
.ytl[data-ytlogin-skin="aurora"] .ytl-btn:hover::after { left: 140%; }
.ytl[data-ytlogin-skin="aurora"] .ytl-btn:disabled::after { display: none; }
/* 社交按钮：悬停上浮 */
.ytl[data-ytlogin-skin="aurora"] .ytl-social-btn {
    transition: transform .18s ease, color .14s ease, background .14s ease;
}
.ytl[data-ytlogin-skin="aurora"] .ytl-social-btn:hover { transform: translateY(-2px); }

/* ================= 左侧角色（完全套用参考实现，纯 div） ================= */
.ytl-chars { display: none; }
.ytl[data-ytlogin-skin="aurora"] .ytl-chars {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
}
.characters-scene { position: relative; width: 480px; height: 360px; transform-origin: center; }
.character {
    position: absolute;
    bottom: 0;
    transition: all 0.7s ease-in-out;
    transform-origin: bottom center;
}
/* 紫 */
.char-purple { left: 60px; width: 170px; height: 370px; background: #6c3ff5; border-radius: 10px 10px 0 0; z-index: 1; }
/* 黑 */
.char-black { left: 220px; width: 115px; height: 290px; background: #2d2d2d; border-radius: 8px 8px 0 0; z-index: 2; }
/* 橙 */
.char-orange { left: 0; width: 230px; height: 190px; background: #ff9b6b; border-radius: 115px 115px 0 0; z-index: 3; }
/* 黄 */
.char-yellow { left: 290px; width: 135px; height: 215px; background: #e8d754; border-radius: 68px 68px 0 0; z-index: 4; }

.eyes { position: absolute; display: flex; transition: all 0.7s ease-in-out; }
.eyeball { border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; transition: height 0.15s ease; overflow: hidden; }
.pupil { border-radius: 50%; background: #2d2d2d; transition: transform 0.1s ease-out; }
.bare-pupil { width: 12px; height: 12px; border-radius: 50%; background: #2d2d2d; transition: transform 0.7s ease-in-out; }
.yellow-mouth { position: absolute; width: 50px; height: 4px; background: #2d2d2d; border-radius: 2px; transition: all 0.7s ease-in-out; }

/* 摇头 */
@keyframes shakeHead {
    0%, 100% { translate: 0 0; }
    10% { translate: -9px 0; }
    20% { translate: 7px 0; }
    30% { translate: -6px 0; }
    40% { translate: 5px 0; }
    50% { translate: -4px 0; }
    60% { translate: 3px 0; }
    70% { translate: -2px 0; }
    80% { translate: 1px 0; }
    90% { translate: -0.5px 0; }
}
.eyes.shake-head, .yellow-mouth.shake-head, .orange-mouth.shake-head { animation: shakeHead 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }

/* 橙 sad 嘴 */
.orange-mouth { position: absolute; width: 28px; height: 14px; border: 3px solid #2d2d2d; border-top: none; border-radius: 0 0 14px 14px; opacity: 0; transition: all 0.7s ease-in-out; }
.orange-mouth.visible { opacity: 1; }
/* 显示密码按钮 */
.ytl-field-pwd { padding-right: 4px; }
.ytl-eye {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    margin-right: 6px;
    display: grid;
    place-items: center;
    border: none;
    background: transparent;
    color: var(--ytl-text-2nd);
    cursor: pointer;
    border-radius: 8px;
    transition: color .15s ease, background .15s ease;
}
.ytl-eye:hover { color: var(--ytl-primary); background: var(--ytl-field-focus); }
.ytl-eye svg { width: 18px; height: 18px; }

/* ========== 移动端 ========== */
@media (max-width: 640px) {
    .ytl { padding: 12px; }
    .ytl-panel {
        flex-direction: column;
        max-height: calc(100vh - 24px);
        width: 100%;
    }
    .ytl-left {
        flex: none;
        height: 120px;
    }
    .ytl-right {
        padding: 24px 20px 20px;
    }
    .ytl-title { font-size: 22px; }
    .ytl-close { display: none !important; }
}

/* ========== 图片动效皮肤：photo（底图 + GIF 叠加 + 底部欢迎文字） ========== */
.ytl[data-ytlogin-skin="photo"] .ytl-left {
    background: #fff;
}
.ytl[data-ytlogin-skin="photo"] .ytl-photo {
    position: absolute;
    inset: 0;
    z-index: 1;
}
/* 底图铺满左侧区域（同可风网原版 .bg 行为） */
.ytl[data-ytlogin-skin="photo"] .ytl-photo-bg {
    position: absolute;
    inset: 0;
}
.ytl[data-ytlogin-skin="photo"] .ytl-photo-bg img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* 动图：定位在右上角、占容器宽度的 57.3%（严格对齐原版 .gif 规则，不再铺满） */
.ytl[data-ytlogin-skin="photo"] .ytl-photo-gif {
    position: absolute;
    right: 1em;
    top: 5em;
    width: 57.3%;
    pointer-events: none; /* 动图层不拦截鼠标 */
}
.ytl[data-ytlogin-skin="photo"] .ytl-photo-gif img {
    display: block;
    width: 100%;
    height: auto;
}
.ytl[data-ytlogin-skin="photo"] .ytl-photo-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 26px;
    z-index: 2;
    text-align: center;
    font-size: 14px;
    letter-spacing: 1px;
    color: #7B8494;
}
