/* style.css */

/* ============ Reset ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #ffffff;
  color: #222;
  line-height: 1.55;
}

a { color: #0b63c6; text-decoration: none; }
a:hover { text-decoration: underline; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

/* ============ Topbar ============ */
.topbar{
  position: sticky;
  top: 0;
  z-index: 999;
  background: #fff;
  border-bottom: 1px solid #ececec;
}

.topbar-inner{
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand{
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
}
.brand-name{
  font-weight: 800;
  letter-spacing: 0.6px;
  line-height: 1.05;
  font-size: 14px;
}
.brand-sub{
  font-size: 12px;
  color: #666;
}

.nav{
  display: flex;
  gap: 18px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nav a{
  font-size: 13px;
  color: #444;
  padding: 6px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.nav a:hover{
  background: #f5f7fb;
  text-decoration: none;
  color: #0b63c6;
}

/* ============ Layout ============ */
.page{
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

/* Sidebar */
.sidebar{
  width: 280px;
  position: sticky;
  top: 78px; /* below topbar */
  align-self: flex-start;
}

.profile-card{
  border: 1px solid #ececec;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.04);
  background: #fff;
}

.avatar{
  width: 100%;
  height: auto;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #f0f0f0;
}

.name{
  margin-top: 12px;
  font-size: 22px;
  font-weight: 800;
}
.title{
  margin-top: 4px;
  font-size: 13px;
  color: #666;
}

.tagline{
  margin-top: 12px;
  font-size: 13px;
  color: #555;
}

.meta{
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.meta-row{
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: #444;
}
.meta-ico{
  width: 18px;
  text-align: center;
  opacity: 0.85;
}

.sidebar-links{
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pill{
  display: inline-block;
  background: #0b63c6;
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.pill:hover{
  text-decoration: none;
  background: #094f9d;
}

.icon-links{
  display: flex;
  gap: 10px;
  align-items: center;
}
.icon-links a{
  width: 34px;
  height: 34px;
  border: 1px solid #ececec;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #444;
  background: #fff;
}
.icon-links a:hover{
  background: #f5f7fb;
  text-decoration: none;
  color: #0b63c6;
}

/* Main */
.main{
  flex: 1;
  min-width: 0;
}

/* Sections */
.section{
  padding: 8px 0 22px 0;
  scroll-margin-top: 90px;
}
.section h2{
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
}
.section p{
  color: #333;
  font-size: 14px;
}

/* Simple lists */
.clean-list{
  list-style: none;
  display: grid;
  gap: 8px;
  margin-top: 6px;
}
.date{
  font-weight: 800;
  color: #666;
  margin-right: 8px;
}

/* Buttons */
.btn{
  display: inline-block;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0b63c6;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.btn:hover{
  text-decoration: none;
  background: #094f9d;
}

/* Education */
.edu{
  display: grid;
  gap: 12px;
  margin-top: 8px;
}
.edu-item{
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
}
.edu-item img{
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}
.edu-top{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.edu-date{
  font-size: 12px;
  color: #777;
}
.edu-desc{
  font-size: 13px;
  color: #444;
  margin-top: 2px;
}

/* Highlighted Projects */
.proj-grid{
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.proj{
  border: 1px solid #ececec;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 22px rgba(0,0,0,0.04);
}
.proj img{
  width: 100%;
  height: 180px;          /* 你觉得还是大/挤，就改成 150 或 140 */
  object-fit: contain;    /* 关键：不裁切，完整显示 */
  background: #fff;       /* 比 #fafafa 更干净 */
  border-bottom: 1px solid #f0f0f0;
  padding: 10px;          /* 留白让不同比例的图也好看 */
  display: block;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}
.proj-body{
  padding: 12px 14px;
}
.proj-title{
  font-weight: 900;
  font-size: 15px;
}
.proj-meta{
  margin-top: 4px;
  font-size: 12.5px;
  color: #666;
}
.proj-links{
  margin-top: 8px;
  font-size: 13px;
  color: #444;
}
.dot{ margin: 0 6px; color: #999; }

/* Publications */
.pub-group{ margin-top: 12px; }
.pub-h3{
  margin-top: 12px;
  font-size: 15px;
  font-weight: 900;
  color: #333;
}
.pub-list{
  list-style: none;
  margin-top: 8px;
  display: grid;
  gap: 10px;
}
.pub-item{
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.pub-title{
  font-size: 13.5px;
  color: #222;
  font-weight: 700;
}
.pub-venue{
  font-weight: 500;
  color: #666;
}
.pub-links{
  margin-top: 6px;
  font-size: 13px;
}

/* Presentations (横向滑动保留) */
.presentation-list{
  list-style: none;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 10px 0;
  -webkit-overflow-scrolling: touch;
}
.presentation-item{
  flex: 0 0 auto;
  width: 360px;
  border: 1px solid #ececec;
  border-radius: 14px;
  padding: 12px 12px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(0,0,0,0.04);
}
.presentation-item h3{
  font-size: 13.5px;
  font-weight: 900;
  margin-bottom: 8px;
}
.presentation-item small{
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.video-wrapper{
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #f0f0f0;
  background: #000;
}
.video-wrapper iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.presentation-image img{
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
}

/* Experiences */
.exp-list{
  display: grid;
  gap: 12px;
  margin-top: 8px;
}
.exp-item{
  border: 1px solid #ececec;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  background: #fff;
}
.exp-item img{
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
}
.exp-item h3{
  font-size: 14px;
  font-weight: 900;
}
.exp-item h3 small{
  font-weight: 700;
  color: #666;
}
.exp-item ul{
  margin-top: 6px;
  padding-left: 16px;
  color: #444;
  font-size: 13px;
}
.exp-item p{
  margin-top: 6px;
  font-size: 13px;
  color: #444;
}

/* Footer */
.footer{
  border-top: 1px solid #eee;
  padding: 18px 0 30px 0;
  color: #777;
  font-size: 13px;
}

/* Hint text */
.hint{
  margin-top: 10px;
  font-size: 12.5px;
  color: #666;
}

/* Cookie banner */
#cookie-banner{
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #1f1f1f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  z-index: 2000;
  font-size: 13px;
}
#cookie-banner p{ flex: 1; }
#cookie-banner button{
  background: #0b63c6;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}
#cookie-banner button:hover{ background: #094f9d; }
#cookie-banner .cookie-learn-more{
  color: #ddd;
  font-size: 13px;
}

/* Responsive */
@media (max-width: 980px){
  .page{ flex-direction: column; }
  .sidebar{
    width: 100%;
    position: static;
  }
  .proj-grid{ grid-template-columns: 1fr; }
  .presentation-item{ width: 320px; }
}

/* ===== Highlighted Projects: make images fully visible ===== */
.highlight-grid .project-thumb,
.highlight-grid .project-thumb img,
.highlighted-grid .project-thumb,
.highlighted-grid .project-thumb img,
.project-grid .project-thumb,
.project-grid .project-thumb img {
  width: 100%;
}

.highlight-grid .project-thumb,
.highlighted-grid .project-thumb,
.project-grid .project-thumb {
  height: 160px;            /* 你觉得还不够就改 180/200 */
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.highlight-grid .project-thumb img,
.highlighted-grid .project-thumb img,
.project-grid .project-thumb img {
  height: 100%;
  width: 100%;
  object-fit: contain;      /* 关键：完整显示，不裁切 */
  padding: 10px;            /* 留白更好看 */
}

/* Final safeguard: don't crop highlighted thumbnails */
.proj img { object-fit: contain; }
