/* Shijie Wang — academic homepage (Yadan / al-folio style) */

:root {
  --bg: #ffffff;
  --text: #343a40;
  --muted: #6c757d;
  --link: #007bff;
  --link-hover: #0056b3;
  --border: #dee2e6;
  --surface: #f8f9fa;
  --surface-hover: #ffffff;
  --preview-bg: #f1f3f5;
  --news-accent: #c71585;
  --news-accent-hover: #a0126c;
  --scrollbar: #c1c7cd;
  --theme-btn-bg: #ffffff;
  --theme-btn-border: #dee2e6;
  --theme-btn-hover: #f1f3f5;
  --badge-eccv: #c23b5a;
  --badge-cvpr: #0b6bcb;
  --badge-iccv: #d97706;
  --badge-neurips: #3d2b8e;
  --badge-aaai: #0e8a9a;
  --badge-tpami: #1f8a4c;
  --badge-ijcv: #0f766e;
  --maxw: 800px;
  --font: "Roboto", "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #121418;
  --text: #e6e8eb;
  --muted: #9aa3ad;
  --link: #6cb2ff;
  --link-hover: #9cc9ff;
  --border: #2c3138;
  --surface: #1a1e24;
  --surface-hover: #22272e;
  --preview-bg: #1a1e24;
  --news-accent: #f472b6;
  --news-accent-hover: #f9a8d4;
  --scrollbar: #4b5563;
  --theme-btn-bg: #1a1e24;
  --theme-btn-border: #3a4149;
  --theme-btn-hover: #252a31;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  overflow-x: hidden;
}

/* Theme toggle — compact, beside UQ logo */
.theme-toggle {
  position: static;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--theme-btn-border);
  border-radius: 999px;
  background: var(--theme-btn-bg);
  color: var(--muted);
  cursor: pointer;
  box-shadow: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text);
  background: var(--theme-btn-hover);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 0.95rem;
  height: 0.95rem;
  display: none;
}

html:not([data-theme="dark"]) .theme-toggle .icon-moon {
  display: block;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.site-header-text {
  min-width: 0;
  flex: 1;
}

.site-header-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
}

.uq-logo-link {
  display: block;
  line-height: 0;
  text-decoration: none !important;
}

.uq-logo {
  display: block;
  width: min(170px, 38vw);
  height: auto;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.uq-logo-link:hover .uq-logo {
  opacity: 1;
}

html[data-theme="dark"] .uq-logo {
  filter: brightness(1.15);
}

@media (max-width: 560px) {
  .site-header {
    flex-wrap: wrap;
  }

  .site-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .uq-logo {
    width: min(150px, 55vw);
  }
}

.site-title {
  margin: 0 0 0.35rem;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

.site-title .name-bold {
  font-weight: 700;
}

.site-title .zh {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 400;
}

.site-affil {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Profile + bio */
.profile-block {
  margin-bottom: 0.5rem;
  overflow: visible;
}

.profile-block::after {
  content: "";
  display: table;
  clear: both;
}

.profile-photo-wrap {
  float: right;
  margin: 0 0 1rem 1.5rem;
  padding: 10px;
  border-radius: 50%;
}

.profile-photo {
  display: block;
  width: 180px;
  height: 180px;
  object-fit: cover;
  object-position: center 12%;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  transform-origin: center center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.profile-photo-wrap:hover .profile-photo {
  transform: scale(1.05);
  box-shadow:
    0 0 0 3px rgba(79, 195, 247, 0.35),
    0 8px 22px rgba(79, 195, 247, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.1);
}

.bio p {
  margin: 0 0 1rem;
  text-align: justify;
}

.bio p:last-child {
  margin-bottom: 0.75rem;
}

@media (max-width: 560px) {
  .profile-photo-wrap {
    float: none;
    display: block;
    width: fit-content;
    margin: 0 auto 1.25rem;
  }

  .bio p {
    text-align: left;
  }
}

/* Contact icons — Yadan-style elegant icons, light blue */
.social {
  clear: both;
  margin: 1rem 0 2rem;
  text-align: left;
}

.social .contact-icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.1rem;
  font-size: 2.35rem;
}

.social .contact-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  margin: 0;
}

.social .contact-icons a i.elegant-icon {
  font-size: 1em;
  background: linear-gradient(135deg, #4fc3f7 0%, #90caf9 55%, #bbdefb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.social .contact-icons a:hover i.elegant-icon {
  transform: translateY(-2px) scale(1.15);
  filter: brightness(1.08);
}

/* Sections */
.section {
  margin-top: 2.25rem;
}

.section h2 {
  margin: 0 0 0.85rem;
  font-size: 1.5rem;
  font-weight: 500;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.pubs-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.citation-badge {
  display: inline-flex;
  align-items: stretch;
  height: 1.35rem;
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none !important;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  vertical-align: middle;
  position: relative;
  top: 0.05rem;
}

.citation-badge:hover {
  filter: brightness(1.05);
  text-decoration: none !important;
}

.citation-badge__label {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0 0.5rem;
  background: #555;
  color: #fff;
}

.citation-badge__label svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

.citation-badge__count {
  display: inline-flex;
  align-items: center;
  padding: 0 0.55rem;
  background: #4285f4;
  color: #fff;
}

/* News — scrollable list (no table borders) */
.news-scroll {
  max-height: 18rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}

.news-scroll::-webkit-scrollbar {
  width: 6px;
}

.news-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 999px;
}

.news-scroll:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-list li {
  display: grid;
  grid-template-columns: 6.25rem 1fr;
  gap: 0.85rem 1.25rem;
  padding: 0.55rem 0;
  align-items: start;
}

.news-date {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  padding-top: 0.05rem;
}

.news-text {
  margin: 0;
  color: var(--text);
}

.news-text strong {
  font-weight: 700;
}

.news-text a {
  color: var(--news-accent);
  font-weight: 500;
}

.news-text a:hover {
  color: var(--news-accent-hover);
}

@media (max-width: 480px) {
  .news-list li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding: 0.7rem 0;
  }
}

/* Publications */
.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub-item {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-venue-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.pub-preview {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 0.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease;
  background: var(--preview-bg);
}

a.pub-preview-link:hover .pub-preview {
  transform: scale(1.04);
}

a.pub-preview-link {
  display: block;
  text-decoration: none !important;
  border-radius: 0.5rem;
}

.venue-badge {
  display: block;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  padding: 0.38rem 0.35rem;
  border-radius: 6px;
  text-decoration: none !important;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.venue-badge:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  text-decoration: none !important;
}

.venue-badge--eccv { background: linear-gradient(180deg, #d95472 0%, var(--badge-eccv) 100%); }
.venue-badge--cvpr { background: linear-gradient(180deg, #2b8ef0 0%, var(--badge-cvpr) 100%); }
.venue-badge--iccv { background: linear-gradient(180deg, #f59e0b 0%, var(--badge-iccv) 100%); }
.venue-badge--neurips {
  background: linear-gradient(135deg, #6d4aff 0%, #3d2b8e 50%, #241a5c 100%);
  color: #fff;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 8px;
}
.venue-badge--aaai { background: linear-gradient(180deg, #1aa8bb 0%, var(--badge-aaai) 100%); }
.venue-badge--tpami { background: linear-gradient(180deg, #2da862 0%, var(--badge-tpami) 100%); }
.venue-badge--ijcv { background: linear-gradient(180deg, #14b8a6 0%, var(--badge-ijcv) 100%); }

.pub-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
}

.pub-authors {
  margin: 0 0 0.3rem;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
}

.pub-authors strong {
  color: var(--text);
  font-weight: 600;
}

.pub-periodical {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pub-links a {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pub-links a:hover {
  color: var(--link);
  border-color: var(--link);
  background: var(--surface-hover);
  text-decoration: none;
}

@media (max-width: 720px) {
  .pub-authors {
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .pub-item {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .pub-venue-col {
    max-width: 11rem;
  }
}

.visitor-map {
  width: min(280px, 70%);
  margin: 2.5rem auto 0;
  text-align: center;
  border-radius: 8px;
  overflow: hidden;
}

html[data-theme="dark"] .visitor-map {
  background: #121418;
}

.site-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
