/* ========== ZEUS CHAIN EXPLORER - 丝滑优化样式 ========== */

/* 全局平滑滚动 */
html {
    scroll-behavior: smooth;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 页面加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.page-loader.hide {
    opacity: 0;
    pointer-events: none;
}

.loader-logo {
    font-size: 4rem;
    margin-bottom: 2rem;
    animation: logoFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
}

.loader-text {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    animation: textPulse 1.5s ease-in-out infinite;
}

.loader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ffd700);
    border-radius: 2px;
    animation: progressLoad 2s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes progressLoad {
    0% {
        width: 0;
        margin-left: 0;
    }
    50% {
        width: 100%;
        margin-left: 0;
    }
    100% {
        width: 0;
        margin-left: 100%;
    }
}

/* 骨架屏加载动画 */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(99, 102, 241, 0.05) 0%,
        rgba(139, 92, 246, 0.15) 50%,
        rgba(99, 102, 241, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeletonLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    height: 150px;
    margin-bottom: 1rem;
}

.skeleton-line {
    height: 20px;
    margin-bottom: 10px;
}

.skeleton-line:last-child {
    width: 60%;
}

/* 淡入动画增强 */
.fade-in {
    animation: smoothFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes smoothFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滑入动画 */
.slide-in-left {
    animation: slideInLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 缩放动画 */
.scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 统计卡片增强动画 */
.stat-card-enhanced {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.stat-card-enhanced:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 12px 40px rgba(99, 102, 241, 0.4),
        0 0 0 1px rgba(99, 102, 241, 0.5);
}

/* 数字动画 */
.stat-value-enhanced {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-value-enhanced.updating {
    color: #ffd700;
    transform: scale(1.1);
}

/* Tab 切换优化 */
.explorer-tab {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.explorer-tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #6366f1;
    transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.explorer-tab.active::before {
    width: 100%;
}

.explorer-tab::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.explorer-tab:active::after {
    width: 300px;
    height: 300px;
}

/* Tab 内容切换动画 */
.tab-content {
    animation: tabFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 区块/交易卡片动画 */
.block-item,
.tx-item,
.token-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.block-item:hover,
.tx-item:hover,
.token-item:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.3);
}

.block-item:active,
.tx-item:active,
.token-item:active {
    transform: translateY(-2px) scale(0.99);
}

/* 搜索框增强 */
.search-bar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-bar:focus-within {
    transform: scale(1.02);
    box-shadow:
        0 8px 24px rgba(99, 102, 241, 0.3),
        0 0 0 2px rgba(99, 102, 241, 0.5);
}

#searchInput {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#searchInput:focus {
    background: rgba(99, 102, 241, 0.05);
}

/* 按钮波纹效果 */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

.search-btn,
.action-btn,
.copy-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-btn::before,
.action-btn::before,
.copy-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.search-btn:active::before,
.action-btn:active::before,
.copy-btn:active::before {
    width: 200px;
    height: 200px;
}

/* 搜索结果卡片动画 */
.search-result-card {
    animation: resultSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes resultSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 信息行动画 */
.info-row {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-row:hover {
    background: rgba(99, 102, 241, 0.08);
    transform: translateX(4px);
}

/* 复制按钮反馈 */
.copy-btn.copied {
    background: rgba(16, 185, 129, 0.3) !important;
    transform: scale(1.1);
}

.copy-btn.copied::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #10b981;
    font-weight: bold;
    animation: checkFadeOut 1s;
}

@keyframes checkFadeOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -80%) scale(1.5);
    }
}

/* 加载状态动画 */
.loading {
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 数字滚动效果 */
.counter-animate {
    display: inline-block;
    animation: counterRoll 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes counterRoll {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 微光效果 */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmerMove 2s infinite;
}

@keyframes shimmerMove {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 渐进式加载 */
.progressive-load {
    opacity: 0;
    animation: progressiveAppear 0.6s forwards;
}

.progressive-load:nth-child(1) { animation-delay: 0.1s; }
.progressive-load:nth-child(2) { animation-delay: 0.2s; }
.progressive-load:nth-child(3) { animation-delay: 0.3s; }
.progressive-load:nth-child(4) { animation-delay: 0.4s; }
.progressive-load:nth-child(5) { animation-delay: 0.5s; }
.progressive-load:nth-child(6) { animation-delay: 0.6s; }
.progressive-load:nth-child(7) { animation-delay: 0.7s; }
.progressive-load:nth-child(8) { animation-delay: 0.8s; }
.progressive-load:nth-child(9) { animation-delay: 0.9s; }
.progressive-load:nth-child(10) { animation-delay: 1.0s; }

@keyframes progressiveAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 悬停发光效果 */
.glow-on-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-on-hover:hover {
    box-shadow:
        0 0 20px rgba(99, 102, 241, 0.4),
        0 0 40px rgba(139, 92, 246, 0.2),
        0 0 60px rgba(167, 139, 250, 0.1);
}

/* 脉冲高亮 */
.pulse-highlight {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
    }
}

/* 平滑滚动条 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(99, 102, 241, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 5px;
    transition: all 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

/* 网格布局动画 */
.stats-grid > * {
    animation: gridItemFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.stats-grid > *:nth-child(1) { animation-delay: 0.1s; }
.stats-grid > *:nth-child(2) { animation-delay: 0.2s; }
.stats-grid > *:nth-child(3) { animation-delay: 0.3s; }
.stats-grid > *:nth-child(4) { animation-delay: 0.4s; }

@keyframes gridItemFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 性能优化 */
.block-item,
.tx-item,
.token-item,
.stat-card-enhanced {
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 减少动画复杂度（节能模式） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 触摸反馈 */
@media (hover: none) and (pointer: coarse) {
    .block-item:active,
    .tx-item:active,
    .token-item:active {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

/* 加载进度条 */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ffd700);
    z-index: 9999;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.6, 1);
}

.loading-bar.active {
    animation: loadingBarProgress 2s ease-in-out;
}

@keyframes loadingBarProgress {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* 交互状态反馈 */
.clickable {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.clickable:hover {
    transform: translateY(-2px);
}

.clickable:active {
    transform: translateY(0);
}
