/* =========================================================
 * apple-effects.css —— 企业级克制的微交互层
 * 配合 apple-effects.js
 * 设计：去掉所有"玩具感"特效（粒子/霓虹/遮罩/呼吸光/流光/彩色滚动条）
 *       只保留专业、克制、一致的微交互
 * =======================================================*/

/* ============ 基础过渡：所有可交互元素统一节奏 ============ */
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,
.item-rounded {
    transition: background-color 180ms cubic-bezier(0.4, 0, 0.2, 1),
                border-color 180ms cubic-bezier(0.4, 0, 0.2, 1),
                color 180ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 180ms cubic-bezier(0.4, 0, 0.2, 1),
                transform 180ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ 1. 滚动渐显（克制：位移小、时长适中） ============ */
.apple-reveal {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    transition: opacity 500ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.apple-reveal.apple-reveal-in {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}
.apple-reveal:nth-child(2)  { transition-delay: 60ms; }
.apple-reveal:nth-child(3)  { transition-delay: 120ms; }
.apple-reveal:nth-child(4)  { transition-delay: 180ms; }
.apple-reveal:nth-child(5)  { transition-delay: 240ms; }
.apple-reveal:nth-child(6)  { transition-delay: 300ms; }

/* ============ 2. 按钮波纹（克制，单色低透明） ============ */
.apple-ripple {
    position: relative;
    overflow: hidden;
}
.apple-ripple .apple-ripple-dot {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255, 255, 255, 0.4);
    animation: apple-ripple-go 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}
.btn-light.apple-ripple .apple-ripple-dot,
.btn-default.apple-ripple .apple-ripple-dot,
.pagination > li.apple-ripple .apple-ripple-dot {
    background: rgba(17, 24, 39, 0.08);
}
@keyframes apple-ripple-go {
    to { transform: scale(2.4); opacity: 0; }
}

/* ============ 3. focus 可见性（键盘导航友好） ============ */
.btn:focus-visible,
a:focus-visible,
.nav-main-link:focus-visible,
.dropdown-item:focus-visible {
    outline: 2px solid var(--primary, #2C5CF6);
    outline-offset: 2px;
}

/* ============ 4. 骨架屏（加载占位） ============ */
.apple-skeleton {
    background: linear-gradient(100deg,
        #EEF1F4 30%,
        #F7F8FA 50%,
        #EEF1F4 70%);
    background-size: 200% 100%;
    animation: apple-skel 1.5s ease-in-out infinite;
    border-radius: 6px;
    color: transparent !important;
}
@keyframes apple-skel {
    to { background-position: -200% 0; }
}

/* ============ 5. 滚动条（克制灰色，不彩色） ============ */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
*::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
    background-clip: padding-box;
    border: 2px solid transparent;
}
*::-webkit-scrollbar-track {
    background: transparent;
}

/* ============ 6. 选中文本 ============ */
::selection {
    background: rgba(44, 92, 246, 0.18);
    color: inherit;
}

/* ============ 7. 平滑滚动 ============ */
html {
    scroll-behavior: smooth;
}

/* ============ 8. 数字滚动（tabular-nums 防抖动） ============ */
.apple-countup {
    font-variant-numeric: tabular-nums;
}

/* ============ 9. 表格行加载淡入（克制） ============ */
.apple-table-stripe tbody tr {
    animation: apple-row-in 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.apple-table-stripe tbody tr:nth-child(1) { animation-delay: 30ms; }
.apple-table-stripe tbody tr:nth-child(2) { animation-delay: 60ms; }
.apple-table-stripe tbody tr:nth-child(3) { animation-delay: 90ms; }
.apple-table-stripe tbody tr:nth-child(4) { animation-delay: 120ms; }
.apple-table-stripe tbody tr:nth-child(5) { animation-delay: 150ms; }
.apple-table-stripe tbody tr:nth-child(n+6) { animation-delay: 180ms; }
@keyframes apple-row-in {
    from { opacity: 0; transform: translate3d(0, 8px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* ============ 10. 链接 hover 下划线（专业） ============ */
.apple-link-underline {
    position: relative;
}
.apple-link-underline::after {
    content: "";
    position: absolute;
    left: 0; bottom: -2px;
    width: 0; height: 1px;
    background: currentColor;
    transition: width 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.apple-link-underline:hover::after { width: 100%; }

/* ============ 11. 尊重 prefers-reduced-motion ============ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .apple-reveal { opacity: 1 !important; transform: none !important; }
}
