/* =========================================================
 * apple-animations.css —— 苹果风统一过渡动画
 * 作用域：前后端共用（所有页面都会引入）
 * 设计要点：
 *   - 过渡时长偏短（0.15s ~ 0.35s），苹果味节奏：快入慢出
 *   - 贝塞尔用 cubic-bezier(.22,.61,.36,1) 或 .4s cubic-bezier(.4,0,.2,1)
 *   - 不修改业务动画类（animated / animate__*），只做通用 appear 过渡
 * =======================================================*/

/* ----------- 通用：所有可交互元素加上基础过渡 ----------- */
a,
button,
.btn,
.badge,
input,
select,
textarea,
.form-control,
.nav-link,
.dropdown-item,
.block,
.card,
.table tbody tr,
.pagination li > a,
.pagination li > span,
#sidebar .nav-main-link,
.sidebar-main .nav-item a,
.navbar .nav-link,
.lyear-layout-sidebar .nav-item a,
.item-rounded,
.captcha-img,
.nav-main-submenu,
.nav-subnav {
    transition: transform 300ms cubic-bezier(.22, .61, .36, 1),
                box-shadow 300ms cubic-bezier(.22, .61, .36, 1),
                background-color 260ms ease,
                color 220ms ease,
                border-color 220ms ease,
                opacity 220ms ease,
                filter 260ms ease;
}

/* ----------- 入场动画：所有被 OneUI / Lyear 标记 invisible 的元素 ----------- */
@keyframes apple-fade-up {
    0%   { opacity: 0; transform: translate3d(0, 22px, 0) scale(.985); }
    60%  { opacity: 1; }
    100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes apple-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes apple-pop {
    0%   { opacity: 0; transform: scale(.94); }
    60%  { opacity: 1; transform: scale(1.015); }
    100% { opacity: 1; transform: scale(1); }
}

/* 覆盖 animate.css 提供的 fadeIn 等基础动画，让味道更像苹果 */
.animated.fadeIn,
.animate__animated.animate__fadeIn {
    animation-name: apple-fade-in !important;
    animation-duration: .45s !important;
    animation-timing-function: cubic-bezier(.22, .61, .36, 1) !important;
}
.animated.fadeInDown,
.animate__animated.animate__fadeInDown {
    animation-name: apple-fade-up !important;   /* 苹果习惯从下往上/渐显 */
    animation-duration: .65s !important;
    animation-timing-function: cubic-bezier(.22, .61, .36, 1) !important;
}
.animated.fadeInUp,
.animate__animated.animate__fadeInUp {
    animation-name: apple-fade-up !important;
    animation-duration: .6s !important;
    animation-timing-function: cubic-bezier(.22, .61, .36, 1) !important;
}
.animated.zoomIn,
.animate__animated.animate__zoomIn {
    animation-name: apple-pop !important;
    animation-duration: .5s !important;
}

/* OneUI 的 [data-toggle="appear"] 走 animation 类，给它兜底：没命中动画类时也给一个 appear */
[data-toggle="appear"] {
    will-change: transform, opacity;
}

/* ----------- 通用 hover/active 按压回弹 ----------- */
button:active,
.btn:active,
.badge:active,
.pagination li > a:active,
.nav-main-link:active,
.captcha-img:active {
    transform: scale(.975) !important;
}
a:hover {
    text-decoration: none;
}

/* ----------- 下拉菜单/子菜单出现动画（用 max-height + opacity 模拟抽屉） ----------- */
.dropdown-menu,
.nav-main-submenu,
.nav-subnav {
    transform-origin: top center;
    animation: apple-pop .28s cubic-bezier(.22, .61, .36, 1) both;
}
.dropdown-menu {
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* ----------- 滚动条美化（macOS 感） ----------- */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
*::-webkit-scrollbar-thumb {
    background: rgba(144, 147, 153, .35);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, .55);
    background-clip: padding-box;
    border: 2px solid transparent;
}
*::-webkit-scrollbar-track {
    background: transparent;
}

/* ----------- 选择文本配色 ----------- */
::selection {
    background: rgba(0, 122, 255, .22);
    color: inherit;
}
