/* =========================================
   EAG3R Project Page Stylesheet
   Based on Nerfies template, adapted for Dark Mode
   ========================================= */

:root {
    --bg-color: #1a1a1a;
    --card-bg: #242424;
    --text-color: #f5f5f5;
    --text-muted: #a0a0a0;
    --neurips-purple: #7843e6;
    --neurips-purple-hover: #9b6dff;
    --signal-green: #00cc66;
    --font-main: 'Google Sans', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a { color: var(--neurips-purple-hover); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--signal-green); }

.container { max-width: 960px; margin: 0 auto; padding: 2rem 1rem; }

/* =========================================
   HERO & HEADERS
   ========================================= */
.hero-section { text-align: center; padding: 3rem 0; }
.title { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; background: linear-gradient(120deg, #fff, #ccc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.badge { display: inline-block; background-color: var(--neurips-purple); color: white; padding: 0.25rem 0.8rem; border-radius: 50px; font-weight: bold; font-size: 0.9rem; margin-bottom: 1.5rem; box-shadow: 0 0 15px rgba(120, 67, 230, 0.4); }
.authors { font-size: 1.1rem; margin-bottom: 0.5rem; }
.author-block { display: inline-block; margin: 0 5px; }
.affiliations { font-size: 0.95rem; color: var(--text-muted); }
.equal-contribution { font-size: 0.8rem; color: var(--text-muted); font-style: italic; margin-top: 5px; margin-bottom: 2rem; }

/* =========================================
   BUTTONS
   ========================================= */
.links { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; padding: 0.6rem 1.2rem; border-radius: 50px; font-weight: 600; color: white !important; text-decoration: none; transition: transform 0.2s, box-shadow 0.2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.btn-purple { background-color: var(--neurips-purple); }
.btn-dark { background-color: #333; }
.btn .icon { margin-right: 8px; }

/* =========================================
   SECTIONS & CONTENT BLOCKS
   ========================================= */
.section { margin-bottom: 4rem; }
.section-title { text-align: center; font-size: 2rem; margin-bottom: 1.5rem; border-bottom: 1px solid #333; padding-bottom: 0.5rem; color: var(--text-color); }
.content-block { background-color: var(--card-bg); padding: 2rem; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
.abstract-text { margin-top: 1.5rem; }

/* =========================================
   IMAGES & FIGURES STYLES
   ========================================= */
.content-image {
    display: block;
    margin: 2rem auto 1rem auto;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    background-color: #fff; 
    padding: 4px;
}
.full-width { width: 100%; }
.half-width { max-width: 600px; }

.caption-below {
    text-align: center; 
    font-size: 0.95rem; 
    color: var(--text-muted);
    margin-bottom: 2rem; 
    max-width: 800px; 
    margin-left: auto; 
    margin-right: auto;
}

.vis-comparison-container { 
    overflow-x: auto; 
    margin-bottom: 1rem;
    text-align: center; 
}
.vis-comparison-container img { min-width: 800px; } 

/* =========================================
   TEASER SLIDERS (Dual Grid Layout)
   === 核心修复区域：彻底解决黑边 ===
   ========================================= */
.teaser-container { 
    width: 100%; 
    max-width: 960px; 
    margin: 0 auto; 
}

.teaser-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 电脑端强制双列并排 */
    gap: 20px;
    margin-bottom: 1rem;
    align-items: start;
}

.video-compare-wrapper h3 {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

/* 滑块容器：关键修复 */
.video-compare-container { 
    position: relative; 
    width: 100%; 
    height: auto !important; /* 强制高度自适应，不设固定值 */
    padding-bottom: 0 !important; /* 强制清除任何比例占位 padding */
    overflow: hidden; 
    border-radius: 12px; 
    cursor: col-resize; 
    box-shadow: 0 0 20px rgba(0, 204, 102, 0.1); 
    border: 1px solid #333; 
    background: #000;
    line-height: 0; /* 消除图片底部的微小空隙 */
}

/* 背景图（右图）：作为唯一的基准，撑开容器高度 */
img.video-after {
    position: relative !important; /* 改为相对定位 */
    display: block;
    width: 100%;
    height: auto !important; /* 高度由图片自身决定 */
    margin: 0;
    padding: 0;
    /* 移除 object-fit，因为 width:100% height:auto 已经足够 */
}

/* 裁切区域：绝对定位，覆盖在背景图上 */
.video-clipper { 
    position: absolute; 
    top: 0; 
    left: 0; 
    height: 100%; /* 高度跟随容器（也就是背景图的高度） */
    width: 50%; 
    overflow: hidden; 
    z-index: 2; 
    border-right: 2px solid var(--signal-green); 
}

/* 前景图（左图）：在裁切区域内显示，必须与背景图完美重合 */
.video-clipper img.video-before { 
    position: absolute;
    top: 0;
    left: 0;
    height: 100%; /* 高度匹配 */
    width: auto;  /* 宽度自动，保持比例 */
    max-width: none; /* 允许超出裁切区边界 */
    /* 关键：确保这一张图的渲染尺寸与背景图完全一致 */
}

.slider-handle { position: absolute; left: 50%; top: 0; bottom: 0; width: 40px; transform: translateX(-50%); z-index: 3; display: flex; justify-content: center; align-items: center; pointer-events: none; }
.handle-circle { width: 40px; height: 40px; background-color: var(--signal-green); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #000; box-shadow: 0 0 10px rgba(0,0,0,0.5); }
.label { position: absolute; bottom: 10px; background: rgba(0, 0, 0, 0.7); color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; z-index: 4; pointer-events: none; }
.label-before { left: 10px; } .label-after { right: 10px; }

/* =========================================
   GRID & OTHER COMPONENTS
   ========================================= */
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.method-item h3 { color: var(--signal-green); margin-top: 0; font-size: 1.2rem; }
.highlight-box { background: rgba(120, 67, 230, 0.1); border: 1px solid var(--neurips-purple); color: #fff; padding: 1rem; border-radius: 8px; text-align: center; margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }
pre { background-color: #000; padding: 1.5rem; border-radius: 8px; overflow-x: auto; font-size: 0.9rem; border: 1px solid #333; color: #dcdcdc; }
.footer { text-align: center; padding: 2rem 0; font-size: 0.9rem; color: var(--text-muted); }

/* Responsive adjustments */
@media (max-width: 768px) { 
    .title { font-size: 1.8rem; } 
    .method-grid { grid-template-columns: 1fr; } 
}

/* 仅在非常窄的屏幕下堆叠滑块 */
@media (max-width: 650px) {
    .teaser-grid { grid-template-columns: 1fr; gap: 2rem; }
}