/* ==========================================================================
   Dinghub Personal Academic Homepage — Refined Academic Design System
   Supports Dark (default) & Light themes, responsive desktop/mobile layouts
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg: #090d16;
  --bg-elevated: rgba(15, 23, 42, 0.72);
  --bg-card: rgba(15, 23, 42, 0.82);
  --bg-subtle: rgba(30, 41, 59, 0.55);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --accent-crimson: #fb7185;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --nav-bg: rgba(9, 13, 22, 0.78);
  --shadow-card: 0 20px 50px -18px rgba(0, 0, 0, 0.55);
  --code-bg: #060911;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-elevated: rgba(255, 255, 255, 0.88);
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-crimson: #e11d48;
  --accent-soft: rgba(37, 99, 235, 0.09);
  --nav-bg: rgba(248, 250, 252, 0.84);
  --shadow-card: 0 18px 42px -18px rgba(15, 23, 42, 0.10);
  --code-bg: #0f172a;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.22s ease, color 0.22s ease;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(680px circle at 14% 8%, rgba(59, 130, 246, 0.13), transparent 62%),
    radial-gradient(620px circle at 86% 14%, rgba(225, 29, 72, 0.09), transparent 60%);
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   Top Navigation
   -------------------------------------------------------------------------- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #e11d48 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-links a {
  transition: color 0.16s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.icon-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.icon-pill svg {
  width: 16px;
  height: 16px;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

/* --------------------------------------------------------------------------
   Main Layout & Hero Section
   -------------------------------------------------------------------------- */
.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 52px 24px 72px;
}

.hero-section {
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 40px;
  align-items: center;
}

.affiliation-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.pill-sep {
  color: var(--text-muted);
}

.hero-name {
  margin: 0;
  font-size: clamp(2.15rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.hero-role {
  margin: 10px 0 16px;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.22rem;
  font-weight: 500;
  color: var(--accent);
}

.hero-bio {
  margin: 0 0 22px;
  font-size: 0.99rem;
  color: var(--text-secondary);
  max-width: 64ch;
}

.interest-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.interest-tag {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.contact-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.contact-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.contact-btn svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.contact-btn .muted-val {
  font-weight: 400;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

/* Hero Right Spotlight Card */
.spotlight-card {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.spotlight-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.spotlight-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0b1120;
  overflow: hidden;
}

.spotlight-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.spotlight-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f8fafc;
  background: rgba(9, 13, 22, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.spotlight-body {
  padding: 16px 18px;
}

.spotlight-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.spotlight-body p {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Section Headers
   -------------------------------------------------------------------------- */
.content-section {
  padding-top: 56px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.section-kicker {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  margin-bottom: 4px;
}

.section-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-desc {
  margin: 0;
  max-width: 48ch;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Publication Showcase Card (VolMusCo)
   -------------------------------------------------------------------------- */
.pub-card {
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.15fr);
  gap: 30px;
  align-items: start;
}

.pub-media-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pub-stage {
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0b1120;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
}

.pub-stage video,
.pub-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pub-stage img.is-contain {
  object-fit: contain;
  background: #ffffff;
  padding: 6px;
}

.media-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.media-tab {
  flex: 1;
  min-width: fit-content;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.77rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.media-tab.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.pub-caption {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.pub-venue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.venue-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(225, 29, 72, 0.18));
  color: var(--accent);
  border: 1px solid rgba(96, 165, 250, 0.28);
}

.pub-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.pub-title a:hover {
  color: var(--accent);
}

.pub-authors {
  margin: 0 0 4px;
  font-size: 0.93rem;
  color: var(--text-secondary);
}

.pub-authors .author-self {
  font-weight: 700;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.pub-note {
  margin: 0 0 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pub-summary {
  margin: 0 0 18px;
  font-size: 0.91rem;
  color: var(--text-secondary);
}

.pub-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.pub-metric {
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.pub-metric strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.pub-metric span {
  display: block;
  font-size: 0.71rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 2px;
}

.pub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text);
  font: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.pub-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.pub-btn.is-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.55);
}

.pub-btn.is-primary:hover {
  color: #ffffff;
  opacity: 0.94;
}

.pub-btn svg {
  width: 15px;
  height: 15px;
}

.bibtex-drawer {
  margin-top: 14px;
  border-radius: 11px;
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  overflow: hidden;
}

.bibtex-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  color: #94a3b8;
}

.bibtex-copy {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  font: inherit;
  cursor: pointer;
}

.bibtex-drawer pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.77rem;
  line-height: 1.55;
  color: #e2e8f0;
}

/* --------------------------------------------------------------------------
   Interactive Projects Grid
   -------------------------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.project-visual {
  position: relative;
  aspect-ratio: 16 / 9.5;
  background: #0d1320;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.project-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-img-switch {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
}

.project-img-btn {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(9, 13, 22, 0.75);
  backdrop-filter: blur(8px);
  color: #cbd5e1;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.project-img-btn.is-active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

.project-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.project-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

.project-domain {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.project-title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.project-desc {
  margin: 0 0 16px;
  font-size: 0.89rem;
  color: var(--text-secondary);
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.project-tag {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.74rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.project-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  transition: all 0.16s ease;
}

.project-cta:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   News List & Footer
   -------------------------------------------------------------------------- */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: baseline;
  padding: 15px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.news-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.news-text {
  font-size: 0.91rem;
  color: var(--text-secondary);
}

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

.news-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.news-link:hover {
  text-decoration: underline;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px 40px;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-meta {
  display: flex;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.79rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 920px) {
  .hero-grid,
  .pub-card,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .pub-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .page-shell {
    padding: 32px 18px 56px;
  }

  .pub-card {
    padding: 20px;
  }

  .news-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
