/* Bottom floating balance */
.balance-float { position: fixed; left: 10px; bottom: 24px; background: #fff; border-radius: 12px; padding: 14px 14px 12px; box-shadow: 0 2px 12px rgba(0,0,0,.1); display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 10px; z-index: 200; min-width: 180px; }
.balance-float > div { display: block; width: 100%; }
.balance-float .num { display: block; font-size: 24px; font-weight: 700; color: #333; line-height: 1.1; }
.balance-float .label { display: block; font-size: 11px; color: #999; margin-bottom: 6px; }
.balance-float .sub-label { display: block; font-size: 10px; color: #bbb; margin-top: 6px; }
.balance-float .btn-buy { display: block; width: 100%; margin-top: 2px; background: linear-gradient(135deg, #ff6b6b, #ee5a24); color: #fff; border: none; border-radius: 16px; padding: 8px 16px; font-size: 12px; cursor: pointer; text-align: center; }
.balance-float .btn-buy:hover { opacity: .9; }

.customer-service-widget.is-hidden {
    display: none !important;
}

.customer-service-widget {
    position: fixed !important;
    right: 14px;
    bottom: 132px;
    z-index: 1200;
    width: 60px;
    display: block;
    overflow: visible;
}

.customer-service-widget__button {
    width: 60px;
    min-height: 106px;
    padding: 10px 6px 8px;
    border: 1px solid #dfe4f5;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(29, 43, 76, .16);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #4d5dff;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    appearance: none;
}

.customer-service-widget__button:hover {
    transform: translateY(-2px);
    border-color: #b8c6ff;
    box-shadow: 0 18px 40px rgba(32, 52, 102, .2);
}

.customer-service-widget__icon {
    font-size: 20px;
    line-height: 1;
}

.customer-service-widget__button-icon-wrap {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #f3f5ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.customer-service-widget__label {
    display: block;
    width: 2.4em;
    font-size: 12px;
    line-height: 1.15;
    color: #2e3a59;
    text-align: center;
    white-space: normal;
    word-break: break-all;
}

.customer-service-widget__panel {
    position: absolute;
    right: 72px;
    bottom: 0;
    width: 214px;
    padding: 14px 14px 12px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #e6ebff;
    box-shadow: 0 20px 44px rgba(24, 38, 77, .18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(12px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.customer-service-widget__panel::after {
    content: '';
    position: absolute;
    right: -7px;
    bottom: 22px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-top: 1px solid #e6ebff;
    border-right: 1px solid #e6ebff;
    transform: rotate(45deg);
}

.customer-service-widget.is-active .customer-service-widget__panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.customer-service-widget__title {
    font-size: 15px;
    font-weight: 700;
    color: #22304d;
    text-align: center;
}

.customer-service-widget__desc {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: #6b7691;
    text-align: center;
}

.customer-service-widget__qr-wrap {
    margin-top: 12px;
    padding: 10px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
    border: 1px solid #eef2ff;
}

.customer-service-widget__qr {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
}

.customer-service-widget__tip {
    margin-top: 10px;
    font-size: 11px;
    line-height: 1.4;
    color: #9aa4bc;
    text-align: center;
}

/* Student toast */
.student-toast-container {
    position: fixed;
    top: 72px;
    right: 24px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    pointer-events: none;
}
.student-toast {
    min-width: 240px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    color: #333;
    background: #fff;
    border: 1px solid #ececec;
    font-size: 13px;
    line-height: 1.5;
    pointer-events: auto;
    transform: translateY(-6px);
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
}
.student-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.student-toast--error {
    border-color: #ffd7d7;
    background: #fff7f7;
}
.student-toast--success {
    border-color: #cdeed8;
    background: #f4fff7;
}
.student-toast--info {
    border-color: #d8e4ff;
    background: #f7faff;
}

/* Shared modal */
.panel-modal .modal-content { border: none; border-radius: 16px; overflow: hidden; }
.panel-modal .modal-body { position: relative; }
.panel-modal .btn-close { position: absolute; top: 16px; right: 16px; }

/* Login modal */
.login-modal .modal-body { padding: 48px 40px; }
.login-modal__title { text-align: center; font-size: 24px; font-weight: 700; color: #333; margin-bottom: 8px; }
.login-modal__desc { text-align: center; color: #888; font-size: 14px; margin-bottom: 32px; }
.login-modal__qr-wrap { text-align: center; margin-bottom: 24px; }
.login-modal__qr-frame { display: inline-block; padding: 16px; background: #f8f9fa; border-radius: 12px; }
.login-modal__qr-img { width: 200px; height: 200px; display: block; }
.login-modal__qr-tip { color: #666; font-size: 13px; margin-top: 12px; margin-bottom: 4px; }
.login-modal__qr-brand { color: #999; font-size: 12px; margin: 0; }
.login-modal__shortcut { margin-top: 32px; }
.login-modal__shortcut-title { text-align: center; color: #666; font-size: 14px; margin-bottom: 16px; }
.login-modal__shortcut-box { background: #fff8e6; border: 1px solid #ffe7a3; border-radius: 8px; padding: 12px 16px; }
.login-modal__shortcut-text { color: #d97706; font-size: 13px; margin: 0; line-height: 1.6; }
.login-modal__agreement { text-align: center; color: #999; font-size: 12px; margin-top: 24px; margin-bottom: 0; }
.login-modal__link { color: #6c5ce7; text-decoration: none; }

/* Recharge modal */
.recharge-modal .modal-dialog { max-width: 420px; }
.recharge-modal .modal-body { padding: 40px 32px; }
.recharge-modal__title { font-size: 20px; font-weight: 700; color: #333; margin-bottom: 4px; }
.recharge-modal__hint { color: #888; font-size: 14px; margin-bottom: 24px; }
.recharge-modal__amount-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.recharge-modal__actions { display: flex; gap: 8px; margin-bottom: 16px; }
.recharge-pay-btn { flex: 1; padding: 12px; color: #fff; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; transition: opacity .15s; }
.recharge-pay-btn:disabled,
.recharge-pay-btn.is-disabled { opacity: .65; cursor: not-allowed; }
.recharge-pay-btn--wechat { background: #07c160; }
.recharge-pay-btn--alipay { background: #1677ff; }
.recharge-modal__status { color: #666; font-size: 13px; margin-bottom: 12px; text-align: center; }
.recharge-modal__qr-box { text-align: center; }
.recharge-modal__qr-img { width: 180px; height: 180px; border-radius: 8px; }
.recharge-modal__qr-meta { color: #333; font-size: 13px; margin-top: 12px; margin-bottom: 4px; }
.recharge-modal__qr-tip { color: #888; font-size: 13px; margin-top: 8px; }

@media (max-width: 767px) {
    .customer-service-widget {
        right: 12px;
        bottom: 104px;
        width: 56px;
    }

    .customer-service-widget__button {
        width: 56px;
        min-height: 92px;
        border-radius: 13px;
        padding: 10px 6px 8px;
    }

    .customer-service-widget__label {
        font-size: 12px;
        width: 2.4em;
    }

    .customer-service-widget__panel {
        right: 68px;
        bottom: 0;
        width: 172px;
        padding: 12px;
    }

    .customer-service-widget__panel::after {
        bottom: 18px;
    }

    .customer-service-widget__tip {
        display: none;
    }

    .balance-float {
        left: 8px;
        right: auto;
        bottom: 12px;
        padding: 8px 10px;
        font-size: 11px;
        flex-direction: column;
        gap: 6px;
        min-width: auto;
    }
    .balance-float > div {
        text-align: center;
    }
    .balance-float .label {
        font-size: 9px;
        margin-bottom: 2px;
    }
    .balance-float .num {
        font-size: 16px;
        margin-bottom: 2px;
    }
    .balance-float .sub-label {
        font-size: 9px;
    }
    .balance-float .btn-buy {
        font-size: 10px;
        padding: 5px 12px;
        width: 100%;
    }

    .student-toast-container {
        top: 64px;
        right: 12px;
        left: 12px;
        align-items: stretch;
    }
    .student-toast {
        min-width: 0;
        max-width: none;
    }
}
