/* TYILRN - 视觉特效 CSS 补充
 * 包含：弹性入场、抖动、缩放弹入、悬浮浮动、横向滑动
 */

@keyframes scaleInBounce {
    0% { opacity: 0; transform: scale(0.5); }
    60% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.3) rotate(-15deg); }
    60% { opacity: 1; transform: scale(1.1) rotate(5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes slideInLeft {
    0% { opacity: 0; transform: translateX(-50px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(50px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

@keyframes animate-scale-in {
    0% { opacity: 0; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1); }
}

.animate-scale-in {
    animation: animate-scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.30s; }

/* 浮动元素使用 GPU 加速 */
.dash-floaty, .login-floaty {
    will-change: transform;
}

/* 统计卡片悬停过渡 */
.stat-card {
    will-change: transform;
}

/* 数字滚动元素 */
.count-up {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* 磁铁按钮 */
.magnet-btn {
    will-change: transform;
}

/* 3D 倾斜卡片 */
.tilt-card {
    will-change: transform;
    transform-style: preserve-3d;
}

/* ===== Surface 3D 按压 + 光影效果 ===== */
.surface-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.surface-3d .surface-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(
        circle 260px at var(--mx, 50%) var(--my, 50%),
        rgba(255, 215, 0, 0.55) 0%,
        rgba(255, 200, 50, 0.25) 35%,
        rgba(255, 180, 0, 0.08) 55%,
        transparent 75%
    );
    opacity: 0;
    transition: opacity 0.2s ease;
    mix-blend-mode: screen;
}

.surface-3d:hover .surface-shine {
    opacity: 1;
}

/* 按下时自由下潜 — 角度更大、深度更深 */
.surface-3d.is-pressed {
    transform: perspective(600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(-22px) scale(0.94) !important;
    box-shadow: inset 0 6px 24px rgba(0,0,0,0.2), 0 2px 6px rgba(0,0,0,0.1) !important;
}

/* 列表项专用 */
.surface-3d.surface-row {
    transition: transform 0.1s ease-out, background 0.2s ease;
}
.surface-3d.surface-row.is-pressed {
    transform: perspective(600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(-14px) scale(0.96) !important;
}

/* ===== liquid-glass 专属：边缘高光 + 3D 按压 ===== */
.liquid-glass,
.liquid-glass-dark,
.liquid-glass-strong {
    transform-style: preserve-3d;
    -webkit-tap-highlight-color: transparent;
}

.lg-edge {
    position: absolute;
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.15s ease;
    opacity: 0;
}

.lg-edge-top {
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.75), transparent);
    opacity: var(--lg-top, 0);
}
.lg-edge-right {
    top: 0; right: 0; bottom: 0; width: 2px;
    background: linear-gradient(180deg, transparent, rgba(255,215,0,0.75), transparent);
    opacity: var(--lg-right, 0);
}
.lg-edge-bottom {
    bottom: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.75), transparent);
    opacity: var(--lg-bottom, 0);
}
.lg-edge-left {
    top: 0; left: 0; bottom: 0; width: 2px;
    background: linear-gradient(180deg, transparent, rgba(255,215,0,0.75), transparent);
    opacity: var(--lg-left, 0);
}

.is-pressed-lg {
    transform: perspective(600px) rotateX(var(--lg-rx, 0deg)) rotateY(var(--lg-ry, 0deg)) translateZ(-20px) scale(0.95) !important;
    box-shadow: inset 0 5px 22px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.1) !important;
    transition: transform 0.08s ease-out;
}

/* 移动端：去掉 hover 光影，保留按压 */
@media (hover: none) {
    .surface-3d .surface-shine {
        display: none;
    }
}
