/* style.css */

/* --- 全局设置 --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f6f9;
}

a { color: #0066cc; text-decoration: none; transition: color 0.2s; }
a:hover { color: #004494; text-decoration: none; }

/* --- 顶部导航栏 --- */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eaeaea;
    position: sticky;
    top: 0;
    z-index: 9999; /* ✅ 提高层级，避免手机端被内容盖住 */
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
}

nav {
    max-width: 1450px;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    height: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
}

/* 名字 (Logo) */
.nav-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: #222;
    cursor: pointer;
    width: 240px;
    flex-shrink: 0;
}

/* ✅ 手机端汉堡按钮（默认隐藏，移动端显示） */
.nav-toggle {
    display: none;
    margin-left: auto;
    border: 0;
    background: transparent;
    font-size: 22px;
    padding: 10px 12px;
    cursor: pointer;
    color: #333;
}

/* 导航链接组 */
.nav-links {
    display: flex;
    align-items: center;
    margin-left: 60px;
    gap: 15px;
}

.nav-btn {
    font-size: 1rem;
    color: #555;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-btn:hover, .nav-btn.active {
    color: #0066cc;
    background-color: #eef4fc;
}

.fa-cog { color: #999; cursor: pointer; margin-left: 20px; transition: color 0.2s; }
.fa-cog:hover { color: #555; }


/* --- 核心布局 --- */
.container {
    max-width: 1450px;
    margin: 0 auto;
    padding: 40px 40px;
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

/* --- 左侧侧边栏 (Sidebar) --- */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    text-align: left;

    position: sticky;
    top: 110px; /* Header(80) + 视觉间距(30) */

    height: fit-content;
}

.profile-img {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1/1;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 5px solid #fff;
}

.sidebar-name { font-size: 1.3rem; font-weight: 700; color: #111; margin-bottom: 5px; }
.sidebar-title { font-size: 0.95rem; color: #555; margin-bottom: 15px; line-height: 1.4; }
.sidebar-school { font-size: 0.9rem; color: #666; margin-bottom: 25px; line-height: 1.4; }

.sidebar-info { list-style: none; font-size: 0.95rem; color: #555; }
.sidebar-info li { margin-bottom: 14px; display: flex; align-items: center; }
.sidebar-info i { width: 24px; margin-right: 12px; color: #777; text-align: center; font-size: 1.1rem; }


/* --- 右侧主要内容 (Main Content) --- */
.main-content {
    flex-grow: 1;
    max-width: 100%;

    background-color: #fff;
    padding: 50px 60px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.02);
}

.main-header-name { font-size: 2.5rem; font-weight: 700; margin-bottom: 8px; color: #111; letter-spacing: -0.5px;}
.main-header-title { font-size: 1.2rem; font-weight: 600; color: #444; margin-bottom: 5px; }
.main-header-dept { font-style: italic; color: #777; margin-bottom: 35px; font-size: 1.05rem; }
.bio-text p { margin-bottom: 20px; text-align: left; color: #333; font-size: 1.05rem; line-height: 1.7; }
.section-title { font-size: 1.6rem; font-weight: 700; margin-top: 60px; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; color: #222; letter-spacing: -0.3px; }

/* 列表样式 */
.content-list li { margin-bottom: 30px; }
.list-header { font-weight: 700; color: #111; font-size: 1.1rem; margin-bottom: 6px; }
.education-header { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; font-weight: 700; color: #111; font-size: 1.1rem; margin-bottom: 6px; }
.education-school { min-width: 0; }
.education-time { color: #6b7280; font-size: 0.95rem; font-weight: 500; white-space: nowrap; }
.work-header { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; font-weight: 700; color: #111; font-size: 1.1rem; margin-bottom: 6px; }
.work-company { min-width: 0; }
.work-time { color: #6b7280; font-size: 0.95rem; font-weight: 500; white-space: nowrap; }
.list-sub { color: #666; font-style: italic; margin-bottom: 10px; font-size: 1rem;}
ul.bullet-list { list-style-type: disc; margin-left: 20px; color: #444; font-size: 1rem; line-height: 1.7; }

.interest-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: -2px 0 18px;
}

.interest-chip {
    display: inline;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #333;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.65;
}

.interest-chip:not(:last-child)::after { content: ";"; margin-right: 8px; }

#work-list { display: grid; gap: 12px; list-style: none; }
#work-list > .work-item {
    margin: 0;
    padding: 17px 18px;
    border: 1px solid #e2e8ee;
    border-radius: 12px;
    background: #fbfcfd;
}
#work-list .bullet-list li { margin-bottom: 4px; }

#honor-list, #service-list { display: block; margin-left: 20px; list-style: disc; }
#honor-list li, #service-list li { margin: 0 0 8px; padding: 0; border: 0; border-radius: 0; background: transparent; line-height: 1.7; }

/* --- Publications 专属样式 --- */
.pub-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 24px;
}

.pub-card {
    display: block;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
    cursor: pointer;
}

.pub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.06);
    border-color: #dbeafe;
}

.pub-img-wrapper {
    width: 100%;
    height: auto;
    overflow: visible;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
    background-color: #f8f9fa;
}

.pub-img-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter 0.4s ease;
}

.pub-card:hover .pub-img-wrapper img {
    filter: grayscale(0%);
}

.pub-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a8f98;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 2px dashed #d8dee6;
    background: #f8f9fa;
}

.pub-content { padding: 22px 24px; }
.pub-title { font-size: 1.3rem; font-weight: 700; color: #222; margin-bottom: 8px; line-height: 1.4; }
.pub-card:hover .pub-title { color: #0066cc; }
.pub-meta { font-size: 0.96rem; color: #666; margin-bottom: 10px; font-style: italic; line-height: 1.55; }
.pub-keywords { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; }
.keyword-tag { background-color: #f1f5f9; color: #475569; font-size: 0.82rem; padding: 3px 8px; border-radius: 4px; border: 1px solid #e2e8f0; }

.project-card {
    display: grid;
    grid-template-columns: minmax(240px, 38%) minmax(0, 1fr);
    min-height: 230px;
}

.project-card .pub-img-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 0;
}

.project-card .pub-img-wrapper img {
    max-height: 250px;
    filter: none;
}

.project-card .pub-content { align-self: center; }

.experience-compact-list {
    display: grid;
    gap: 16px;
}

.experience-compact-card {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid #dfe8f3;
    border-radius: 16px;
    padding: 18px 20px 18px 22px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,251,255,0.98) 100%);
    box-shadow: 0 10px 28px rgba(31, 41, 55, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.experience-compact-card::before {
    content: "";
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 0;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #2563eb 0%, #0f766e 100%);
}

.experience-compact-card:hover {
    border-color: #bed3ea;
    box-shadow: 0 14px 34px rgba(31, 41, 55, 0.10);
    transform: translateY(-2px);
}

.experience-row-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.experience-lab {
    font-weight: 800;
    color: #111827;
    font-size: 1.08rem;
    letter-spacing: -0.01em;
}

.experience-role {
    color: #0b5cab;
    background: #eef6ff;
    border: 1px solid #d6e8fb;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.4;
}

.experience-time {
    margin-left: auto;
    color: #5b6778;
    background: #f3f6fa;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
}

.experience-row-sub {
    margin-top: 8px;
    color: #6b7280;
    font-size: 0.92rem;
    line-height: 1.5;
}

.experience-row-sub-advisor {
    margin-top: 10px;
    color: #667085;
    font-size: 0.92rem;
    line-height: 1.5;
}

.experience-row-summary {
    margin-top: 10px;
    padding: 10px 12px;
    color: #263548;
    background: #f8fafc;
    border: 1px solid #e5edf6;
    border-left: 3px solid #7aa7d9;
    border-radius: 10px;
    font-size: 0.94rem;
    line-height: 1.55;
}

.experience-publication-list {
    margin-top: 12px;
    display: grid;
    gap: 9px;
    padding-top: 12px;
    border-top: 1px solid #e7edf4;
    color: #374151;
    font-size: 0.91rem;
    line-height: 1.55;
}

.experience-publication-row {
    position: relative;
    padding-left: 16px;
}

.experience-publication-row::before {
    content: "";
    position: absolute;
    left: 1px;
    top: 0.68em;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #7aa7d9;
}

.experience-publication-row strong {
    color: #111827;
    font-weight: 800;
}

.experience-more { margin-top: 4px; }
.experience-more summary {
    width: fit-content;
    color: #0b5cab;
    cursor: pointer;
    font-weight: 650;
    font-size: 0.9rem;
}
.experience-more-list {
    display: grid;
    gap: 9px;
    margin-top: 9px;
}

.experience-project-link {
    color: #0b5cab;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(11, 92, 171, 0.35);
    transition: color 0.2s ease, border-bottom-color 0.2s ease, background-color 0.2s ease;
}

.experience-project-link:hover {
    color: #084b8a;
    border-bottom-color: #084b8a;
    background-color: rgba(11, 92, 171, 0.06);
}

.experience-row-sub-advisor a {
    color: #0b5cab;
    font-weight: 650;
    text-decoration: none;
    border-bottom: 1px solid rgba(11, 92, 171, 0.25);
}

.experience-row-sub-advisor a:hover {
    color: #084b8a;
    border-bottom-color: #084b8a;
}

/* Research 页面 */
.project-block { margin-bottom: 50px; border: 1px solid #f0f0f0; padding: 30px; border-radius: 12px; background: #fafafa;}
.proj-title { font-size: 1.4rem; font-weight: 700; color: #222; margin-bottom: 8px; }
.proj-desc p { font-size: 1rem; }

/* Keep long-form research text readable without changing the typography. */
.detail-content p,
#p-more-details p {
    text-align: left !important;
    max-width: 860px;
}

/* Footer */
.footer-section { margin-top: 80px; padding-top: 30px; border-top: 2px solid #f5f5f5; }
.footer-note { font-style: italic; color: #666; margin-bottom: 25px; font-size: 1rem; }
.btn-download { display: inline-block; background-color: #374151; color: #fff; padding: 12px 28px; border-radius: 8px; font-weight: 500; font-size: 1rem; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.btn-download:hover { background-color: #1f2937; transform: translateY(-2px); color: #fff; }

/* ===========================
   ✅ 手机/平板适配（关键修复）
   =========================== */
@media (max-width: 1000px) {

    /* ✅ header/nav 不要固定高度，否则菜单展开会溢出压住正文 */
    header { height: auto; }
    nav {
        padding: 10px 16px;
        height: auto;
        position: relative;     /* 给 dropdown 做定位 */
        flex-wrap: nowrap;
    }

    /* 页面从左右两列改成上下 */
    .container {
        flex-direction: column;
        gap: 24px;
        padding: 18px 16px;
    }

    .sidebar {
        width: 100%;
        text-align: center;
        position: static;
        top: auto;
    }

    .profile-img { margin-left: auto; margin-right: auto; }
    .main-content { padding: 22px 18px; }
    .project-card { grid-template-columns: minmax(210px, 36%) minmax(0, 1fr); }

    /* ✅ 手机端显示汉堡按钮 */
    .nav-brand { width: auto; }
    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    /* ✅ 下拉菜单：默认隐藏；展开时作为 dropdown 出现（有白底，不透明） */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;              /* 紧贴 nav 底部 */
        left: 0;
        right: 0;

        background: rgba(255, 255, 255, 0.98);  /* ✅ 不透明白底 */
        backdrop-filter: blur(10px);

        border-bottom: 1px solid #eaeaea;
        box-shadow: 0 12px 30px rgba(0,0,0,0.08);

        margin-left: 0;
        padding: 10px 12px 14px;

        flex-direction: column;
        align-items: stretch;
        gap: 8px;

        z-index: 9999;          /* ✅ 确保盖在内容上 */
    }

    .nav-btn {
        display: block;
        padding: 10px 12px;
        border-radius: 10px;
    }

    /* ✅ 打开状态 */
    nav.nav-open .nav-links {
        display: flex;
    }
}

@media (max-width: 640px) {
    .container { gap: 14px; }
    .sidebar {
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        column-gap: 16px;
        align-items: center;
        text-align: left;
        padding: 4px 2px 8px;
    }
    .profile-img {
        width: 82px;
        margin: 0;
        border-width: 3px;
        grid-row: 1 / span 3;
    }
    .sidebar-name { font-size: 1.08rem; margin-bottom: 2px; }
    .sidebar-title { margin-bottom: 0; font-size: 0.86rem; }
    .sidebar-school { display: none; }
    .sidebar-info {
        grid-column: 1 / -1;
        display: flex;
        flex-wrap: wrap;
        gap: 5px 14px;
        margin-top: 10px;
        font-size: 0.85rem;
    }
    .sidebar-info li { margin: 0; }
    .sidebar-info li:nth-child(-n+2) { display: none; }
    .sidebar-info i { width: 17px; margin-right: 5px; font-size: 0.95rem; }
    .main-header-name { font-size: 2rem; }
    .main-content { border-radius: 12px; }
    .section-title { margin-top: 44px; }
    .pub-content { padding: 18px; }
    .pub-title { font-size: 1.18rem; }
    .project-card { display: block; min-height: 0; }
    .project-card .pub-img-wrapper { border-right: 0; border-bottom: 1px solid #f0f0f0; }
    .project-card .pub-img-wrapper img { max-height: 220px; }
    .education-header { flex-direction: column; align-items: flex-start; gap: 2px; }
    .education-time { white-space: normal; }
    .work-header { flex-direction: column; align-items: flex-start; gap: 2px; }
    .work-time { white-space: normal; }
    .interest-chip-list { display: block; }
    .interest-chip { width: auto; padding: 0; }
    #work-list > .work-item { padding: 15px 14px 14px 17px; }
    .experience-compact-card { padding: 16px 15px 16px 18px; border-radius: 14px; }
    .experience-row-top { flex-direction: column; align-items: flex-start; gap: 6px; }
    .experience-time { margin-left: 0; white-space: normal; }
    .experience-publication-list { font-size: 0.9rem; }
}
