/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* 让布局计算更简单 */
}

:root {
    --text-color: #333;
    --heading-color: #003373; /* UCSB Navy-ish */
    --link-color: #0051a0;
    --link-hover: #003373;
    --date-color: #666;
    --bg-color: #ffffff;
}

body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-color);
    font-size: 16px;
}

/* 核心容器 */
#main {
    max-width: 900px; /* 限制最大宽度，阅读体验更好 */
    width: 92%;       /* 移动端保留边距 */
    margin: 0 auto;
    padding-bottom: 60px;
}

a {
    text-decoration: none;
    color: var(--link-color);
    transition: color 0.2s;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* 标题样式 */
h1, h2, h3 {
    color: var(--heading-color);
    font-weight: 500;
}

h1 { font-size: 2.2em; margin-bottom: 0.5em; }
h2 { font-size: 1.6em; margin-bottom: 10px; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-top: 10px;}

p { margin-bottom: 1em; }

/* 导航栏 */
#navbar {
    padding: 20px 0;
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    text-align: right;
}

.nav-links a {
    margin-left: 20px;
    color: #555;
    font-weight: 500;
    font-size: 0.95em;
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--link-color);
}

.cv-link {
    border: 1px solid var(--link-color);
    padding: 5px 10px;
    border-radius: 4px;
    color: var(--link-color) !important;
}

.cv-link:hover {
    background: var(--link-color);
    color: #fff !important;
    text-decoration: none !important;
}

/* Profile Section - 使用 Flexbox */
.profile-container {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 10px;
}

.profile-pic {
    display: flex;
    flex-direction: column; /* 垂直排列 */
    align-items: center;    /* 水平居中 */
}

/* .profile-pic img {
    width: 220px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
} */

.profile-pic img {
    width: 220px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    /* 移除可能存在的 margin-bottom，用 social-links 的 margin-top 来控制间距 */
    margin-bottom: 0; 
}

.profile-intro {
    flex: 1;
}

#profile-name {
    margin-top: 0;
    margin-bottom: 5px;
}

#profile-email {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 15px;
}

.social-links {
    margin-top: 15px;    /* 图标和照片之间的距离 */
    margin-bottom: 0;    /* 不需要底部距离了 */
    display: flex;
    gap: 20px;           /* 图标之间的间距 */
    justify-content: center; /* 确保图标整体居中 */
}

.social-links a {
    font-size: 2.5em;    /* 图标大小 */
    color: #000000;         /* 深灰色，比纯黑柔和 */
    transition: all 0.2s ease;
}

.social-links a:hover {
    color: var(--link-color);
    transform: translateY(-2px); /* 悬停上浮效果 */
}

/* News Section */
.news-list {
    list-style: none;
}
.news-list li {
    margin-bottom: 10px;
}
.news-list .date {
    font-family: monospace;
    font-weight: bold;
    color: var(--heading-color);
    margin-right: 10px;
}

/* Education */
.edu-list {
    list-style: none;
}
.edu-list li {
    margin-bottom: 10px;
}
.edu-header {
    display: flex;
    justify-content: space-between;
}
.edu-date {
    color: var(--date-color);
    font-size: 0.9em;
}

/* Skills & Experience */
ul {
    padding-left: 20px;
}
ul li {
    margin-bottom: 8px;
}

/* Projects Cards (Research & Projects) - 核心修改 */
/* .project-card {
    display: flex;
    gap: 25px;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
} */
/* 修改原有的 .project-card */
.project-card {
    display: flex;
    gap: 25px;
    margin-bottom: 10px; /*稍微加大间距*/
    padding: 15px;       /* 增加内边距，为了让悬停背景不贴边 */
    border-radius: 8px;  /* 圆角 */
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease; /* 增加平滑过渡 */
    background: transparent;   /* 默认背景透明 */
}

/* 新增：悬停效果 */
.project-card:hover {
    background: #fff; /* 确保背景是白的 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); /* 柔和的阴影 */
    transform: translateY(-3px); /* 微微上浮 */
    border-bottom-color: transparent; /* 悬停时隐藏底部分割线，用阴影代替 */
}


.project-card:last-child {
    border-bottom: none;
}

.project-img {
    flex-shrink: 0;
    width: 180px;
}

.project-img img, .project-img video {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #eee;
}

.project-content {
    flex: 1;
}

.project-title {
    font-size: 1.15em;
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    color: var(--heading-color);
}

.authors {
    font-size: 0.95em;
    color: #444;
    margin-bottom: 4px;
}

.venue {
    font-style: italic;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.project-desc {
    font-size: 0.95em;
    color: #333;
    margin-bottom: 10px;
}

/* .project-links a {
    font-size: 0.9em;
    margin-right: 10px;
    font-weight: 500;
} */

.project-links {
    margin-top: 8px;
}

.project-links a {
    display: inline-block;
    font-size: 0.85em;
    margin-right: 8px;
    padding: 3px 10px;
    border-radius: 12px; /* 胶囊形状 */
    background-color: #f2f2f2;
    color: #555;
    text-decoration: none; /* 去掉下划线 */
    border: 1px solid #ddd;
    transition: all 0.2s;
}

/* 悬停变色 */
.project-links a:hover {
    background-color: var(--link-color);
    color: #fff;
    border-color: var(--link-color);
    text-decoration: none;
}

/* Divider */
.divider {
    height: 1px;
    background-color: #eee;
    margin: 40px 0;
    border: none;
}

/* Footer */
#footer {
    font-size: 0.9em;
    color: #888;
    padding-top: 20px;
    border-top: 1px solid #eee;
    overflow: hidden; /* Clear floats */
}

/* 移动端适配 (Responsive) */
@media screen and (max-width: 768px) {
    /* 导航栏居中 */
    #navbar { text-align: center; }
    .nav-links a { margin: 0 8px; display: inline-block; margin-bottom: 10px; }
    
    /* Profile 垂直排列 */
    .profile-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .profile-pic img {
        width: 180px;
    }
    
    /* Projects 图片在上，文字在下 */
    .project-card {
        flex-direction: column;
        gap: 15px;
    }
    
    .project-img {
        width: 100%;
        max-width: 300px; /* 限制图片最大宽度 */
    }

    .edu-header {
        flex-direction: column;
    }
}


/* --- Updates / Now Page Styles --- */

/* 导航栏高亮 */
.active-link {
    color: var(--heading-color) !important;
    font-weight: bold !important;
    text-decoration: underline;
}

/* 状态卡片 */
.status-card {
    background: #f9f9f9;
    padding: 20px;
    border-left: 4px solid var(--heading-color);
    border-radius: 4px;
    margin-bottom: 30px;
}

/* 书单网格布局 */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); /* 自适应两列或一列 */
    gap: 30px;
    margin-top: 20px;
}

.book-card {
    display: flex;
    gap: 15px;
    background: #fff;
}

.book-cover {
    flex-shrink: 0;
    width: 100px;
}

.book-cover img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.book-info {
    flex: 1;
}

.book-title {
    font-weight: 600;
    color: var(--heading-color);
    line-height: 1.3;
    margin-bottom: 4px;
}

.book-author {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.book-rating {
    color: #f1c40f; /* 星星颜色 */
    font-size: 0.8em;
    margin-bottom: 8px;
}

.book-comment {
    font-size: 0.9em;
    color: #444;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .book-grid {
        grid-template-columns: 1fr; /* 手机上强制单列 */
    }
}


/* --- Potential Ideas Section Styles --- */

.ideas-grid {
    display: grid;
    /* 自动适应宽度，每张卡片至少 280px 宽 */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.idea-card {
    background: #fff;
    /* 核心设计：虚线边框，暗示“草稿/想法” */
    border: 2px dashed #ccc; 
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

/* 鼠标悬停时变实线或变色，增加交互感 */
.idea-card:hover {
    border-color: var(--link-color);
    background: #fdfdfd;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.idea-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.85em;
}

/* 标签样式 */
.idea-tag {
    background: #eee;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    color: #555;
}

/* 不同类型的标签颜色 (可选) */
.tag-hardware { background: #e3f2fd; color: #1565c0; } /* 浅蓝 */
.tag-software { background: #e8f5e9; color: #2e7d32; } /* 浅绿 */
.tag-misc { background: #fff3e0; color: #ef6c00; }     /* 浅橙 */

.idea-status {
    color: #999;
    font-style: italic;
}

.idea-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--heading-color);
    margin-bottom: 8px;
    /* 覆盖可能的全局 h3 margin */
    margin-top: 0; 
}

.idea-desc {
    font-size: 0.95em;
    color: #444;
    line-height: 1.5;
    margin-bottom: 0;
    flex: 1; /* 让文字部分自动填充高度 */
}

/* 让 Education 里的学校链接平时保持深色，悬停时才变色 */
.edu-header b a {
    color: var(--heading-color); /* 平时是标题色（深蓝/黑） */
    text-decoration: none;       /* 平时没有下划线 */
}

.edu-header b a:hover {
    color: var(--link-color);    /* 鼠标放上去变回亮蓝色 */
    text-decoration: underline;  /* 鼠标放上去显示下划线 */
}

/* --- 个人介绍段落间距 --- */
.profile-intro p {
    /* 段落之间的距离 */
    margin-bottom: 10px;  /* 默认通常是 1em (约16px)，改成 25px 会显得更宽松 */
    
    /* 行间距 (文字太密读起来累，可以微调这个) */
    line-height: 1.5;     /* 默认是 1.6，改成 1.8 会更易读 */
}

/* 最后一个段落不需要下边距 (可选，为了完美主义) */
.profile-intro p:last-child {
    margin-bottom: 0;
}