.auth-stage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: #f7f8fb;
}

.auth-shell {
    width: 100%;
    max-width: 460px;
}

.auth-brand,
.tabs {
    display: none;
}

.auth-panel {
    position: relative;
    width: 100%;
    min-height: 580px;
    padding: 48px 46px 30px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e7eaf1;
    border-radius: 6px;
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.12);
}

.auth-mode-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.auth-mode-toggle::before {
    content: none;
}

.auth-mode-toggle::after {
    content: "";
    position: absolute;
    right: 6px;
    top: 7px;
    width: 20px;
    height: 14px;
    border: 2px solid #5b83ff;
    border-radius: 2px;
}

.mode-icon {
    position: absolute;
    z-index: 1;
    right: 10px;
    top: 25px;
    width: 14px;
    height: 2px;
    color: #5b83ff;
    background: currentColor;
}

.mode-icon-account {
    display: block;
}

.mode-icon-account::after {
    content: none;
}

.mode-icon-qr {
    display: none;
    right: 6px;
    top: 6px;
    width: 22px;
    height: 22px;
    background:
        linear-gradient(#fff, #fff) 0 0 / 9px 9px no-repeat,
        linear-gradient(#fff, #fff) 13px 0 / 9px 9px no-repeat,
        linear-gradient(#fff, #fff) 0 13px / 9px 9px no-repeat,
        linear-gradient(#fff, #fff) 13px 13px / 9px 9px no-repeat;
}

.mode-icon-qr {
    color: #5b83ff;
}

.auth-panel.mode-account .auth-mode-toggle::after {
    display: none;
}

.auth-panel.mode-account .mode-icon {
    background:
        linear-gradient(#5b83ff, #5b83ff) 0 0 / 9px 9px no-repeat,
        linear-gradient(#5b83ff, #5b83ff) 13px 0 / 9px 9px no-repeat,
        linear-gradient(#5b83ff, #5b83ff) 0 13px / 9px 9px no-repeat,
        linear-gradient(#5b83ff, #5b83ff) 13px 13px / 9px 9px no-repeat;
}

.mode-icon-qr::before,
.mode-icon-qr::after {
    content: "";
    position: absolute;
    background: #5b8cff;
}

.mode-icon-qr::before {
    inset: 3px 12px 12px 3px;
    box-shadow: 13px 0 0 #5b83ff, 0 13px 0 #5b83ff, 13px 13px 0 #5b83ff;
}

.mode-icon-qr::after {
    left: 9px;
    top: 9px;
    width: 5px;
    height: 5px;
}

.auth-panel.mode-account .mode-icon-account {
    display: none;
}

.auth-panel.mode-account .mode-icon-qr {
    display: block;
}

.auth-panel.mode-account {
    min-height: 390px;
}

.view {
    display: block;
}

.login-pane {
    display: none;
}

.login-pane.active {
    display: block;
}

.qr-login-pane {
    text-align: center;
}

.qr-brand-icon {
    width: 34px;
    height: 34px;
    margin: 2px auto 12px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #1f7aff;
    border-radius: 6px;
}

.qr-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qr-title {
    margin: 0;
    color: #111827;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 800;
}

.qr-subtitle {
    margin: 4px 0 14px;
    color: #374151;
    font-size: 13px;
}

.dingtalk-embed {
    position: relative;
    width: 260px;
    margin: 0 auto;
}

.dingtalk-refresh-btn {
    margin: 8px auto 0;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #2563eb;
    cursor: pointer;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.dingtalk-refresh-btn:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #eff6ff;
}

.dingtalk-refresh-btn:disabled {
    cursor: default;
    opacity: 0.55;
}

.dingtalk-refresh-btn svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dingtalk-frame-shell {
    position: relative;
    width: 260px;
    height: 300px;
    overflow: hidden;
    background: #fff;
}

.dingtalk-frame-shell iframe {
    display: block;
    width: 260px;
    height: 300px;
    border: 0;
    background: #fff;
}

.dingtalk-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: #6b7280;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    background: #fff;
}

.account-login-pane {
    padding-top: 4px;
}

.title {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.35;
    letter-spacing: 0;
}

.desc {
    margin: 0 0 22px;
    color: #6b7280;
    line-height: 1.7;
}

.form {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.input {
    height: 38px;
}

.submit {
    margin-top: 4px;
    width: 100%;
}

.message {
    margin-top: 14px;
    text-align: center;
}

@media (max-width: 420px) {
    .auth-stage {
        padding: 16px;
    }

    .auth-panel {
        min-height: 540px;
        padding: 44px 24px 22px;
    }

    .dingtalk-embed,
    .dingtalk-frame-shell {
        width: min(260px, calc(100vw - 80px));
    }

    .dingtalk-frame-shell {
        height: 300px;
    }

    .dingtalk-frame-shell iframe {
        width: 100%;
        height: 300px;
    }
}
