/* 引入高端字体 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700;800&display=swap');

/* 全局明暗丝滑过渡 */
body { 
    font-family: 'Inter', system-ui, sans-serif; 
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.5s; 
}

/* ========================================================= */
/* 唯美硬朗滚动条 */
/* ========================================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
.dark ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
.dark ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ========================================================= */
/* 核心：真实 3D 物理按键反馈 (加入 !important 霸体) */
/* ========================================================= */
.btn-3d { 
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important; 
    will-change: transform, box-shadow;
    cursor: pointer;
}
.btn-3d:active { 
    transform: translateY(3px) scale(0.96) !important; 
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.2) !important; 
    filter: brightness(0.9); 
}
.dark .btn-3d:active {
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.5) !important; 
}

/* ========================================================= */
/* 核心：主数据行悬浮与磁吸特效 (极度顺滑版，加入 !important) */
/* ========================================================= */
.data-row { 
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important; 
    border-bottom: 1px solid transparent; 
    will-change: transform, box-shadow, background-color;
}
.data-row:hover { 
    transform: translateY(-3px); 
    background-color: #ffffff; 
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.08), 0 8px 16px -8px rgba(0,0,0,0.03); 
    z-index: 20; 
    position: relative; 
    border-radius: 16px;
}
.dark .data-row:hover { 
    background-color: #111827; 
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6), 0 8px 16px -8px rgba(0,0,0,0.3); 
}

/* 悬浮圆角保护 */
.data-row:hover td:first-child { border-top-left-radius: 16px; border-bottom-left-radius: 16px; }
.data-row:hover td:last-child { border-top-right-radius: 16px; border-bottom-right-radius: 16px; }

/* 展开状态的母行融合 */
.data-row.is-expanded {
    background-color: #ffffff !important;
    transform: translateY(0); 
    box-shadow: none;
    z-index: 20;
    position: relative;
}
.dark .data-row.is-expanded { background-color: #0f172a !important; }
.data-row.is-expanded td:first-child { border-top-left-radius: 16px; border-bottom-left-radius: 0 !important; }
.data-row.is-expanded td:last-child { border-top-right-radius: 16px; border-bottom-right-radius: 0 !important; }

/* ========================================================= */
/* 抽屉面板展开动画 */
/* ========================================================= */
.details-row { display: none; }
.details-row.active { 
    display: table-row; 
    animation: slideDownDrawer 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
}
.details-row td { padding: 0 !important; border: none !important; }
@keyframes slideDownDrawer { 
    from { opacity: 0; transform: translateY(-20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ========================================================= */
/* 弹窗与画廊交互动画 */
/* ========================================================= */
.modal-enter { animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.modal-panel-enter { animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* 图片悬浮平滑放大 */
.img-zoom { transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); will-change: transform; }
.group\/gall:hover .img-zoom, .group\/img:hover .img-zoom { transform: scale(1.12); }

table { border-collapse: separate; border-spacing: 0; }

/* 开启硬件加速，防止拖拽动画或列表滚动时掉帧 */
.data-row { 
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important; 
    border-bottom: 1px solid transparent; 
    will-change: transform, box-shadow, background-color;
    transform: translateZ(0); /* 强制开启 GPU 加速 */
}

/* 修复 Hover 时 Z-index 可能遮挡表头的问题 */
/* 确保表头的 z-index (如 30) 大于此处的 20 */
.data-row:hover { 
    transform: translateY(-3px) translateZ(0); 
    background-color: #ffffff; 
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.08), 0 8px 16px -8px rgba(0,0,0,0.03); 
    z-index: 20; 
    position: relative; 
    border-radius: 16px;
}

/* 优化动画性能：将 filter 分离，避免每次点击重绘整块阴影 */
.btn-3d { 
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
                filter 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important; 
    will-change: transform, filter;
    cursor: pointer;
    transform: translateZ(0);
}