/* === 1. Global Variables & Reset === */
:root {
    --bg-color: #ffffff;       
    --text-primary: #1d1d1f;   
    --text-secondary: #515151; 
    --accent-blue: #0071e3;    
    --accent-purple: #af52de;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.08); 
    --shadow-hover: 0 15px 30px rgba(0,0,0,0.12); 
    --gradient-primary: linear-gradient(90deg, #0071e3 0%, #af52de 100%);
}

html { scroll-behavior: smooth; scroll-padding-top: 100px; overflow-x: hidden; }
body { background-color: var(--bg-color); color: var(--text-primary); font-family: 'Inter', sans-serif; line-height: 1.6; margin: 0; padding: 0; }
img, video { max-width: 100%; height: auto; display: block; } /* Responsive media */


/* === 2. Navigation (Academic Minimal) === */
.nav-pill {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    padding: 0;
    pointer-events: auto;
    transition: background 0.3s ease, border-color 0.3s ease;
    background: rgba(8, 8, 10, 0.28);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-pill.scrolled {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1160px;
    margin: 0 auto;
    height: 64px;
    padding: 0 20px;
    box-sizing: border-box;
}

.logo {
    font-family: 'Work Sans', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: #f8fafc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-pill.scrolled .logo {
    color: #111827;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    text-decoration: none;
    color: rgba(248, 250, 252, 0.88);
    font-weight: 500;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #ffffff;
}

.nav-pill.scrolled .nav-links a {
    color: #4b5563;
}

.nav-pill.scrolled .nav-links a:hover {
    color: #111827;
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-link {
    text-decoration: none;
    color: rgba(248, 250, 252, 0.88);
    font-size: 1rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.icon-link:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.nav-pill.scrolled .icon-link {
    color: #4b5563;
}

.nav-pill.scrolled .icon-link:hover {
    color: #111827;
}

@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-inner { height: 58px; }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

.wechat-hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    padding-top: 40px;
    padding-bottom: 180px;
    overflow: hidden;

    background: #000;
    background: 
        radial-gradient(circle at 50% 0%, rgba(167, 139, 250, 0.3) 0%, rgba(139, 92, 246, 0.15) 35%, rgba(0, 0, 0, 0) 70%),
        linear-gradient(180deg, #050505 0%, #000000 100%);
}

.hero-curve {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 5;
    fill: var(--bg-color); /* Match body background */
}
.hero-curve svg {
    width: 100%;
    height: 80px;
    display: block;
}
.hero-curve svg path {
    fill: var(--bg-color);
}

.wechat-hero-content {
    max-width: 1750px;
    width: 100%;
    padding: 0 40px;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px; /* Consistent spacing */
}

/* Typography Refinements */
.hero-title.white-text {
    font-family: 'Work Sans', sans-serif;
    font-weight: 700; 
    font-style: italic; 
    font-size: 8rem; 
    line-height: 1.1; /* Increased from 0.9 to fix vertical cut */
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: #fff; 
    background: linear-gradient(180deg, #FFFFFF 20%, rgba(255, 255, 255, 0.4) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0px;
    padding: 0 10px; /* Added horizontal padding to fix italic cut */
}

.hero-subtitle-group.white-text {
    margin-top: -10px;
}
.hero-subtitle-group.white-text .sub-line-1 {
    color: #F5F5F7; margin: 0; font-size: 2.4rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2;
}
.hero-subtitle-group.white-text .sub-line-2 {
    color: #86868B; margin: 8px 0 0 0; font-size: 2rem; font-weight: 400; letter-spacing: -0.01em; 
}

.authors.white-text-authors {
    margin-top: 10px; font-size: 1.15rem; color: #fff; line-height: 1.6; font-weight: 400;
}
.authors.white-text-authors a { color: #fff; text-decoration: none; transition: opacity 0.2s; }
.authors.white-text-authors a:hover { opacity: 0.8; text-decoration: underline; }

.affiliations.white-text-affil {
    color: rgba(255, 255, 255, 0.85); font-style: normal; font-size: 1rem; margin-top: 5px; margin-bottom: 10px; font-weight: 400;
}

/* Abstract: Apple Product Description Style */
.hero-abstract {
    max-width: 1100px;
    margin: 10px auto 20px auto;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    text-align: justify;
}
.hero-abstract-label {
    display: none; /* Cleaner without label in this context */
}
.hero-abstract-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #cecece;
    text-align: justify;
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: -0.015em;
    text-align-last: left;
}
.hero-abstract-text .method-highlight-light {
    font-weight: 600;
    color: #F5F5F7;
    font-style: normal;
}

/* Actions: Pill Buttons (Glass Pill) */
.wechat-actions {
    display: flex; gap: 14px;
    margin-top: 10px;
}
.pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 44px;
    padding: 0 20px;
    background: linear-gradient(90deg, rgba(41,151,255,0.12), rgba(191,90,242,0.10));
    border-radius: 999px; /* Fully rounded */
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 20px rgba(41,151,255,0.06);
}
.pill-btn i { margin-right: 6px; font-size: 1rem; opacity: 0.95; }
.pill-btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(90deg, rgba(41,151,255,0.18), rgba(191,90,242,0.14));
    box-shadow: 0 12px 30px rgba(41,151,255,0.12);
}
.pill-btn.secondary {
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.95);
    border: 1px solid rgba(255,255,255,0.06);
}
.pill-btn.secondary:hover {
    background: rgba(255,255,255,0.06);
}

.standard-container { max-width: 900px; margin: 0 auto; padding: 0 20px 40px 20px; }
.wide-container { max-width: 1200px; width: 95%; margin: 0 auto; padding: 0 20px; }

.transparent-section {
    background-color: transparent;
    width: 100%;
    margin-bottom: 60px;
    padding: 20px 0;
    border: none;
}

.gray-full-width-bg {
    background-color: transparent; 
    width: 100vw;
    position: relative;
    left: 50%; right: 50%;
    margin-left: -50vw; margin-right: -50vw;
    padding: 20px 0; 
    margin-top: 30px; 
    margin-bottom: 40px; 
}

/* Typography */
.section { margin-bottom: 60px; }
.section h2 { font-family: 'Google Sans', sans-serif; font-size: 2rem; text-align: center; margin-bottom: 15px; color: var(--text-primary); }

/* Abstract Section */
.abstract-section {
    margin-bottom: 70px;
    padding-bottom: 20px;
}
.abstract-content {
    max-width: 850px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.7);
    padding: 40px 50px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}
.abstract-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gradient-primary);
    opacity: 0.5;
}
.abstract-text {
    font-size: 1.08rem;
    line-height: 1.85;
    color: var(--text-secondary);
    text-align: justify;
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: -0.01em;
}
.method-highlight {
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
}

.text-block { font-size: 1.1rem; text-align: justify; background: #f5f5f7; padding: 30px; border-radius: 12px; box-shadow: var(--shadow-soft); line-height: 1.6; border: 1px solid rgba(0,0,0,0.05); }
.section-title-left { font-family: 'Google Sans', sans-serif; font-size: 2rem; text-align: left; margin-bottom: 15px; color: var(--text-primary); }
.section-title-center { font-family: 'Google Sans', sans-serif; font-size: 2rem; text-align: center; margin-bottom: 15px; color: var(--text-primary); }
.section-desc { font-size: 1.05rem; color: var(--text-secondary); text-align: justify; margin-bottom: 10px; line-height: 1.5; }
.section-desc-centered { font-size: 1.05rem; color: var(--text-secondary); text-align: center; max-width: 800px; margin: 0 auto 30px auto; line-height: 1.5; }

/* Video & Efficiency */
.dual-video-grid-wide {
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 0;
}
.video-wrapper { 
    display: flex; flex-direction: column; 
    background: transparent;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
}
.video-caption { 
    font-size: 0.95rem; 
    color: var(--text-secondary); 
    margin-top: 15px; 
    margin-bottom: 0; 
    text-align: left; 
    border-left: 2px solid transparent; 
    padding-left: 10px;
    transition: all 0.3s ease;
}
.video-wrapper:hover .video-caption {
    border-left-color: var(--accent-purple);
    color: var(--text-primary);
}

.chart-container {
    width: 100%; max-width: 800px; margin: 40px auto 0 auto; text-align: center;
    background: transparent;
    box-shadow: none;
    padding: 0;
}
.responsive-img-chart { width: 100%; height: auto; display: block; border-radius: 8px; }
.chart-caption { margin-top: 15px; font-size: 0.95rem; color: var(--text-secondary); font-style: italic; }

/* Method */
.image-container { 
    border-radius: 16px; 
    overflow: hidden; 
    border: none; 
    background: transparent; 
    transition: transform 0.3s ease;
    max-width: 100%;
    margin: 0 auto 30px auto;
    box-shadow: none;
}
.image-container:hover { transform: scale(1.02); }
.responsive-img { width: 100%; height: auto; display: block; }

.method-phases-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px; 
    margin-top: 10px;
}

.phase-card {
    background: transparent;
    padding: 24px; 
    border-radius: 12px;
    border: 1px solid transparent;
    box-shadow: none;
    transition: all 0.3s ease;
    position: relative;
    text-align: left; 
    border-left: 3px solid rgba(0,0,0,0.1); 
}

.phase-card:hover {
    transform: translateX(5px);
    background: #f5f5f7;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.05);
    border-left-color: var(--accent-purple);
}

.phase-header {
    display: flex;
    flex-direction: row; 
    align-items: baseline; 
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 8px;
    padding-bottom: 0;
    border-bottom: none;
}

.phase-number {
    font-family: 'Google Sans', sans-serif;
    font-weight: 700;
    font-size: 1.2rem; 
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 1;
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
}

.phase-number.purple-black {
    background: linear-gradient(135deg, #bc10bc 0%, #bba3c0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.phase-card h3 { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.phase-card p { margin: 0; font-size: 0.95rem; color: var(--text-secondary); line-height: 1.6; text-align: left; max-width: 100%; margin: 0; }

@media (max-width: 768px) {
    .method-phases-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* Carousel */
.carousel-container { position: relative; width: 100%; max-width: 1300px; margin: 0 auto; height: 350px; display: flex; justify-content: center; align-items: center; }
.carousel-track { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; perspective: 1000px; }
.card-3d { position: absolute; width: 420px; aspect-ratio: 16/9; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.15); transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); cursor: pointer; opacity: 1; border: 1px solid rgba(0,0,0,0.05); }
.card-3d video { width: 100%; height: 100%; object-fit: cover; }
.card-3d.pos-0 { transform: translateX(0) scale(1.3); z-index: 10; }
.card-3d.pos-1 { transform: translateX(60%) scale(0.9); z-index: 5; }
.card-3d.pos-n1 { transform: translateX(-60%) scale(0.9); z-index: 5; }
.card-3d.pos-2 { transform: translateX(110%) scale(0.7); z-index: 2; }
.card-3d.pos-n2 { transform: translateX(-110%) scale(0.7); z-index: 2; }
.card-3d.pos-left-hidden { transform: translateX(-150%) scale(0.5); opacity: 0; visibility: hidden; pointer-events: none; }
.card-3d.pos-right-hidden { transform: translateX(150%) scale(0.5); opacity: 0; visibility: hidden; pointer-events: none; }

.carousel-dots { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 30px; height: 20px; }
.dot { background: #d1d5db; border-radius: 50%; cursor: pointer; transition: all 0.3s ease; }
.dot-center { width: 14px; height: 14px; background: #6b7280; }
.dot-near { width: 10px; height: 10px; }
.dot-mid { width: 8px; height: 8px; }
.dot-far { width: 6px; height: 6px; }

.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.9); border: none; width: 50px; height: 50px; border-radius: 50%; font-size: 1.2rem; color: #333; cursor: pointer; z-index: 20; box-shadow: 0 5px 15px rgba(0,0,0,0.1); transition: all 0.2s ease; }
.nav-btn:hover { background: #fff; transform: translateY(-50%) scale(1.1); }
.prev-btn { left: 10px; } .next-btn { right: 10px; }

/* Video Overlay */
.video-custom-container { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
#overview .video-custom-container { cursor: pointer; }
.main-video { width: 100%; height: 100%; object-fit: cover; display: block; }

.play-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.1); display: flex; justify-content: center; align-items: center; transition: all 0.4s ease; backdrop-filter: blur(2px); }
.play-btn-circle { width: 90px; height: 90px; background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 50%; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 0 20px rgba(255,255,255,0.1), 0 10px 30px rgba(0,0,0,0.2); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.play-btn-circle i { color: #fff; font-size: 2.2rem; margin-left: 6px; opacity: 0.95; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
#overview .video-custom-container:hover .play-btn-circle { transform: scale(1.15); background: rgba(255, 255, 255, 0.25); border-color: rgba(255, 255, 255, 0.8); box-shadow: 0 0 30px rgba(255, 255, 255, 0.3), 0 20px 40px rgba(0,0,0,0.3); }
#overview .video-custom-container:hover .play-overlay { background: rgba(0, 0, 0, 0); backdrop-filter: blur(0px); }

/* Results */
.results-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 20px 0; }
.result-card { background: transparent; padding: 15px; border-radius: 12px; box-shadow: none; text-align: center; border: 1px solid transparent; transition: all 0.3s ease; }
.result-card:hover { transform: translateY(-5px); background: #f5f5f7; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border-color: rgba(0,0,0,0.05); }
.result-value { font-family: 'Google Sans', sans-serif; font-size: 2.8rem; font-weight: 700; margin-bottom: 5px; line-height: 1.2; }
.result-label { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.result-sub { font-size: 0.85rem; color: var(--text-secondary); opacity: 0.8; }
.green { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
} 
.blue { 
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
} 
.orange { 
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
} 
.purple { 
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* BibTeX */
.bibtex-hint {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.bibtex-wrapper {
    position: relative;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 28px 28px 24px;
    overflow-x: auto;
    border: 1px solid #e8e8ec;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bibtex-wrapper:hover {
    border-color: #d0d0d6;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.bibtex-code {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.75;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-all;
    -webkit-font-smoothing: antialiased;
}

.bibtex-code code {
    font-family: inherit;
}

.bibtex-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: #6b7280;
    background: #ffffff;
    border: 1px solid #e0e0e4;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.bibtex-copy-btn:hover {
    color: #111827;
    background: #ffffff;
    border-color: #c0c0c8;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.bibtex-copy-btn.copied {
    color: #059669;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

/* Legacy fallback */
.code-block { background: #f5f5f7; color: #374151; padding: 24px; border-radius: 8px; font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.85rem; overflow-x: auto; text-align: left; border: 1px solid rgba(0,0,0,0.05); box-shadow: none; }
.code-block::selection { background: var(--accent-blue); color: #fff; }

@media (max-width: 768px) {
    /* Stack layout vertically */
    .dual-video-grid-wide { grid-template-columns: 1fr; gap: 30px; }
    .results-grid { grid-template-columns: 1fr; gap: 20px; } /* Changed to 1 column stack */
    .method-phases-grid { grid-template-columns: 1fr; gap: 30px; }
    
    /* Carousel Adjustments */
    .carousel-container { height: 220px; }
    .card-3d { width: 80%; max-width: 300px; aspect-ratio: 16/9; } /* Relative units */

    /* Typography & Spacing */
    .hero-title.white-text { font-size: clamp(2.4rem, 10vw, 3.5rem); }
    .sub-line-1 { font-size: 1.2rem; }
    .sub-line-2 { font-size: 1rem; }
    
    /* Navigation */
    .nav-pill { top: 0; }
    .nav-inner { height: 56px; padding: 0 14px; }
    .logo { font-size: 0.95rem; }
    .nav-icons { gap: 12px; }
    
    /* Hero Layout */
    .wechat-hero { padding-top: 100px; padding-bottom: 60px; min-height: auto; }
    .wechat-actions { flex-direction: column; gap: 15px; width: 100%; align-items: center; }
    .pill-btn { width: 80%; max-width: 280px; }

    /* Hide/Refine Elements */
    .hero-abstract { display: none; } 
    
    /* Container Padding */
    .wide-container, .standard-container { padding-left: 15px; padding-right: 15px; width: 100%; box-sizing: border-box; }
}

/* === 5. Hero Animations (Fixed for Speed & Grouping) === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title.white-text,
.hero-subtitle-group.white-text,
.authors.white-text-authors,
.affiliations.white-text-affil,
.wechat-actions {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; 
}

.hero-title.white-text,
.hero-subtitle-group.white-text {
    animation-delay: 0s;
}

.authors.white-text-authors,
.affiliations.white-text-affil {
    animation-delay: 0.15s;
}

.wechat-actions {
    animation-delay: 0.3s;
}