/* LinkVision UI kit：统一下拉菜单与对话框（配合 /shared-static/js/ui-kit.js）。 */

.lv-select-menu {
    position: fixed;
    z-index: 10000;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid rgba(150, 176, 202, 0.6);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.08);
    font-family: inherit;
    box-sizing: border-box;
}

.lv-select-menu[hidden] {
    display: none;
}

.lv-select-menu__group {
    padding: 8px 12px 4px;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.lv-select-menu__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 7px;
    color: #14314e;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

.lv-select-menu__item.is-active {
    background: #eef4fb;
}

.lv-select-menu__item.is-selected {
    color: #1f4fbf;
    font-weight: 700;
}

.lv-select-menu__item.is-selected::after {
    content: "";
    flex: 0 0 auto;
    width: 5px;
    height: 10px;
    margin-top: -3px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.lv-select-menu__item.is-disabled {
    color: #98a2b3;
    cursor: not-allowed;
    background: transparent;
}

select.lv-select-open {
    border-color: #2f5bd8 !important;
    box-shadow: 0 0 0 3px rgba(47, 91, 216, 0.14) !important;
}

/* 对话框 */
.lv-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(16, 24, 40, 0.42);
    box-sizing: border-box;
}

.lv-dialog {
    width: min(440px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 22px 22px 18px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 24px 48px rgba(16, 24, 40, 0.24);
    color: #101828;
    font-family: inherit;
    box-sizing: border-box;
}

.lv-dialog__title {
    margin-bottom: 8px;
    font-size: 17px;
    font-weight: 700;
    color: #14314e;
}

.lv-dialog__message {
    font-size: 14px;
    line-height: 1.6;
    color: #344054;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.lv-dialog__input {
    width: 100%;
    min-height: 40px;
    margin-top: 12px;
    padding: 8px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.lv-dialog__input:focus {
    outline: none;
    border-color: #2f5bd8;
    box-shadow: 0 0 0 3px rgba(47, 91, 216, 0.14);
}

.lv-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.lv-dialog__button {
    min-width: 84px;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #ffffff;
    color: #344054;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.lv-dialog__button:hover {
    background: #f5f8ff;
}

.lv-dialog__button.is-primary {
    border-color: #2f5bd8;
    background: #2f5bd8;
    color: #ffffff;
}

.lv-dialog__button.is-primary:hover {
    background: #2449b5;
}

.lv-dialog__button.is-danger {
    border-color: #d92d20;
    background: #d92d20;
}

.lv-dialog__button.is-danger:hover {
    background: #b42318;
}

.lv-dialog__button:focus-visible {
    outline: 2px solid rgba(47, 91, 216, 0.55);
    outline-offset: 2px;
}

/* 下拉框箭头：统一自绘，距右边框 12px，文字右侧留出空间（浏览器自带箭头贴边且各系统不一致）。 */
select:not([multiple]):not([size]) {
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23667085' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px 8px !important;
    padding-right: 34px !important;
}

select:not([multiple]):not([size]):disabled {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23c0c6d0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}

select::-ms-expand {
    display: none;
}

/* 顶栏语言下拉：旧导航规则用 background 简写（!important）覆盖了箭头，这里按 id 提高优先级补回。 */
html body select#language-switcher {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23667085' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px 8px !important;
    padding-right: 34px !important;
}

/* 首屏语言：翻译完成前隐藏页面（ui-kit.js 的 holdUntilTranslated），避免先显示英文再跳成中文。
   2.5 秒兜底显示，脚本出错也不会一直空白。 */
html.lv-lang-pending body {
    visibility: hidden;
    animation: lv-lang-reveal 0s linear 2.5s forwards;
}

@keyframes lv-lang-reveal {
    to {
        visibility: visible;
    }
}

/* 中心切换骨架屏（ui-kit.js 的 pageTransition）。骨架铺在顶栏下方，顶栏始终在它之上可见。 */
html.lv-page-loading :is(.admin-topbar-host, header.toolbar-host),
html.lv-page-leaving :is(.admin-topbar-host, header.toolbar-host) {
    z-index: 10001 !important;
}

/* 语言等待期间 body 是隐藏的；顶栏文字已在解析时换成界面语言，单独放出来。
   业务中心顶栏下方的页签行仍是英文模板，继续等翻译。 */
html.lv-lang-pending.lv-page-loading :is(.admin-topbar-host, header.toolbar-host) {
    visibility: visible;
}

html.lv-lang-pending.lv-page-loading header.toolbar-host .workspace-toolbar-shell {
    visibility: hidden;
}

.lv-skeleton {
    position: fixed;
    top: var(--lv-skel-top, 0px);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10000;
    display: flex;
    overflow: hidden;
    background: #f9fafb;
    visibility: visible;
    opacity: 1;
    transition: opacity .24s ease-out;
}

.lv-skeleton.is-done {
    opacity: 0;
    pointer-events: none;
}

.lv-skeleton--leaving {
    animation: lv-skeleton-in .16s ease-out both;
}

.lv-skeleton__side {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 28px 20px;
    background: #ffffff;
    border-right: 1px solid #eaecf0;
}

.lv-skeleton--enter-side .lv-skeleton__side {
    animation: lv-skeleton-side-in .28s cubic-bezier(.2, .7, .2, 1) both;
}

.lv-skeleton__main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.lv-skeleton__main--split {
    flex-direction: row;
    gap: 20px;
    padding: 20px 24px;
}

.lv-skeleton__main--split > .lv-skeleton__main {
    padding: 0;
}

.lv-skeleton__cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.lv-skeleton__card,
.lv-skeleton__panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #eaecf0;
    border-radius: 8px;
}

.lv-skeleton__card {
    min-height: 104px;
}

.lv-skeleton__panel {
    flex: 1 1 auto;
    gap: 18px;
}

.lv-skeleton__panel--aside {
    flex: 0 0 min(34%, 420px);
}

.lv-skeleton__bar {
    display: block;
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #eef0f3 0%, #f6f7f9 40%, #eef0f3 80%);
    background-size: 200% 100%;
    animation: lv-skeleton-shimmer 1.4s linear infinite;
}

.lv-skeleton__bar--nav {
    width: 72%;
    height: 14px;
}

.lv-skeleton__bar--title {
    width: 180px;
    height: 22px;
}

.lv-skeleton__bar--short {
    width: 40%;
}

.lv-skeleton__bar--medium {
    width: 64%;
}

.lv-skeleton__bar--value {
    width: 28%;
    height: 26px;
}

@keyframes lv-skeleton-shimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

@keyframes lv-skeleton-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lv-skeleton-side-in {
    from { opacity: 0; transform: translateX(-24px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
    .lv-skeleton__side {
        display: none;
    }

    .lv-skeleton__main--split {
        flex-direction: column;
    }

    .lv-skeleton__panel--aside {
        flex: 0 0 auto;
    }

    .lv-skeleton__cards {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lv-skeleton,
    .lv-skeleton--leaving,
    .lv-skeleton--enter-side .lv-skeleton__side,
    .lv-skeleton__bar {
        animation: none;
        transition: none;
    }
}

/* 切换中心：logo 与中心按钮组从上一个中心的位置滑过来（ui-kit.js pageTransition），
   量位置前先隐藏，避免在最终位置闪一下再跳回去。 */
html.lv-topbar-flip-pending .admin-topbar-brand__logo-image,
html.lv-topbar-flip-pending .brand-cluster__logo-image,
html.lv-topbar-flip-pending .admin-center-switch,
html.lv-topbar-flip-pending .center-switch {
    opacity: 0 !important;
}
