
/* =========================================================
   Custom overrides on top of the official "minimal" theme.
   Goal: keep it clean & academic, but a bit more refined.
   ========================================================= */

:root {
  --text:        #2b2b2b;
  --text-soft:   #555;
  --muted:       #888;
  --link:        #1756a9;
  --link-hover:  #0b3d7a;
  --rule:        #e6e6e6;
  --bg:          #ffffff;
  --header-bg:   #ffffff;
  --accent:      #1756a9;
  --thumb-bg:    #f5f5f5;
  --code-bg:     #f6f8fa;
  --shadow:      0 2px 14px rgba(0, 0, 0, 0.08);
  --badge-bg:    #fff7e6;
  --badge-fg:    #b8860b;
  --badge-bd:    #f0d68a;
}

/* ---------- Dark theme ---------- */
html[data-theme="dark"] {
  --text:        #e8e8ea;
  --text-soft:   #b6b8bd;
  --muted:       #8a8d94;
  --link:        #6ea8ff;
  --link-hover:  #9ec3ff;
  --rule:        #2a2d33;
  --bg:          #15171c;
  --header-bg:   #15171c;
  --accent:      #6ea8ff;
  --thumb-bg:    #20232a;
  --code-bg:     #1b1e24;
  --shadow:      0 2px 14px rgba(0, 0, 0, 0.5);
  --badge-bg:    #3a2f12;
  --badge-fg:    #f0c674;
  --badge-bd:    #5a4820;
}

html { transition: background-color 0.25s ease, color 0.25s ease; }

/* ---------- Global typography ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB",
               "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.wrapper {
  max-width: 1040px;
  margin: 0 auto;
  padding: 50px 40px 40px;
  position: relative;
  display: block;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--text-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, border-color 0.2s ease,
              transform 0.2s ease, background-color 0.25s ease;
  box-shadow: var(--shadow);
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(15deg) scale(1.05);
}
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline-block; }
html[data-theme="dark"] .theme-toggle .icon-sun  { display: inline-block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Sidebar (header) ---------- */
header {
  width: 230px;
  padding-right: 24px;
  background: var(--header-bg);
  position: sticky;
  top: 40px;
  align-self: flex-start;
  float: left;
}

header .avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 0 18px 0;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
header .avatar:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

header h1.name {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
  letter-spacing: 0.2px;
  line-height: 1.25;
}
header h1.name .name-cn {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-soft);
  margin-left: 4px;
  letter-spacing: 0;
}

header .name-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 8px 0;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  align-items: center;
}
header .name-meta .pronunciation {
  font-style: italic;
  font-family: "Cambria", "Times New Roman", serif;
}
header .name-meta .pronouns {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-size: 11.5px;
}
header .name-meta .dot { color: var(--rule); }

header .tagline {
  font-size: 13.5px;
  color: var(--text-soft);
  margin: 6px 0 4px 0;
  line-height: 1.5;
}

header .affiliation {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px 0;
}

/* Nav */
.site-nav {
  margin: 14px 0 16px 0;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
}
.site-nav a {
  font-size: 13.5px;
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 500;
  position: relative;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}
.site-nav a:hover { color: var(--link); }
.site-nav a:hover::after { transform: scaleX(1); }

/* Socials (icon row) */
.social {
  list-style: none;
  padding: 14px 0 0 0;
  margin: 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.social li { margin: 0; }
.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease,
              transform 0.2s ease, background-color 0.2s ease;
}
.social-icons a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.social-icons svg { display: block; }

/* ---------- Main content ---------- */
section {
  width: auto;
  max-width: 720px;
  margin-left: 270px;
  padding: 0 0 40px 20px;
  border: none;
  background: transparent;
  box-shadow: none;
  float: none;
}

section h1, section h2, section h3, section h4 {
  color: var(--text);
  font-weight: 600;
}

section h1 {
  font-size: 22px;
  margin: 0 0 14px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

section h2 {
  font-size: 18px;
  margin: 32px 0 12px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

section h3 {
  font-size: 15.5px;
  margin: 22px 0 8px 0;
}

section p, section li { color: var(--text); }

/* ---------- Inline link underline animation ---------- */
section a, .footer-text a {
  color: var(--link);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0% 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 0.3s ease, color 0.2s ease;
  padding-bottom: 1px;
}
section a:hover, .footer-text a:hover {
  color: var(--link-hover);
  background-size: 100% 1px;
}
/* Buttons in pub-links should keep their bordered style without the underline animation */
.pub-list .pub-links a {
  background-image: none;
}

/* ---------- About Me block ---------- */
.about-me,
.about-me p {
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
}

/* ---------- News list ---------- */
.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid var(--rule);
}
.news-list li {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.news-list .date {
  flex: 0 0 90px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  padding-top: 1px;
}
.news-list .item { flex: 1; }

/* ---------- Education timeline ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  border-left: 2px solid var(--rule);
}
.timeline > li {
  position: relative;
  padding: 4px 0 14px 18px;
  font-size: 14px;
  color: var(--text);
}
.timeline > li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
  transition: background-color 0.25s ease;
}
.timeline .tl-period {
  display: inline-block;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
  font-weight: 500;
}
.timeline .tl-degree {
  font-weight: 600;
  color: var(--text);
}
.timeline .tl-place {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 1px;
}
.timeline .tl-note {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- Publication list ---------- */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pub-list > li {
  display: flex;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  transition: background-color 0.2s ease;
}
.pub-list .pub-thumb {
  flex: 0 0 140px;
  width: 140px;
  height: 90px;
  background: var(--thumb-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pub-list .pub-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.pub-list > li:hover .pub-thumb img { transform: scale(1.04); }
.pub-list .pub-info { flex: 1; }
.pub-list .pub-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
  line-height: 1.45;
}
.pub-list .pub-authors {
  font-size: 13.5px;
  color: var(--text-soft);
  margin: 0 0 4px 0;
}
.pub-list .pub-authors .me { color: var(--text); font-weight: 600; }
.pub-list .pub-venue {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 4px 0;
}
.pub-list .pub-tldr {
  font-size: 13px;
  color: var(--text-soft);
  margin: 4px 0 6px 0;
  line-height: 1.55;
}
.pub-list .pub-tldr::before {
  content: "TL;DR ";
  font-weight: 700;
  font-style: normal;
  color: var(--accent);
  letter-spacing: 0.3px;
  margin-right: 4px;
}
.pub-list .pub-links a {
  display: inline-block;
  font-size: 12.5px;
  margin-right: 8px;
  padding: 2px 8px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  text-decoration: none;
  color: var(--text-soft);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.pub-list .pub-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Highlight badges (Best Paper / Oral / Spotlight / Early Accept ...) */
.pub-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.2px;
  padding: 1px 7px;
  margin-left: 6px;
  border: 1px solid var(--badge-bd);
  background: var(--badge-bg);
  color: var(--badge-fg);
  border-radius: 10px;
  vertical-align: 1px;
}
.pub-badge.badge-oral     { --badge-bg:#eaf3ff; --badge-fg:#1756a9; --badge-bd:#bcd6f7; }
.pub-badge.badge-spotlight{ --badge-bg:#f0eaff; --badge-fg:#5a3eb8; --badge-bd:#cdbcf7; }
.pub-badge.badge-early    { --badge-bg:#e9f7ee; --badge-fg:#1f7a3a; --badge-bd:#b6e3c4; }
.pub-badge.badge-best     { --badge-bg:#fff4d6; --badge-fg:#a36b00; --badge-bd:#f0d177; }
html[data-theme="dark"] .pub-badge.badge-oral      { --badge-bg:#162a44; --badge-fg:#9bbcf3; --badge-bd:#28456e; }
html[data-theme="dark"] .pub-badge.badge-spotlight { --badge-bg:#241a3d; --badge-fg:#b9a4f1; --badge-bd:#3c2d62; }
html[data-theme="dark"] .pub-badge.badge-early     { --badge-bg:#16321f; --badge-fg:#92d0a6; --badge-bd:#27532f; }
html[data-theme="dark"] .pub-badge.badge-best      { --badge-bg:#382a0e; --badge-fg:#f0c674; --badge-bd:#5a4820; }

/* ---------- Footer ---------- */
footer {
  width: 230px;
  padding-right: 24px;
  margin-top: 24px;
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  background: var(--bg);
  clear: left;
  float: left;
}
.footer-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.footer-text a { color: var(--muted); }
.footer-text a:hover { color: var(--link); }

/* ---------- Responsive ---------- */
@media print, screen and (max-width: 960px) {
  .wrapper { padding: 24px 20px; }
  header, section, footer {
    width: auto;
    max-width: none;
    padding: 0;
    margin: 0;
    float: none;
    position: static;
    max-height: none;
    overflow: visible;
    top: auto; left: auto; bottom: auto;
    border-top: none;
  }
  header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--rule);
  }
  header .avatar { width: 120px; height: 120px; }
  section { padding: 0 0 24px 0; }
  footer {
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
  }
  .pub-list > li { flex-direction: column; }
  .pub-list .pub-thumb { width: 100%; height: 160px; }
  .theme-toggle { top: 12px; right: 12px; }
}

/* ---------- Dark mode text-color hardening ----------
   The base "minimal" theme hard-codes dark colors on headings,
   <strong>/<b>, <em>, table headers, etc. Override them so they
   remain readable on dark backgrounds. */
html[data-theme="dark"] body,
html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] span,
html[data-theme="dark"] div,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] strong,
html[data-theme="dark"] b,
html[data-theme="dark"] em,
html[data-theme="dark"] i,
html[data-theme="dark"] th,
html[data-theme="dark"] td,
html[data-theme="dark"] dt,
html[data-theme="dark"] dd,
html[data-theme="dark"] blockquote,
html[data-theme="dark"] label {
  color: var(--text);
}

html[data-theme="dark"] strong,
html[data-theme="dark"] b {
  color: #ffffff;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: #f5f6f8;
}

html[data-theme="dark"] code,
html[data-theme="dark"] pre,
html[data-theme="dark"] kbd,
html[data-theme="dark"] samp {
  background: var(--code-bg);
  color: #e8e8ea;
}

html[data-theme="dark"] hr {
  border-color: var(--rule);
}

html[data-theme="dark"] blockquote {
  border-left-color: var(--rule);
  color: var(--text-soft);
}
