/* ================= 1. VARIABLES & THEME ================= */
:root {
    /* 核心配色 */
    --primary-color: #2563eb; /* 科技蓝 */
    --primary-hover: #1d4ed8;
    --text-main: #1e293b;     /* 深蓝灰 */
    --text-sub: #64748b;
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    /* 阴影系统 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* 字体 */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Lato', sans-serif;
}

[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-hover: #93c5fd;
    --text-main: #f1f5f9;
    --text-sub: #94a3b8;
    --bg-body: #0f172a;       /* 深空蓝 */
    --bg-card: #1e293b;
    --border-color: #334155;
}

/* ================= 2. RESET & BASE ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ================= 3. LAYOUT ================= */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px;
}

.section { margin-bottom: 60px; }

.section-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
}

.icon-prefix { margin-right: 10px; color: var(--primary-color); }

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* ================= 4. HERO SECTION ================= */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 60px;
}

.hero-content { flex: 1; }

.name {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-main);
}

.cn-name { font-weight: 400; font-size: 1.8rem; color: var(--text-sub); }

.bio { font-size: 1.1rem; margin-bottom: 8px; }
.bio a { color: var(--primary-color); font-weight: 600; border-bottom: 1px dashed transparent; }
.bio a:hover { border-bottom-color: var(--primary-color); }

.social-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 15px; }

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-sub);
    box-shadow: var(--shadow-sm);
}

.social-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sb-small { padding: 4px 12px; font-size: 0.85rem; }

.hero-avatar-wrapper { width: 200px; height: 200px; flex-shrink: 0; }

.avatar {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 3px solid var(--bg-card);
}

/* ================= 5. NEWS COMPONENT ================= */
/* Note: 滚动功能已移交 .scrollable 处理 */
.news-list { list-style: none; padding: 0; margin: 0; }

.news-list li {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    align-items: baseline;
}

.news-date {
    flex-shrink: 0;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
    width: 90px;
}

.news-content { color: var(--text-main); }

/* ================= 6. PAPER CARD COMPONENT ================= */
.paper-card {
    display: flex;
    gap: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.paper-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.paper-img-wrapper {
    flex: 0 0 35%;
    min-width: 200px;
}

.paper-img-wrapper img {
    width: 100%; height: 100%;
    min-height: 140px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.paper-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.paper-title { 
    font-family: var(--font-heading); 
    font-size: 1.15rem; 
    margin-bottom: 6px; 
    line-height: 1.4; 
    color: var(--text-main); 
}

.paper-authors { font-size: 0.95rem; color: var(--text-sub); margin-bottom: 4px; }
.paper-venue { font-weight: 700; color: var(--primary-color); font-size: 0.9rem; margin-bottom: 10px; }
.paper-desc { font-size: 0.9rem; color: var(--text-main); margin-bottom: 12px; line-height: 1.5; }

/* Tags */
.tags-row { display: flex; gap: 8px; margin-top: auto; }

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    color: #fff;
    background: #334155;
}

.tag:hover { opacity: 0.9; }
.tag-pdf { background-color: #ef4444; }
.tag-code { background-color: #0f172a; }
[data-theme="dark"] .tag-code { background-color: #334155; }
.tag-bib { background-color: #0ea5e9; }
.tag-page { background-color: #10b981; }

/* ================= 7. LIST COMPONENTS (Experience/Honors) ================= */
.list-wrapper { display: flex; flex-direction: column; gap: 20px; }
.list-item { display: flex; gap: 16px; align-items: flex-start; }

.list-logo { 
    width: 48px; height: 48px; 
    object-fit: contain; 
    border-radius: 6px; 
    background: #fff; 
    padding: 2px; 
    border: 1px solid var(--border-color); 
}

.list-content { flex: 1; }
.list-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.list-org { font-weight: 700; font-family: var(--font-heading); }
.list-date { font-size: 0.85rem; color: var(--text-sub); }
.list-role { font-weight: 600; font-size: 0.95rem; color: var(--text-main); }

/* Bilingual Row Style */
.bilingual-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.bilingual-row:last-child {
    border-bottom: none; margin-bottom: 0; padding-bottom: 0;
}

.content-wrapper { flex: 1; margin-right: 20px; }

.title-en {
    font-weight: 600; color: var(--text-main);
    font-size: 0.95rem; line-height: 1.3; margin-bottom: 2px;
}

.title-cn { font-size: 0.85rem; color: var(--text-sub); line-height: 1.4; }

.date-right {
    flex-shrink: 0;
    font-family: var(--font-heading);
    font-size: 0.9rem; color: var(--text-sub);
    text-align: right;
    font-feature-settings: "tnum";
    padding-top: 2px;
}

/* ================= 8. UNIFIED SCROLL SYSTEM (Utility) ================= */
.scrollable {
    overflow-y: auto;
    padding-right: 10px;
    scroll-behavior: smooth;
    padding-bottom: 5px; 
}

/* Custom Scrollbar */
.scrollable::-webkit-scrollbar { width: 5px; }
.scrollable::-webkit-scrollbar-track { background: transparent; }
.scrollable::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.scrollable::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="dark"] .scrollable::-webkit-scrollbar-thumb { background: #475569; }

/* Height Variants */
.h-news { max-height: 180px; }   /* ~5 items text */
.h-list { max-height: 320px; }   /* ~5 items detailed list */
.h-papers { max-height: 850px; } /* ~3-4 cards */

/* ================= 9. FOOTER & TOGGLE ================= */
footer {
    text-align: center; font-size: 0.9rem; color: var(--text-sub);
    padding-top: 40px; border-top: 1px solid var(--border-color); margin-top: 40px;
}

.theme-toggle-wrapper { position: fixed; top: 20px; right: 20px; z-index: 100; }

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
}

/* ================= 10. MOBILE RESPONSIVE ================= */
@media (max-width: 768px) {
    .container { padding: 40px 20px; }
    
    .hero-section { flex-direction: column-reverse; text-align: center; }
    .social-row { justify-content: center; }
    
    .paper-card { flex-direction: column; gap: 15px; }
    .paper-img-wrapper { flex: auto; width: 100%; }
    .paper-img-wrapper img { height: 200px; }
    
    .grid-2-col { grid-template-columns: 1fr; gap: 0; }
}