/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #333; line-height: 1.7; background: #fff;
    display: flex; flex-direction: column; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ===== Variables ===== */
:root {
    --primary: #1a3a5c;
    --primary-light: #2a6496;
    --accent: #3b82f6;
    --bg-alt: #f7f9fc;
    --card-border: #e8edf3;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --nav-h: 64px;
}

/* ===== Container ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 0 28px; }

/* ===== Navbar ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--nav-h);
    background: rgba(255,255,255,0.97); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    transition: box-shadow 0.3s;
}
.navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.08); }
.navbar .container {
    display: flex; align-items: center; justify-content: space-between; height: 100%;
}
.nav-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.2rem; font-weight: 700; color: var(--primary);
}
.nav-brand img { height: 38px; }
.nav-menu { display: flex; gap: 4px; }
.nav-menu a {
    padding: 8px 16px; border-radius: 6px; font-size: 0.92rem; font-weight: 500;
    color: var(--text-light); transition: all 0.2s; position: relative;
}
.nav-menu a:hover { color: var(--primary); background: #eef3fa; }
.nav-menu a.active { color: var(--primary); font-weight: 600; }
.nav-menu a.active::after {
    content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
    width: 18px; height: 2.5px; background: var(--accent); border-radius: 2px;
}
.menu-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--primary); }

/* ===== Page Header (sub-pages) ===== */
.page-header {
    padding-top: calc(var(--nav-h) + 48px);
    padding-bottom: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff; text-align: center;
}
.page-header h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 8px; }
.page-header p { font-size: 1rem; opacity: 0.75; }

/* ===== Section ===== */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
    font-size: 1.8rem; font-weight: 700; color: var(--primary);
    margin-bottom: 12px;
}
.section-subtitle { color: var(--text-muted); margin-bottom: 36px; font-size: 0.95rem; }
.section-divider {
    width: 40px; height: 3px; background: var(--accent); border-radius: 2px;
    margin-bottom: 36px;
}

/* ===== Hero Gallery ===== */
.hero-gallery {
    position: relative; width: 100%; height: 70vh; min-height: 480px;
    overflow: hidden;
}
.hero-gallery .slides {
    display: flex; width: 100%; height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-gallery .slide {
    min-width: 100%; height: 100%; position: relative;
    background-size: cover; background-position: center;
}
.hero-gallery .slide::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(13,33,55,0.75) 0%, rgba(13,33,55,0.2) 50%, transparent 100%);
}
.slide-content {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
    padding: 60px 0 48px; color: #fff;
}
.slide-content h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 8px; letter-spacing: 1px; }
.slide-content .subtitle { font-size: 1.2rem; opacity: 0.85; margin-bottom: 6px; }
.slide-content .uni { font-size: 1rem; opacity: 0.65; }
/* Placeholder slides */
.slide-placeholder {
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: rgba(255,255,255,0.5);
    height: 100%; width: 100%;
}
.slide-placeholder.bg1 { background: linear-gradient(135deg, #0d2137, #1a3a5c, #2a6496); }
.slide-placeholder.bg2 { background: linear-gradient(135deg, #1a3a5c, #2a6496, #3b82f6); }
.slide-placeholder.bg3 { background: linear-gradient(135deg, #0f2b45, #1a3a5c, #4a90d9); }

/* Slide dots */
.slide-dots {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    z-index: 3; display: flex; gap: 8px;
}
.slide-dots .dot {
    width: 10px; height: 10px; border-radius: 50%; cursor: pointer;
    background: rgba(255,255,255,0.4); transition: all 0.3s;
}
.slide-dots .dot.active { background: #fff; transform: scale(1.2); }
.slide-dots .dot:hover { background: rgba(255,255,255,0.7); }

/* Gallery nav dots */
.gallery-dots {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    z-index: 10; display: flex; gap: 8px;
}
.gallery-dots .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255,255,255,0.4); cursor: pointer;
    transition: all 0.3s; border: none;
}
.gallery-dots .dot.active { background: #fff; transform: scale(1.2); }
/* Gallery arrows */
.gallery-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    background: rgba(255,255,255,0.15); border: none; color: #fff;
    width: 48px; height: 48px; border-radius: 50%; font-size: 1.3rem;
    cursor: pointer; transition: background 0.2s; backdrop-filter: blur(4px);
}
.gallery-arrow:hover { background: rgba(255,255,255,0.3); }
.gallery-arrow.prev { left: 20px; }
.gallery-arrow.next { right: 20px; }

/* ===== Home Highlights ===== */
/* Research Directions Grid */
.highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.research-grid { grid-template-columns: repeat(2, 1fr); }
.highlight-card {
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06); border: 1px solid var(--card-border);
    transition: transform 0.25s, box-shadow 0.25s;
}
.highlight-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,0.1); }
.highlight-card img {
    width: 100%; height: 200px; object-fit: contain; object-position: center;
    background: var(--bg-alt);
}
.highlight-card .card-body { padding: 20px; }
.highlight-card h3 { font-size: 1.05rem; color: var(--primary); margin-bottom: 6px; }
.highlight-card p { font-size: 0.88rem; color: var(--text-light); line-height: 1.5; }
.highlight-card .tag {
    display: inline-block; font-size: 0.75rem; color: var(--accent);
    background: #eff6ff; padding: 2px 10px; border-radius: 10px; margin-top: 10px;
}
.highlight-placeholder {
    height: 200px; background: linear-gradient(135deg, #e8edf3, #f0f4f8);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.9rem;
}

/* ===== News List ===== */
.news-list { max-width: 800px; }
.news-item {
    display: flex; gap: 20px; padding: 20px 0;
    border-bottom: 1px solid var(--card-border);
    transition: background 0.2s;
}
.news-item:hover { background: rgba(0,0,0,0.01); }
.news-date {
    flex-shrink: 0; width: 64px; text-align: center;
    padding-top: 4px;
}
.news-date .day { display: block; font-size: 1.6rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.news-date .month { display: block; font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; }
.news-body h3 { font-size: 1rem; color: var(--primary); margin-bottom: 4px; }
.news-body p { font-size: 0.88rem; color: var(--text-light); }

/* ===== Quick Links (Home) ===== */
.quick-links {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.quick-link {
    display: flex; flex-direction: column; align-items: center;
    padding: 28px 16px; background: #fff; border-radius: 12px;
    border: 1px solid var(--card-border);
    transition: all 0.25s; text-align: center;
}
.quick-link:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(59,130,246,0.1); }
.quick-link .ql-icon { font-size: 2rem; margin-bottom: 10px; }
.quick-link h3 { font-size: 0.95rem; color: var(--primary); margin-bottom: 4px; }
.quick-link p { font-size: 0.8rem; color: var(--text-muted); }

/* ===== Team Tabs ===== */
.team-tabs { display: flex; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.team-tab {
    padding: 10px 24px; border-radius: 8px; border: 2px solid var(--card-border);
    background: #fff; font-size: 0.95rem; color: var(--text-light);
    cursor: pointer; transition: all 0.2s; font-weight: 500;
}
.team-tab:hover { border-color: var(--primary-light); color: var(--primary); }
.team-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.team-panel { display: none; }
.team-panel.active { display: block; }

/* Teacher cards */
.faculty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.faculty-card {
    display: flex; gap: 18px; padding: 24px;
    background: #fff; border-radius: 12px; border: 1px solid var(--card-border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}
.faculty-card[onclick] { cursor: pointer; }
.faculty-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.avatar {
    width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 700;
}
.avatar.sm { width: 40px; height: 40px; font-size: 0.9rem; }
.faculty-info h3 { font-size: 1.05rem; color: var(--primary); }
.faculty-info .role { font-size: 0.82rem; color: var(--primary-light); margin: 2px 0 8px; }
.faculty-info p { font-size: 0.82rem; color: var(--text-light); line-height: 1.5; }

/* Student cards */
.student-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.student-card {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: #fff; border-radius: 10px; border: 1px solid var(--card-border);
    transition: all 0.2s;
}
.student-card:hover { border-color: var(--primary-light); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.student-card h4 { font-size: 0.9rem; color: var(--primary); }
.student-card p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.3; }
.student-card a { font-size: 0.72rem; color: var(--accent); text-decoration: underline; }


/* ===== Publications ===== */
.pub-tabs { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.pub-tab {
    padding: 8px 20px; border-radius: 20px; border: 1px solid var(--card-border);
    background: #fff; font-size: 0.88rem; cursor: pointer;
    color: var(--text-light); transition: all 0.2s;
}
.pub-tab:hover { border-color: var(--primary-light); }
.pub-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pub-panel { display: none; }
.pub-panel.active { display: block; }

.pub-scholar-box {
    text-align: center; padding: 40px; margin-bottom: 40px;
    background: #eff6ff; border-radius: 12px; border: 1px solid #d0e4f7;
}
.pub-scholar-box p { margin: 6px 0; color: var(--text-light); }
.pub-scholar-box a { color: var(--primary-light); font-weight: 600; text-decoration: underline; }

/* ===== Paper Tags ===== */
.paper-list { margin-top: 8px; }
.paper-item {
    padding: 10px 0; border-bottom: 1px solid #f3f5f8;
    font-size: 0.88rem; color: var(--text); line-height: 1.6;
}
.paper-item strong { color: var(--primary); }
.paper-item em { color: #d4880f; font-style: normal; font-size: 0.82rem; }
.paper-tag {
    display: inline-block; font-size: 0.72rem; font-weight: 600;
    padding: 2px 8px; border-radius: 4px; margin-right: 6px;
    vertical-align: middle; letter-spacing: 0.3px;
}
.paper-tag.cvpr { background: #dc2626; color: #fff; }
.paper-tag.iccv { background: #ea580c; color: #fff; }
.paper-tag.eccv { background: #d97706; color: #fff; }
.paper-tag.aaai { background: #7c3aed; color: #fff; }
.paper-tag.neurips { background: #2563eb; color: #fff; }
.paper-tag.icml { background: #e11d48; color: #fff; }
.paper-tag.mm { background: #0891b2; color: #fff; }
.paper-tag.journal { background: #059669; color: #fff; }
.paper-tag.conf { background: #6b7280; color: #fff; }

/* Scholar link */
.scholar-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px;
    background: #eff6ff; border-radius: 4px; text-decoration: none;
    transition: background 0.2s; vertical-align: middle; padding: 2px;
}
.scholar-link:hover { background: #dbeafe; }
.scholar-link svg { width: 14px; height: 14px; fill: var(--accent); }

/* Student & Faculty photo */
.faculty-photo {
    width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
    flex-shrink: 0; border: 2px solid var(--card-border);
}
.student-photo {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
    flex-shrink: 0; border: 1px solid var(--card-border);
}

/* ===== Patents ===== */
.patent-stats {
    display: flex; justify-content: center; gap: 32px; margin-bottom: 28px; flex-wrap: wrap;
}
.stat-card {
    text-align: center; background: #fff; border-radius: 12px;
    padding: 28px 44px; box-shadow: 0 2px 16px rgba(0,0,0,0.05);
    border: 1px solid var(--card-border); min-width: 160px;
}
.stat-number { display: block; font-size: 2.5rem; font-weight: 800; color: var(--primary-light); }
.stat-label { display: block; font-size: 0.88rem; color: var(--text-muted); margin-top: 2px; }
.patent-list { margin-top: 24px; }
.patent-category {
    font-size: 1.1rem; color: var(--primary); margin: 28px 0 12px;
    padding-left: 12px; border-left: 3px solid var(--accent);
}
.patent-items { list-style: none; padding-left: 12px; }
.patent-items li {
    padding: 10px 0; border-bottom: 1px solid #f3f5f8;
    font-size: 0.88rem; color: var(--text); line-height: 1.55;
}
.patent-items li strong { color: var(--primary); }
.patent-items li em { color: #d4880f; font-style: normal; font-size: 0.8rem; }

/* ===== Contact ===== */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.contact-card {
    background: #fff; border-radius: 12px; padding: 32px; text-align: center;
    border: 1px solid var(--card-border);
}
.contact-icon { font-size: 2.2rem; margin-bottom: 14px; }
.contact-card h3 { font-size: 1.05rem; color: var(--primary); margin-bottom: 8px; }
.contact-card p { font-size: 0.9rem; color: var(--text-light); }
.contact-card a { color: var(--primary-light); text-decoration: underline; }

/* ===== Footer ===== */
.footer {
    margin-top: auto; background: var(--primary); color: rgba(255,255,255,0.55);
    padding: 28px; text-align: center; font-size: 0.85rem;
}
.footer a { color: rgba(255,255,255,0.75); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .highlights { grid-template-columns: 1fr; }
    .quick-links { grid-template-columns: repeat(2, 1fr); }
    .research-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .nav-menu {
        display: none; flex-direction: column; position: absolute;
        top: var(--nav-h); left: 0; right: 0; background: #fff;
        padding: 12px 24px; border-bottom: 1px solid #eee;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    }
    .nav-menu.open { display: flex; }
    .menu-toggle { display: block; }
    .hero-gallery { height: 55vh; min-height: 380px; }
    .slide-content h1 { font-size: 1.8rem; }
    .faculty-grid { grid-template-columns: 1fr; }
    .student-grid { grid-template-columns: 1fr 1fr; }
    .highlights { grid-template-columns: 1fr; }
    .quick-links { grid-template-columns: repeat(2, 1fr); }
    .research-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .student-grid { grid-template-columns: 1fr; }
    .quick-links { grid-template-columns: 1fr; }
    .slide-content h1 { font-size: 1.5rem; }
}