/* ==============================
   Academic Homepage Styles
   ============================== */

/* Font */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;1,400&display=swap');
body { font-family: 'Merriweather', Georgia, 'Times New Roman', serif; }

:root {
  --academic-accent: #3f8f8f;
  --academic-accent-soft: #9ccfc9;
  --academic-accent-dark: #74b8b2;
}

/* Homepage layout */
.page.home.academic-home {
  padding-bottom: 1.6rem;
  max-width: 1080px;
  width: 100%;
}
.page.home.academic-home .academic-container {
  display: flex; gap: 2.5rem; max-width: 1080px; margin: 0 auto; padding: 0 1.5rem;
}

/* ---- Sidebar ---- */
.academic-sidebar { flex: 0 0 240px; position: sticky; top: 5rem; align-self: flex-start; }
.academic-sidebar .sidebar-inner { text-align: center; }
.academic-sidebar .profile-photo { margin-bottom: 1rem; }
.academic-sidebar .profile-photo img {
  width: 180px; height: 180px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.academic-sidebar .profile-name { font-size: 1.6rem; font-weight: 700; margin: 0 0 0.25rem; }
.academic-sidebar .profile-position { font-size: 0.95rem; color: #555; margin: 0 0 0.15rem; }
.academic-sidebar .profile-institution { font-size: 0.9rem; color: #777; margin: 0 0 0.75rem; }
.academic-sidebar .profile-location-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22rem;
  font-size: 0.9rem;
  color: #777;
  margin-left: 0.35rem;
}
.academic-sidebar .profile-location-tag i { font-size: 0.78rem; }
.academic-sidebar .profile-links {
  display: flex; justify-content: center; gap: 0.75rem; margin-bottom: 1.5rem;
}
.academic-sidebar .profile-links a { font-size: 1.4rem; color: #555; transition: color 0.2s; }
.academic-sidebar .profile-links a:hover { color: var(--academic-accent); }

.academic-sidebar .profile-section { text-align: center; margin-bottom: 1.25rem; }
.academic-sidebar .profile-section h3 {
  font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: #333; margin: 0 0 0.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid #e8e8e8;
}
.academic-sidebar .profile-section ul { list-style: none; padding: 0; margin: 0; }
.academic-sidebar .profile-section li { font-size: 0.85rem; color: #555; padding: 0.15rem 0; }
.academic-sidebar .education-list .degree { display: block; font-weight: 500; font-size: 0.85rem; }
.academic-sidebar .education-list .school { display: block; font-size: 0.8rem; color: #777; }

/* ---- Main Content ---- */
.academic-main { flex: 1 1 auto; min-width: 0; }
.academic-main .content h2 {
  font-size: 1.35rem; font-weight: 700; margin: 2rem 0 0.75rem;
  padding-bottom: 0.3rem; border-bottom: 2px solid var(--academic-accent-soft);
}
.academic-main .content h2:first-child { margin-top: 1.5rem; }
.academic-main .content h3 { font-size: 1.1rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
.academic-main .content p { line-height: 1.75; margin: 0.5rem 0; }

/* ---- Publication Cards ---- */
.pub-card {
  display: flex; flex-direction: row; margin-bottom: 1.25rem; background: #fff;
  border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #eaeaea; transition: box-shadow 0.3s, transform 0.3s;
}
.pub-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.12); transform: translateY(-3px);
}
.pub-card .pub-thumb {
  position: relative; flex: 0 0 220px; align-self: center; display: flex; align-items: center; justify-content: center; height: 165px; overflow: hidden; background: #f5f5f5;
}
.pub-card .pub-thumb img {
  width: 100%; height: 100%; object-fit: contain; object-position: center; transition: transform 0.4s;
}
.pub-card .pub-thumb:hover img { transform: scale(1.02); }
.pub-card .pub-corner-badge {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 1;
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.08);
  font-size: 0.68rem;
  line-height: 1;
  pointer-events: none;
}
.pub-card .pub-corner-venue,
.pub-card .pub-corner-award {
  display: inline-flex;
  align-items: center;
  min-height: 1.15rem;
  padding: 0.18rem 0.45rem;
  backdrop-filter: blur(2px);
}
.pub-card .pub-corner-venue {
  color: rgba(60,60,60,0.84);
  background: rgba(255,255,255,0.46);
  font-style: italic;
}
.pub-card .pub-corner-fade {
  width: 0.35rem;
  background: linear-gradient(90deg, rgba(255,255,255,0.46), rgba(255,230,128,0.42));
  backdrop-filter: blur(2px);
}
.pub-card .pub-corner-award {
  color: rgba(92,75,0,0.86);
  background: rgba(255,230,128,0.42);
  font-weight: 700;
}
.pub-card .pub-thumb.pub-thumb-placeholder {
  flex-basis: 220px;
  height: 165px;
  background:
    linear-gradient(135deg, rgba(63, 143, 143, 0.12), rgba(156, 207, 201, 0.18)),
    #f5f5f5;
}
[theme=dark] .pub-card .pub-thumb.pub-thumb-placeholder {
  background:
    linear-gradient(135deg, rgba(116, 184, 178, 0.16), rgba(63, 143, 143, 0.12)),
    #2a2a2a;
}
.pub-card .pub-info {
  flex: 1; min-width: 0; padding: 0.9rem 1.15rem;
  display: flex; flex-direction: column; justify-content: center;
}
.pub-card .pub-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.32rem; line-height: 1.38; }
.pub-card .pub-title a { color: inherit; text-decoration: none; }
.pub-card .pub-title a:hover { color: var(--academic-accent); }
.pub-card .pub-authors { font-size: 0.85rem; color: #555; margin: 0 0 0.08rem; line-height: 1.42; }
.pub-card .pub-authors a { color: inherit; }
.pub-card .pub-note { font-style: italic; }
.pub-card .pub-venue { font-size: 0.85rem; color: #777; font-style: italic; margin: 0 0 0.45rem; line-height: 1.42; }
.pub-card .pub-venue a { color: inherit; }
.pub-card .pub-badge {
  display: inline-block; font-style: normal; font-size: 0.68rem; font-weight: 700;
  padding: 0.02rem 0.45rem; border-radius: 3px; margin-left: 0.5rem;
  background: linear-gradient(135deg, #ffe680, #ffd54f); color: #665500; letter-spacing: 0.02em;
}
.pub-card .pub-links { display: flex; gap: 0.38rem; flex-wrap: wrap; margin-top: 0.18rem; }
.pub-card .pub-authors + .pub-links { margin-top: 0.45rem; }
.pub-card .pub-links a {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.76rem; font-weight: 500; padding: 0.2rem 0.58rem;
  border: 1px solid #d0d0d0; border-radius: 5px; color: #555;
  text-decoration: none; transition: all 0.2s;
}
.pub-card .pub-links a:hover {
  border-color: var(--academic-accent); color: #fff; background: var(--academic-accent);
}
.pub-card .pub-links a i { font-size: 0.85rem; }
.pub-card .pub-links .fa-arxiv {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("/icons/arxiv.svg") center / contain no-repeat;
  mask: url("/icons/arxiv.svg") center / contain no-repeat;
}

/* ---- News List ---- */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list.is-scrollable {
  max-height: var(--news-list-height);
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(63, 143, 143, 0.45) transparent;
}
.news-list.is-scrollable::-webkit-scrollbar { width: 0.4rem; }
.news-list.is-scrollable::-webkit-scrollbar-thumb {
  background: rgba(63, 143, 143, 0.45);
  border-radius: 999px;
}
.news-list li {
  position: relative;
  padding: 0.35rem 0 0.35rem 5.45rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #f5f5f5;
}
.news-list .news-date {
  position: absolute; left: 0; top: 0.35rem; width: 4.8rem; display: block; text-align: right; font-weight: 600; color: var(--academic-accent); font-size: 0.85rem;
}

/* ---- Projects Card Grid ---- */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem; margin: 1.5rem 0;
}
.project-card {
  border: 1px solid #e8e8e8; border-radius: 8px; padding: 1.25rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.project-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-2px); }
.project-card .project-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.5rem; }
.project-card .project-title a { color: inherit; text-decoration: none; }
.project-card .project-title a:hover { color: var(--academic-accent); }
.project-card .project-desc { font-size: 0.9rem; color: #555; line-height: 1.5; }
.project-card .project-tags { margin-top: 0.75rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.project-card .project-tags span {
  font-size: 0.75rem; padding: 0.1rem 0.5rem; background: #f0f0f0; border-radius: 3px; color: #555;
}

/* ---- Talks Timeline ---- */
.talks-timeline {
  display: grid;
  gap: 0.45rem;
  margin: 1.5rem 0;
}
.talk-card {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e8e8e8;
}
[theme=dark] .talk-card { border-bottom-color: #333; }
.talk-card .talk-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--academic-accent);
}
[theme=dark] .talk-card .talk-date { color: var(--academic-accent-dark); }
.talk-card .talk-title {
  font-weight: 700;
  line-height: 1.45;
}
.talk-card .talk-meta {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: #666;
}
[theme=dark] .talk-card .talk-meta { color: #aaa; }

@media screen and (max-width: 680px) {
  .talk-card {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* ---- Dark mode ---- */
[theme=dark] .academic-sidebar .profile-position { color: #aaa; }
[theme=dark] .academic-sidebar .profile-institution { color: #999; }
[theme=dark] .academic-sidebar .profile-location-tag {
  color: #999;
}
[theme=dark] .academic-sidebar .profile-links a { color: #bbb; }
[theme=dark] .academic-sidebar .profile-links a:hover { color: var(--academic-accent-dark); }
[theme=dark] .academic-sidebar .profile-section h3 { color: #ddd; border-bottom-color: #444; }
[theme=dark] .academic-sidebar .profile-section li { color: #bbb; }
[theme=dark] .academic-sidebar .education-list .school { color: #999; }
[theme=dark] .academic-main .content h2 { border-bottom-color: var(--academic-accent-dark); }
[theme=dark] .pub-card { background: #1e1e1e; border-color: #333; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
[theme=dark] .pub-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
[theme=dark] .pub-card .pub-thumb { background: #2a2a2a; }
[theme=dark] .pub-card .pub-authors { color: #bbb; }
[theme=dark] .pub-card .pub-venue { color: #999; }
[theme=dark] .pub-card .pub-title a:hover { color: var(--academic-accent-dark); }
[theme=dark] .pub-card .pub-links a { border-color: #555; color: #bbb; }
[theme=dark] .pub-card .pub-links a:hover { border-color: var(--academic-accent-dark); color: #111; background: var(--academic-accent-dark); }
[theme=dark] .news-list li { border-bottom-color: #333; }
[theme=dark] .news-list .news-date { color: var(--academic-accent-dark); }
[theme=dark] .project-card { border-color: #444; }
[theme=dark] .project-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
[theme=dark] .project-card .project-title a:hover { color: var(--academic-accent-dark); }
[theme=dark] .project-card .project-desc { color: #bbb; }
[theme=dark] .project-card .project-tags span { background: #333; color: #bbb; }

/* ---- Responsive ---- */
@media screen and (max-width: 680px) {
  .academic-home .academic-container { flex-direction: column; gap: 1.5rem; }
  .academic-sidebar { flex: none; position: static; width: 100%; }
  .academic-sidebar .sidebar-inner { max-width: 280px; margin: 0 auto; }
  .academic-sidebar .profile-section { text-align: center; }
  .academic-sidebar .profile-photo img { width: 140px; height: 140px; }
  .pub-card { flex-direction: column; }
  .pub-card .pub-thumb { flex: none; height: 180px; max-height: none; }
}


/* ---- Link affordance ---- */
.academic-main .content a {
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-decoration-color: rgba(63, 143, 143, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: auto;
}
.academic-main .content a:hover,
.academic-main .content a:active {
  text-decoration-color: var(--academic-accent);
}
[theme=dark] .academic-main .content a:hover,
[theme=dark] .academic-main .content a:active {
  text-decoration-color: var(--academic-accent-dark);
}
.academic-main .content .pub-links a {
  text-decoration: none;
}

/* ---- Footer spacing ---- */
footer {
  padding: 1rem 0 1.25rem !important;
  height: auto !important;
}
footer .footer-container {
  max-width: 1440px;
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 1px solid #e8e8e8;
}
[theme=dark] footer .footer-container { border-top-color: #333; }
