/* 瓶子云讯 Web 品牌样式 */
.mx_AuthPage_modalContent {
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.mx_AuthHeader {
    background: linear-gradient(155deg, #0d547d 0%, #168acd 52%, #37cbbb 100%);
    border-radius: 24px 0 0 24px;
}

.mx_AuthHeaderLogo img {
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.25));
}

.mx_AuthHeader .mx_Dropdown_input,
.mx_AuthHeader .mx_LanguageDropdown,
.mx_AuthHeader .mx_Dropdown_arrow {
    color: #ffffff;
}

.mx_AuthBody {
    border-radius: 0 24px 24px 0;
}

.mx_Login_submit {
    background: #168acd;
    border-radius: 12px;
    font-weight: 600;
}

.mx_Login_submit:hover {
    background: #0f7bb8;
}

.mx_Login_forgot {
    display: none !important;
}

/* 保留 Element 自身的“创建账户”节点，只改变样式和点击目标，避免 React DOM 冲突 */
.mx_AuthBody_changeFlow {
    display: block !important;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e8eef3;
    color: #6b7784;
    font-size: 13px;
}

.mx_AuthBody_changeFlow > span {
    display: block;
}

.mx_AuthBody_changeFlow .mx_AccessibleButton {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
    padding: 11px 16px;
    border-radius: 12px;
    background: #168acd;
    color: #ffffff !important;
    font-size: 0;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(22, 138, 205, 0.24);
    cursor: pointer;
}

.mx_AuthBody_changeFlow .mx_AccessibleButton::after {
    content: "注册新账号";
    font-size: 14px;
}

.mx_AuthBody_changeFlow .mx_AccessibleButton:hover {
    background: #0f7bb8;
}

.mx_AuthFooter a {
    display: none;
}

.mx_AuthFooter::after {
    content: "瓶子云讯 · 端到端加密";
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    letter-spacing: 0.06em;
}

@media (max-width: 640px) {
    .mx_AuthHeader {
        border-radius: 24px 24px 0 0;
    }
    .mx_AuthBody {
        border-radius: 0 0 24px 24px;
    }
    .mx_AuthBody::before {
        content: "";
        display: block;
        width: 72px;
        height: 72px;
        margin: 0 auto 18px;
        background: url('/branding/logo.png?v=20261026') center / contain no-repeat;
    }
}


.pz-register-wrap {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
}

.pz-register-wrap a {
    color: #168acd;
    font-weight: 650;
}


.pz-register-fab {
    position: fixed;
    right: 22px;
    bottom: 26px;
    z-index: 9999;
    padding: 12px 18px;
    border-radius: 999px;
    background: #fff;
    color: #168acd !important;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none !important;
    box-shadow: 0 14px 34px rgba(0, 20, 35, 0.28);
    border: 1px solid rgba(22, 138, 205, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pz-register-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(0, 20, 35, 0.34);
}

@media (max-width: 640px) {
    .pz-register-fab {
        right: 50%;
        bottom: 24px;
        transform: translateX(50%);
        white-space: nowrap;
    }
    .pz-register-fab:hover {
        transform: translateX(50%) translateY(-1px);
    }
}

/* 多账号切换 */
.pz-account-fab {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 9998;
    border: 1px solid rgba(22, 138, 205, 0.18);
    background: #fff;
    color: #168acd;
    border-radius: 999px;
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 20, 35, 0.22);
}

.pz-account-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(0, 20, 35, 0.28);
}

.pz-account-panel {
    position: fixed;
    left: 16px;
    bottom: 64px;
    z-index: 9999;
    width: min(330px, calc(100vw - 32px));
    max-height: min(460px, calc(100vh - 100px));
    overflow: auto;
    background: #fff;
    color: #17212b;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 24px 60px rgba(0, 20, 35, 0.34);
    border: 1px solid rgba(22, 138, 205, 0.13);
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    pointer-events: none;
    transition: 0.14s ease;
}

.pz-account-panel.pz-account-panel-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.pz-account-title {
    font-size: 15px;
    font-weight: 750;
    margin: 1px 2px 4px;
}

.pz-account-sub {
    font-size: 11px;
    line-height: 1.5;
    color: #75818c;
    margin: 0 2px 10px;
}

.pz-account-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pz-account-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    border: 0;
    background: #f6f9fb;
    border-radius: 11px;
    padding: 9px;
    text-align: left;
    cursor: pointer;
    color: #17212b;
    font: inherit;
}

.pz-account-item:hover {
    background: #eaf5fc;
}

.pz-account-item.pz-account-current {
    background: #e9f7ff;
    box-shadow: inset 0 0 0 1px rgba(22, 138, 205, 0.22);
}

.pz-account-avatar {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #168acd, #37cbbb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 750;
    font-size: 13px;
}

.pz-account-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pz-account-name {
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pz-account-id {
    color: #7b8792;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pz-account-badge {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #168acd;
    color: #fff;
    font-size: 9px;
    padding: 3px 6px;
    font-weight: 700;
}

.pz-account-empty {
    color: #7b8792;
    font-size: 12px;
    padding: 12px 4px;
    text-align: center;
}

.pz-account-add {
    width: 100%;
    margin-top: 9px;
    border: 1px dashed #b9d9eb;
    border-radius: 11px;
    background: #fbfdff;
    color: #168acd;
    padding: 9px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.pz-account-add:hover {
    background: #f0faff;
}

.pz-account-toast {
    position: fixed;
    left: 16px;
    bottom: 64px;
    z-index: 10000;
    background: #17212b;
    color: #fff;
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 12px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

@media (max-width: 640px) {
    .pz-account-fab {
        left: 12px;
        bottom: 12px;
    }
    .pz-account-panel {
        left: 12px;
        bottom: 58px;
    }
}

/* 登录页语言下拉：触发器在渐变上使用白字，菜单必须使用深色字 */
.mx_AuthHeader .mx_Dropdown_menu {
    background: #ffffff;
    color: #17212b;
}

.mx_AuthHeader .mx_Dropdown_menu .mx_Dropdown_option {
    color: #17212b !important;
}

.mx_AuthHeader .mx_Dropdown_menu .mx_Dropdown_option_highlight {
    color: #17212b !important;
    background: #e9eef3;
}

/* 其他页面的语言下拉保持跟随主题 */
.mx_Dropdown_menu {
    color: var(--cpd-color-text-primary, inherit);
}

.mx_Dropdown_menu .mx_Dropdown_option {
    color: var(--cpd-color-text-primary, inherit);
}

/* 登录卡片内明显的注册入口 */
.pz-register-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e8eef3;
    color: #6b7784;
    font-size: 13px;
}

.pz-register-inline-label {
    flex: 1 1 auto;
}

.pz-register-inline-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 9px 16px;
    border-radius: 10px;
    background: #168acd;
    color: #ffffff !important;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 6px 16px rgba(22, 138, 205, 0.22);
}

.pz-register-inline-button:hover {
    background: #0f7bb8;
}

/* 移动端登录卡片适配 */
@media (max-width: 640px) {
    .mx_AuthPage {
        padding: 14px 0;
        align-items: center;
    }

    .mx_AuthPage_modal {
        width: calc(100vw - 28px) !important;
        max-width: 430px !important;
    }

    .mx_AuthPage_modalContent {
        width: 100% !important;
    }

    .mx_AuthBody {
        width: 100% !important;
        padding: 22px 18px 18px !important;
        font-size: 14px;
    }

    .mx_AuthBody form {
        width: 100% !important;
    }

    .mx_Login_submit {
        width: 100%;
    }

    .mx_AuthBody_changeFlow {
        margin-top: 16px;
        padding-top: 14px;
    }
}


@media (max-width: 640px) {
    .pz-account-fab {
        left: auto;
        right: 12px;
        bottom: 12px;
    }
    .pz-account-panel {
        left: auto;
        right: 12px;
        bottom: 58px;
    }
    body.pz-room-open .pz-account-fab,
    body.pz-room-open .pz-account-panel {
        display: none !important;
    }
    .mx_HomePage {
        max-width: none !important;
    }
}


@media (max-width: 640px) {
    .mx_HomePage {
        margin: 0 12px !important;
    }
    .mx_Dialog_wrapper {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
    }
    .mx_Dialog_border {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        margin: 0 auto !important;
    }
    .mx_Dialog {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px 16px !important;
        max-height: calc(100vh - 16px) !important;
        overflow-y: auto !important;
    }
    .mx_Dialog_fixedWidth,
    .mx_CreateRoomDialog {
        width: 100% !important;
        max-width: 100% !important;
    }
    .mx_Dialog_header,
    .mx_Dialog_content,
    .mx_Dialog_buttons,
    .mx_Dialog_buttons_row {
        width: 100% !important;
        max-width: 100% !important;
    }
    .mx_Dialog_content .mx_Field,
    .mx_Dialog_content .mx_Field_input,
    .mx_Dialog_content .mx_JoinRuleDropdown,
    .mx_Dialog_content .mx_Dropdown {
        width: 100% !important;
        max-width: 100% !important;
    }
}


/* 移动端房间列表抽屉：解决 Element 在窄屏下房间列表宽度为 0 的问题 */
.pz-roomlist-fab {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 64px;
    z-index: 10000;
    border: 1px solid rgba(22, 138, 205, 0.18);
    background: #168acd;
    color: #ffffff;
    border-radius: 999px;
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 20, 35, 0.22);
    align-items: center;
    justify-content: center;
}

@media (max-width: 640px) {
    .pz-roomlist-fab {
        right: 12px;
        bottom: 60px;
    }
    body.pz-room-open .pz-roomlist-fab {
        bottom: 84px;
    }
    body.pz-roomlist-open .pz-roomlist-fab {
        bottom: 12px;
    }
    body.pz-roomlist-open .pz-account-fab,
    body.pz-roomlist-open .pz-account-panel {
        display: none !important;
    }
    .mx_HomePage {
        width: calc(100% - 24px) !important;
    }
    .mx_RoomHeader {
        padding: 0 8px 0 12px !important;
    }
    .mx_RoomHeader button[aria-label="消息列"],
    .mx_RoomHeader button[aria-label="房间信息"]:not(.mx_RoomHeader_infoWrapper),
    .mx_RoomHeader .mx_FacePile {
        display: none !important;
    }
    .mx_RoomHeader_infoWrapper {
        display: flex !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
    }
    .mx_RoomHeader_info {
        width: auto !important;
        max-width: none !important;
        padding-right: 0 !important;
        min-width: 0 !important;
    }
    .mx_RoomHeader_heading {
        min-width: 0 !important;
    }
    .mx_RoomHeader_truncated {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
}


/* 设备验证 / 数字身份确认弹层：Element 默认固定 600px，窄屏会溢出 */
@media (max-width: 640px) {
    .mx_SetupEncryptionBody,
    .mx_EncryptionCard {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    .mx_EncryptionCard_header {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        flex-wrap: wrap !important;
    }
    .mx_EncryptionCard_header h2 {
        width: auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }
    .mx_EncryptionCard_emphasisedContent,
    .mx_EncryptionCard_buttons {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    .mx_EncryptionCard_buttons {
        flex-direction: column !important;
    }
    .mx_EncryptionCard_buttons > button {
        width: 100% !important;
        max-width: 100% !important;
    }
}

body.pz-modal-open .pz-account-fab,
body.pz-modal-open .pz-account-panel,
body.pz-modal-open .pz-roomlist-fab {
    display: none !important;
}
