:root {
  /* ── Layout ── */
  --header-h: 4.2rem;
  --header-max-w: 1280px;
  --container-max: 1200px;

  /* ── Primary: Indigo ── */
  --hb-primary-50: #eef2ff;
  --hb-primary-100: #e0e7ff;
  --hb-primary-200: #c7d2fe;
  --hb-primary-300: #a5b4fc;
  --hb-primary-400: #818cf8;
  --hb-primary-500: #6366f1;
  --hb-primary-600: #4f46e5;
  --hb-primary-700: #4338ca;
  --hb-primary-800: #3730a3;
  --hb-primary-900: #312e81;
  --hb-primary-950: #1e1b4d;

  /* ── Secondary: Teal ── */
  --hb-secondary-50: #f0fdfa;
  --hb-secondary-100: #ccfbf1;
  --hb-secondary-200: #99f6e4;
  --hb-secondary-300: #5eead4;
  --hb-secondary-400: #2dd4bf;
  --hb-secondary-500: #14b8a6;
  --hb-secondary-600: #0d9488;
  --hb-secondary-700: #0f766e;
  --hb-secondary-800: #115e59;
  --hb-secondary-900: #134e4a;
  --hb-secondary-950: #042f2e;

  /* ── Neutral: Gray / Slate ── */
  --hb-neutral-50: #f8fafc;
  --hb-neutral-100: #f1f5f9;
  --hb-neutral-200: #e2e8f0;
  --hb-neutral-300: #cbd5e1;
  --hb-neutral-400: #9ca3af;
  --hb-neutral-500: #64748b;
  --hb-neutral-600: #475569;
  --hb-neutral-700: #374151;
  --hb-neutral-800: #1f2937;
  --hb-neutral-900: #0f172a;
  --hb-neutral-950: #020617;

  /* ── Semantic Surface (Light) ── */
  --hb-bg: #ffffff;
  --hb-bg-soft: #f8fafc;
  --hb-fg: #111827;
  --hb-fg-secondary: #374151;
  --hb-muted: #6b7280;
  --hb-header-bg: #f1f5f9;
  --hb-header-fg: #0f172a;
  --hb-footer-bg: #f3f4f6;
  --hb-footer-fg: #0f172a;

  /* ── Cards ── */
  --hb-card-bg: #ffffff;
  --hb-card-border: #e2e8f0;
  --hb-card-ring: rgba(24, 24, 27, 0.05);

  /* ── Shadows ── */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-primary: 0 10px 15px -3px rgba(99, 102, 241, 0.25);
  --shadow-primary-hover: 0 20px 25px -5px rgba(99, 102, 241, 0.3);

  /* ── Radius ── */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* ── Transitions ── */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ── Reading progress ── */
  --reading-track: rgba(226, 232, 240, 0.88);
  --reading-fill: var(--hb-primary-600);

  /* ── Legacy aliases (keep for partial compat) ── */
  --header-h: 4.2rem;
  --header-max-w: 1280px;
  --primary: var(--hb-primary-500);
  --primary-dark: var(--hb-primary-600);
  --primary-light: var(--hb-primary-50);
  --primary-soft: rgba(99, 102, 241, 0.12);
  --bg: var(--hb-bg);
  --bg-soft: var(--hb-bg-soft);
  --surface: var(--hb-card-bg);
  --surface-raised: var(--hb-card-bg);
  --panel: var(--hb-card-bg);
  --ink: var(--hb-fg);
  --ink-secondary: var(--hb-fg-secondary);
  --muted: var(--hb-muted);
  --text-on-primary: #ffffff;
  --blue: var(--hb-primary-500);
  --blue-strong: var(--hb-primary-600);
  --blue-soft: var(--hb-primary-50);
  --line: var(--hb-neutral-200);
  --line-strong: rgba(99, 102, 241, 0.22);
  --line-subtle: rgba(99, 102, 241, 0.10);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(99, 102, 241, 0.18);
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--hb-primary-400);
  outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Inter", "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

code, pre, kbd, samp {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
}

body {
  font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--hb-fg);
  overflow-x: hidden;
  background: var(--hb-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.reading-progress-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 4px;
  background: var(--reading-track);
  border-bottom: 1px solid var(--hb-neutral-200);
  pointer-events: none;
  z-index: 9998;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: var(--reading-fill);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  border-radius: 0 2px 2px 0;
  pointer-events: none;
  transition: width 0.3s ease;
  z-index: 9999;
}

/* HugoBlox uses subtle gradients, not glow orbs */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-h);
  background: var(--hb-header-bg);
  color: var(--hb-header-fg);
  border-bottom: 1px solid var(--hb-neutral-200);
  box-shadow: var(--shadow-sm);
  overflow: visible;
}

.header-inner {
  position: relative;
  max-width: var(--header-max-w);
  margin: 0 auto;
  padding: 0.4rem 1rem;
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.9rem;
  align-items: center;
}

.logo-badge {
  width: clamp(10rem, 16vw, 13rem);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-badge img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.brand {
  min-width: 0;
}

.brand-main {
  margin: 0;
  font-family: "Inter", "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.02rem, 1.1vw, 1.26rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.brand-sub {
  margin: 0.15rem 0 0;
  color: var(--hb-muted);
  font-size: 0.78rem;
  line-height: 1.35;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 2.9rem;
  min-height: 2.9rem;
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--hb-neutral-200);
  border-radius: var(--radius-full);
  background: var(--hb-card-bg);
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.site-nav-toggle:hover {
  background: var(--hb-card-bg);
}

.site-nav-toggle-bars {
  display: inline-grid;
  gap: 0.22rem;
}

.site-nav-toggle-bars span {
  display: block;
  width: 1.02rem;
  height: 2px;
  border-radius: var(--radius-full);
  background: currentColor;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.site-header.is-nav-open .site-nav-toggle-bars span:nth-child(1) {
  transform: translateY(0.38rem) rotate(45deg);
}

.site-header.is-nav-open .site-nav-toggle-bars span:nth-child(2) {
  opacity: 0;
}

.site-header.is-nav-open .site-nav-toggle-bars span:nth-child(3) {
  transform: translateY(-0.38rem) rotate(-45deg);
}

.site-nav {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
}

.nav-item-group {
  position: relative;
  display: flex;
  align-items: center;
}

.site-nav > a,
.site-nav .nav-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--hb-fg);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-full);
  transition: var(--transition-base);
  white-space: nowrap;
}

.site-nav .has-submenu > .nav-link::after {
  content: "▾";
  margin-left: 0.28rem;
  font-size: 0.72rem;
  opacity: 0.72;
  transform: translateY(-0.02rem);
}

.site-nav > a:hover,
.site-nav > a.active,
.site-nav .nav-link:hover,
.site-nav .nav-link.active,
.site-nav .nav-item-group:hover > .nav-link,
.site-nav .nav-item-group:focus-within > .nav-link {
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.nav-submenu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 14.5rem;
  max-width: 24rem;
  max-height: min(68vh, 27rem);
  overflow: auto;
  padding: 0.46rem;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--hb-card-border);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 0.2rem;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 45;
}

.nav-item-group:hover > .nav-submenu,
.nav-item-group:focus-within > .nav-submenu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.site-nav .nav-submenu a {
  display: block;
  padding: 0.42rem 0.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--hb-primary-700);
  font-size: 0.82rem;
  line-height: 1.42;
  font-weight: 550;
}

.site-nav .nav-submenu a:hover,
.site-nav .nav-submenu a:focus-visible {
  background: var(--primary-soft);
  color: var(--hb-primary-700);
  outline: none;
}

.site-nav .nav-submenu a.active {
  background: var(--primary-soft);
  color: var(--hb-primary-700);
  font-weight: 700;
}

.site-nav .nav-item-group:nth-last-child(-n + 2) .nav-submenu {
  left: auto;
  right: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 2.5rem 3rem;
}

.hero {
  border-radius: var(--radius-2xl);
  border: 1px solid var(--hb-card-border);
  background: var(--hb-card-bg);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  transition: var(--transition-base);
}
.hero:hover {
  box-shadow: var(--shadow-xl);
}

/* ===== Hugo Academic CV style biography ===== */
.hero.hero-biography {
  margin: -2.5rem -2.5rem 0;
  padding: 5rem 3rem 3rem;
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}
.hero.hero-biography:hover {
  box-shadow: none;
  transform: none;
  border: none;
}
.dark .hero.hero-biography {
  background: transparent;
  border: none;
}

.bio-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}

/* 左侧栏 */
.bio-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.bio-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.bio-avatar-wrap {
  margin-bottom: 1.25rem;
}

.bio-avatar {
  width: 200px;
  height: 260px;
  object-fit: cover;
  border-radius: var(--radius-2xl);
  border: 2px solid var(--hb-primary-200);
  box-shadow: var(--shadow-lg);
  transition: var(--transition-base);
}
.bio-avatar:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-xl);
}

.bio-name {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--hb-fg);
}

.bio-school {
  margin: 0.6rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--hb-primary-600);
}

.bio-major {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--hb-primary-600);
  line-height: 1.6;
}

.bio-social {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.bio-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--hb-neutral-100);
  color: var(--hb-neutral-600);
  transition: var(--transition-base);
}
.bio-social-link:hover {
  background: var(--hb-primary-100);
  color: var(--hb-primary-600);
  transform: translateY(-2px);
}
.dark .bio-social-link {
  background: var(--hb-neutral-800);
  color: var(--hb-neutral-400);
}
.dark .bio-social-link:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--hb-primary-300);
}

/* 右侧栏 */
.bio-main {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.bio-section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.bio-section-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--hb-fg);
}

.bio-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  background: var(--hb-primary-100);
  color: var(--hb-primary-600);
}
.dark .bio-section-icon {
  background: rgba(99, 102, 241, 0.15);
  color: var(--hb-primary-300);
}

.bio-summary-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--hb-fg-secondary);
}

.bio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.3rem;
}

.bio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  background: #6b7c99;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-base);
  border: none;
  border-bottom: 3px solid #4a5a75;
  box-shadow: none;
}
.bio-btn:hover {
  background: #5d6e8a;
  border-bottom: 3px solid #4a5a75;
  box-shadow: none;
  transform: translateY(-1px);
}
.bio-btn:active {
  transform: translateY(1px);
  border-bottom-width: 1px;
}

.bio-btn-secondary {
  background: #6b7c99;
  color: #ffffff;
  border: none;
  border-bottom: 3px solid #4a5a75;
  box-shadow: none;
}
.bio-btn-secondary:hover {
  background: #5d6e8a;
  border-color: transparent;
  border-bottom: 3px solid #4a5a75;
  box-shadow: none;
}
.dark .bio-btn-secondary {
  background: #6b7c99;
  color: #ffffff;
  border: none;
  border-bottom: 3px solid #4a5a75;
}
.dark .bio-btn-secondary:hover {
  background: #5d6e8a;
  border-bottom: 3px solid #4a5a75;
}

/* 核心能力卡片 */
.ability-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}

.ability-card {
  border: 1px solid var(--hb-card-border);
  border-radius: var(--radius-2xl);
  background: var(--hb-card-bg);
  padding: 1.8rem 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
  min-height: auto;
}
.ability-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--hb-primary-200);
}

.ability-card-inner {
  display: flex;
  align-items: flex-start;
  height: 100%;
}

.ability-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.ability-card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--hb-fg);
  line-height: 1.25;
}

.ability-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ability-card-body p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--hb-fg-secondary);
}

.ability-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--hb-primary-600);
}

/* Rank 1 突出显示 */
.ability-card-featured .ability-card-title {
  font-size: 1.7rem;
  color: var(--hb-primary-700);
}

.ability-card-featured .ability-card-body p {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--hb-primary-600);
}

/* 响应式 */
@media (max-width: 980px) {
  .bio-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .bio-sidebar {
    flex-direction: row;
    text-align: left;
    gap: 1.5rem;
    align-items: flex-start;
  }
  .bio-info {
    align-items: flex-start;
    text-align: left;
  }
  .bio-avatar-wrap {
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .bio-avatar {
    width: 140px;
    height: 180px;
  }
  .bio-social {
    justify-content: flex-start;
  }
  .ability-grid {
    grid-template-columns: 1fr;
  }
  .hero.hero-biography {
    margin: -2.5rem -1.25rem 0;
    padding: 3rem 1.5rem 2rem;
  }
}

@media (max-width: 640px) {
  .bio-sidebar {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  .bio-info {
    align-items: center;
    text-align: center;
  }
  .bio-avatar {
    width: 160px;
    height: 200px;
  }
  .bio-actions {
    flex-direction: column;
  }
  .bio-btn {
    justify-content: center;
  }
  .hero.hero-biography {
    margin: -2.5rem -1.25rem 0;
    padding: 2.5rem 1rem 2rem;
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 1.1rem;
  align-items: center;
}

.hero-kicker {
  margin: 0;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3 {
  font-family: "Inter", "Noto Serif SC", "Songti SC", serif;
}

.home-page {
  background:
    radial-gradient(ellipse 80% 60% at 8% 18%, rgba(224, 231, 255, 0.55) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 92% 85%, rgba(204, 251, 241, 0.35) 0%, transparent 50%),
    var(--hb-bg);
}

.dark .home-page {
  background:
    radial-gradient(ellipse 70% 50% at 12% 22%, rgba(30, 58, 138, 0.30) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 88% 88%, rgba(6, 182, 212, 0.10) 0%, transparent 50%),
    var(--hb-bg);
}

.home-page .brand-main,
.home-page h1,
.home-page h2,
.home-page h3 {
  font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.01em;
}

h1 {
  margin: 0.45rem 0 0.5rem;
  font-size: clamp(2rem, 4.8vw, 3rem);
  line-height: 1.16;
}

.hero-subtitle {
  margin: 0;
  font-size: 1.36rem;
  font-weight: 700;
  color: var(--hb-primary-600);
}

.hero-summary {
  margin: 0.8rem 0 0;
  color: var(--hb-fg-secondary);
  font-size: 1.17rem;
  font-weight: 550;
  line-height: 1.82;
}

.hero-photo-wrap {
  justify-self: end;
}

.hero-photo {
  width: 190px;
  height: 230px;
  object-fit: cover;
  border-radius: var(--radius-2xl);
  border: 2px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  transition: var(--transition-base);
}
.hero-photo:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-xl);
}

.metric-grid {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 0.8rem;
}

.metric-card {
  margin: 0;
  border: 1px solid var(--hb-card-border);
  background: var(--hb-card-bg);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  padding: 0.95rem;
  transition: var(--transition-base);
}

.metric-card-academic {
  background: linear-gradient(135deg, var(--surface), rgba(238, 242, 255, 0.65));
}

.metric-card-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.metric-title {
  margin: 0;
  font-size: 0.84rem;
  color: var(--hb-primary-600);
  font-weight: 700;
}

.rank-main {
  margin: 0.35rem 0 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--hb-primary-600);
}

.rank-sub {
  margin: 0.25rem 0 0;
  font-size: 0.99rem;
  font-weight: 700;
  color: var(--hb-primary-600);
}

.metric-value {
  margin: 0.35rem 0;
  font-size: 1.03rem;
  font-weight: 700;
  color: var(--hb-primary-600);
}

.teacher-link {
  color: var(--hb-secondary-600);
  text-decoration: none;
  border-bottom: 1px dashed rgba(45, 212, 191, 0.48);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.teacher-link:hover {
  color: var(--hb-secondary-700);
  border-bottom-color: rgba(13, 148, 136, 0.7);
}

.metric-note {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--hb-muted);
}

.panel {
  margin-top: 2.5rem;
  background: var(--hb-card-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--hb-card-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 1.35rem;
  transition: var(--transition-base);
}
.panel:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xl);
}

.panel h2 {
  margin: 0;
  font-size: 1.35rem;
}

.panel-spacious > h2 {
  margin: 0 0 1.12rem;
}

.section-note {
  margin: 0.5rem 0 0.9rem;
  font-size: 0.89rem;
  color: var(--hb-muted);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.course-card {
  border: 1px solid var(--hb-card-border);
  border-radius: var(--radius-2xl);
  background: var(--hb-card-bg);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  padding: 0.78rem 0.92rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 0.8rem;
  transition: var(--transition-base);
}

.course-card-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, background 0.18s ease;
}

.course-card-link:hover {
  transform: translateY(-2px);
  background: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.course-name {
  font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.012em;
  line-height: 1.44;
  color: var(--hb-primary-600);
}

.course-score {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--hb-primary-600);
}

.course-action {
  grid-column: 1 / span 2;
  margin-top: 0.34rem;
  font-size: 0.78rem;
  color: var(--hb-primary-500);
  font-weight: 700;
}

.course-card-static {
  background: rgba(244,239,230,0.55);
}

.exp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.exp-item {
  margin: 0;
  border: 1px solid var(--hb-card-border);
  border-radius: var(--radius-2xl);
  padding: 0.9rem;
  background: var(--hb-card-bg);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
}
.exp-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.exp-date {
  margin: 0;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--hb-primary-600);
}

.exp-item h3 {
  margin: 0.36rem 0 0;
  font-size: 1.05rem;
}

.exp-item p {
  margin: 0.46rem 0 0;
  color: var(--hb-fg-secondary);
  line-height: 1.65;
}

.exp-item-core {
  min-height: 100%;
}

.exp-item-wide {
  grid-column: 1 / -1;
}

.exp-advisor {
  margin: 0.52rem 0 0;
  color: var(--hb-primary-600);
  font-weight: 700;
}

.exp-item > a {
  display: inline-block;
  margin-top: 0.54rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}

.exp-item > a:hover {
  text-decoration: underline;
}

.skill-work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.nested-grid {
  margin-top: 0.78rem;
  display: grid;
  gap: 0.8rem;
}

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

.nested-grid-1 {
  grid-template-columns: 1fr;
}

.nested-card {
  border: 1px solid var(--hb-card-border);
  border-radius: var(--radius-2xl);
  padding: 0.92rem 0.96rem;
  background: var(--hb-card-bg);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
}
.nested-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.nested-card-wide {
  grid-column: 1 / -1;
}

.nested-card-highlight {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.95), var(--hb-card-bg));
}

.nested-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nested-head h3 {
  margin: 0;
  font-size: 1.04rem;
  color: var(--hb-primary-700);
}

.nested-hint {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hb-primary-600);
  background: var(--primary-light);
  border: 1px solid var(--hb-neutral-200);
}

.nested-label {
  margin: 0;
  color: var(--hb-primary-600);
  font-size: 0.97rem;
  font-weight: 800;
}

.nested-text {
  margin: 0.5rem 0 0;
  color: var(--hb-fg-secondary);
  line-height: 1.68;
}

.skills-badge-note {
  margin: 0.52rem 0 0;
  color: var(--hb-fg-secondary);
  font-size: 0.9rem;
}

.skill-badge-wall {
  margin-top: 0.58rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.46rem;
}

.skill-badge-wall img {
  height: 1.34rem;
  width: auto;
  border-radius: 6px;
  border: 1px solid var(--hb-card-border);
  background: var(--hb-card-bg);
}

.skills-inline-note {
  margin: 0.58rem 0 0;
  color: var(--hb-fg-secondary);
  line-height: 1.66;
}

.detail-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.62rem;
  padding: 0.24rem 0.72rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--hb-neutral-200);
  background: var(--primary-light);
  color: var(--hb-primary-600);
  font-size: 0.79rem;
  font-weight: 800;
  text-decoration: none;
}

.detail-action:hover {
  background: #ddf0e4;
  color: var(--hb-primary-700);
  text-decoration: none;
}

.detail-action-inline {
  margin-top: 0;
}

.github-stat-card {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(238, 242, 255, 0.94));
}

.github-stat-split {
  margin-top: 0.62rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: stretch;
}

.github-stat-block {
  border: 1px solid rgba(72, 89, 108, 0.62);
  border-radius: var(--radius-2xl);
  background: linear-gradient(165deg, #222735 0%, #1b202c 100%);
  padding: 0.6rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.github-stat-subtitle {
  margin: 0;
  color: var(--hb-muted);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.github-contrib-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.github-stat-frame {
  margin-top: 0.52rem;
  border: none;
  border-radius: var(--radius-2xl);
  padding: 0.4rem 0.2rem 0.2rem;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 12rem;
}

.github-stat-image {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-2xl);
  border: none;
  background: #0d1117;
  box-shadow: 0 8px 20px rgba(6,10,18,0.45);
}

.github-contrib-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-2xl);
  border: none;
  background: #0d1117;
  box-shadow: 0 8px 20px rgba(6,10,18,0.45);
}

.github-stat-card .detail-action {
  border-color: rgba(141, 176, 154, 0.45);
  background: rgba(30, 45, 38, 0.75);
  color: #e0e7ff;
}

.github-stat-card .detail-action:hover {
  background: rgba(37, 56, 46, 0.88);
  color: #eef2ff;
}

.work-entry + .work-entry {
  margin-top: 0.8rem;
  padding-top: 0.78rem;
  border-top: 1px dashed var(--line-strong);
}

.work-title {
  margin: 0.35rem 0 0;
  color: var(--hb-primary-600);
  font-weight: 800;
  line-height: 1.56;
}

.work-desc {
  margin: 0.45rem 0 0;
  color: var(--hb-fg-secondary);
  line-height: 1.68;
}

.work-honor {
  margin: 0.8rem 0 0;
  padding: 0.58rem 0.68rem;
  border: 1px solid var(--hb-neutral-200);
  border-radius: var(--radius-2xl);
  background: var(--hb-primary-50);
  color: var(--hb-primary-600);
  font-weight: 700;
}

.panel-highlight {
  border-color: rgba(99, 102, 241, 0.3);
  background: var(--hb-card-bg);
}

.mentor-note {
  margin: 0.74rem 0 0.95rem;
  line-height: 1.72;
  color: var(--hb-fg-secondary);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.contact-grid p {
  margin: 0;
}

.contact-grid a {
  color: var(--blue);
}

.contact-map-wrap {
  margin-top: 1rem;
}

.map-title {
  margin: 0 0 0.55rem;
  color: var(--hb-primary-600);
  font-weight: 800;
}

.amap-wrapper {
  position: relative;
  border: 1px solid rgba(99, 102, 241, 0.26);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: #081425;
  box-shadow: 0 10px 24px var(--line-subtle);
  isolation: isolate;
}

.campus-model-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.campus-model-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.amap-canvas {
  width: 100%;
  height: 360px;
  position: relative;
  z-index: 3;
  background: transparent;
  opacity: 0.88;
}

.map-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 12;
  display: flex;
  gap: 0.45rem;
}

.map-toggle {
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: var(--hb-card-bg);
  color: var(--hb-primary-600);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.24rem 0.62rem;
  cursor: pointer;
}

.map-toggle:hover {
  background: var(--hb-card-bg);
}

.map-toggle.is-on {
  color: #ffffff;
  background: var(--hb-primary-500);
  border-color: var(--hb-primary-500);
}

.map-note {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--hb-muted);
}

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--hb-muted);
  padding: 0.65rem 1rem 1.6rem;
  font-size: 0.85rem;
  border-top: 1px solid var(--hb-card-border);
  margin-top: 1rem;
}

.site-footer a {
  color: inherit;
}

.footer-visit-count {
  display: inline-block;
  min-width: 2ch;
  font-weight: 700;
  color: var(--hb-primary-600);
  background: var(--hb-primary-50);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-md);
}

.reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.placeholder {
  max-width: 920px;
  margin: 1.5rem auto;
}

.placeholder-card {
  border: 1px dashed rgba(99, 102, 241, 0.34);
  border-radius: var(--radius-2xl);
  background: var(--hb-card-bg);
  padding: 1.25rem;
}

.placeholder-card p,
.placeholder-card li {
  color: var(--hb-muted);
  line-height: 1.7;
}

.text-list {
  margin: 0.3rem 0 0;
  padding-left: 1.16rem;
}

.detail-page {
  max-width: 1250px;
  margin: 1.5rem auto;
  background: var(--hb-card-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--hb-card-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 1.4rem;
  position: relative;
  transition: var(--transition-base);
}
.detail-page:hover {
  box-shadow: var(--shadow-xl);
}

.detail-page h1 {
  margin-top: 0;
  font-size: clamp(1.45rem, 3.2vw, 2rem);
}

.detail-page-award {
  min-height: 13.5rem;
  padding-left: 16.2rem;
}

.detail-award-corner {
  position: absolute;
  left: 1.15rem;
  top: 1.15rem;
  width: 13.4rem;
  height: 10.2rem;
  object-fit: cover;
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 8px 20px rgba(47, 106, 71, 0.2);
  background: #fff;
}

.detail-meta {
  color: var(--hb-primary-600);
  font-size: 0.92rem;
  font-weight: 700;
}

.detail-page p {
  color: var(--hb-muted);
  line-height: 1.78;
}

.detail-course-page {
  max-width: 1250px;
  background: var(--hb-card-bg);
  backdrop-filter: blur(8px);
  border-color: var(--hb-card-border);
}

.detail-course-page p {
  color: var(--hb-fg-secondary);
}

.detail-course-page code {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 0.92em;
  background: var(--primary-soft);
  border-radius: 4px;
  padding: 0.02rem 0.22rem;
}

.course-mentor-line {
  margin: 0.22rem 0 0.9rem;
  color: var(--hb-primary-700);
  font-size: 0.98rem;
  font-weight: 700;
}

.course-mentor-line a {
  color: var(--hb-primary-600);
  text-decoration: none;
  border-bottom: 1px dashed rgba(79, 70, 229, 0.45);
}

.course-mentor-line a:hover {
  color: var(--hb-primary-800);
}

.detail-section-block + .detail-section-block {
  margin-top: 1rem;
}

.detail-subtitle {
  margin: 0 0 0.55rem;
  font-size: 14pt;
  color: var(--hb-primary-700);
  font-family: "Noto Sans SC", "Source Han Sans SC", "SimHei", "STHeiti", sans-serif;
  font-weight: 700;
}

.detail-link-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, var(--hb-primary-500), var(--hb-primary-600));
  border: 1px solid transparent;
  color: #ffffff;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
}

.detail-link-btn:hover {
  background: linear-gradient(135deg, var(--hb-primary-600), var(--hb-primary-700));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.detail-bullet-list {
  margin: 0.55rem 0 0;
  padding-left: 1.2rem;
}

.detail-bullet-list li {
  margin-top: 0.48rem;
  color: var(--hb-fg-secondary);
  line-height: 1.7;
}

.detail-preview-image {
  display: block;
  width: 100%;
  max-width: 680px;
  margin-top: 0.9rem;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--hb-neutral-200);
}

.detail-file-title {
  margin: 1rem 0 0.45rem;
  color: var(--hb-primary-600);
  font-weight: 700;
}

.detail-file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.detail-file-grid a {
  display: block;
  text-decoration: none;
  border: 1px solid var(--hb-neutral-200);
  border-radius: var(--radius-2xl);
  background: rgba(247,243,235,0.78);
  color: var(--hb-primary-700);
  padding: 0.6rem 0.72rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.detail-file-grid a:hover {
  background: var(--primary-light);
}

.mentor-intro {
  margin: 0;
  color: var(--hb-fg-secondary);
  line-height: 1.8;
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", "STSong", serif;
  font-size: 12pt;
}

.intro-context-block {
  border: 1px solid var(--hb-neutral-200);
  border-radius: var(--radius-2xl);
  background: rgba(255, 253, 247, 0.86);
  padding: 0.9rem;
}

.intro-context-block .detail-subtitle {
  margin-bottom: 0.45rem;
}

.intro-context-block .mentor-intro + .mentor-intro {
  margin-top: 0.45rem;
}

.score-highlight {
  margin: 0.6rem 0 0;
  padding: 0.62rem 0.72rem;
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(99, 102, 241, 0.34);
  background: linear-gradient(135deg, rgba(233, 247, 239, 0.95), rgba(255, 249, 239, 0.9));
  color: var(--hb-primary-700);
  font-size: 1.02rem;
  line-height: 1.62;
}

.summary-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.summary-grid-single {
  grid-template-columns: 1fr;
}

.summary-card {
  border: 1px solid rgba(99, 102, 241, 0.26);
  border-radius: var(--radius-2xl);
  background: rgba(250, 246, 238, 0.85);
  padding: 0.75rem;
}

.summary-card-expanded {
  padding: 0.95rem 1rem;
}

.summary-card h3 {
  margin: 0;
  font-size: 0.98rem;
  color: var(--hb-primary-600);
}

.summary-card p {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  line-height: 1.72;
  color: var(--hb-fg-secondary);
}

.summary-card-expanded {
  padding: 0.95rem 1rem;
}

.detail-number-list {
  margin: 0;
  padding-left: 1.2rem;
}

.detail-number-list li {
  margin-top: 0.46rem;
  color: var(--hb-fg-secondary);
  line-height: 1.72;
}

.flow-intro {
  margin: 0;
  color: var(--hb-fg-secondary);
  line-height: 1.8;
}

.flow-pipeline {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.52rem;
}

.flow-step {
  border: 1px solid var(--hb-card-border);
  border-left: 4px solid rgba(99, 102, 241, 0.75);
  border-radius: var(--radius-2xl);
  background: var(--hb-card-bg);
  padding: 0.62rem 0.72rem;
}

.flow-step h3 {
  margin: 0;
  font-size: 0.94rem;
  color: var(--hb-primary-600);
}

.flow-step p {
  margin: 0.4rem 0 0;
  color: var(--hb-fg-secondary);
  line-height: 1.68;
  font-size: 0.88rem;
}

.flow-inline-code {
  margin: 0.72rem 0 0;
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-2xl);
  background: rgba(240, 247, 242, 0.75);
  padding: 0.5rem 0.62rem;
  color: var(--hb-primary-600);
  font-weight: 700;
  line-height: 1.6;
}

.flow-subtitle {
  margin: 0.85rem 0 0.15rem;
  font-size: 1rem;
  color: var(--hb-primary-600);
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.principle-card {
  border: 1px solid rgba(99, 102, 241, 0.23);
  border-radius: var(--radius-2xl);
  background: var(--hb-card-bg);
  padding: 0.72rem;
}

.principle-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--hb-primary-600);
}

.principle-card p {
  margin: 0.43rem 0 0;
  color: var(--hb-fg-secondary);
  font-size: 0.88rem;
  line-height: 1.68;
}

.module-table-wrap {
  overflow-x: auto;
}

.module-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 670px;
}

.module-table th,
.module-table td {
  border: 1px solid var(--hb-card-border);
  padding: 0.55rem 0.62rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.62;
}

.module-table th {
  background: var(--hb-primary-50);
  color: var(--hb-primary-600);
  font-size: 0.86rem;
}

.module-table td {
  color: var(--hb-fg-secondary);
  font-size: 0.86rem;
}

.code-title {
  margin: 0.7rem 0 0.4rem;
  color: var(--hb-primary-600);
  font-weight: 700;
}

.code-snippet {
  margin: 0;
  border: 1px solid var(--hb-neutral-200);
  border-radius: var(--radius-2xl);
  padding: 0.7rem 0.76rem;
  background: #f6f9f7;
  color: var(--hb-fg-secondary);
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.58;
}

.code-snippet code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.dual-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: stretch;
}

.dual-preview-card {
  border-radius: var(--radius-2xl);
  padding: 0.82rem;
  min-height: 26rem;
}

.note-preview-block {
  border: 1px solid rgba(99, 102, 241, 0.28);
  background: var(--hb-card-bg);
}

.note-preview-frame {
  display: block;
  width: 100%;
  height: 18.5rem;
  border: 1px solid rgba(99, 102, 241, 0.24);
  border-radius: var(--radius-2xl);
  margin-top: 0.55rem;
  background: var(--hb-card-bg);
}

.md-preview {
  margin: 0.6rem 0 0;
  border: 1px solid var(--hb-neutral-200);
  border-radius: var(--radius-2xl);
  padding: 0.7rem 0.75rem;
  background: #fffdf8;
  color: var(--hb-fg-secondary);
  font-size: 0.84rem;
  line-height: 1.66;
  max-height: 20rem;
  overflow: auto;
  white-space: pre-wrap;
}

.github-dark-block {
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: var(--radius-2xl);
  background: var(--hb-card-bg);
  padding: 0.95rem;
}

.github-dark-block .detail-subtitle {
  color: var(--hb-primary-700);
}

.github-dark-card {
  display: block;
  text-decoration: none;
  border: 1px solid rgba(99, 102, 241, 0.24);
  border-radius: var(--radius-2xl);
  background: #f7fbf8;
  padding: 0.8rem;
  color: var(--hb-fg-secondary);
}

.github-dark-head {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.6rem;
}

.github-dark-tag {
  font-size: 0.8rem;
  color: var(--hb-primary-600);
  font-weight: 700;
}

.github-dark-repo {
  margin: 0.5rem 0 0;
  color: var(--hb-primary-700);
  font-weight: 800;
}

.github-dark-desc {
  margin: 0.38rem 0 0;
  color: var(--hb-fg-secondary);
  font-size: 0.9rem;
  font-weight: 700;
}

.github-dark-og {
  margin-top: 0.72rem;
  width: 100%;
  max-height: 20rem;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(99, 102, 241, 0.24);
  background: var(--hb-card-bg);
  display: block;
}

.detail-back {
  display: inline-block;
  margin-top: 0.9rem;
  text-decoration: none;
  color: var(--blue);
  font-weight: 700;
}

.detail-back:hover {
  text-decoration: underline;
}

.rv32-detail-page {
  max-width: 1080px;
  --rv32-rail-width: 14rem;
  --rv32-toc-width: 11rem;
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", "STSong", serif;
  font-size: 12pt;
  line-height: 1.8;
}

.rv32-hero {
  margin-left: 0;
  min-height: 12.8rem;
  border: 1px solid var(--hb-card-border);
  border-radius: var(--radius-2xl);
  background: var(--hb-card-bg);
  padding: 1rem;
}

.rv32-hero-summary {
  margin: 0.55rem 0 0;
  line-height: 1.8;
  color: var(--hb-fg-secondary);
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", "STSong", serif;
  font-size: 12pt;
}

.rv32-pill-row {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.rv32-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--hb-neutral-200);
  border-radius: var(--radius-full);
  background: var(--hb-card-bg);
  color: var(--hb-primary-600);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.22rem 0.7rem;
}

.rv32-layout {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.rv32-side {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  align-self: start;
  z-index: 6;
}

.rv32-toc {
  position: static;
  border: 1px solid var(--hb-card-border);
  border-radius: var(--radius-2xl);
  background: var(--hb-card-bg);
  padding: 0.75rem;
  display: grid;
  gap: 0.36rem;
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow: auto;
}

.rv32-toc-title {
  margin: 0 0 0.2rem;
  color: var(--hb-primary-600);
  font-weight: 800;
  font-size: 0.9rem;
}

.rv32-toc a {
  text-decoration: none;
  color: var(--hb-fg);
  font-size: 0.86rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 0.24rem 0.42rem;
}

.rv32-toc a:hover,
.rv32-toc a.active {
  background: var(--hb-primary-50);
  color: var(--hb-primary-600);
}

.dark .rv32-toc-title {
  color: var(--hb-primary-300);
}

.dark .rv32-toc a:hover,
.dark .rv32-toc a.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--hb-primary-300);
}

.rv32-content {
  grid-column: 2;
  min-width: 0;
}

.rv32-section + .rv32-section {
  margin-top: 1rem;
}

.rv32-summary-grid {
  margin-top: 0.65rem;
}

.rv32-media-grid,
.rv32-video-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.rv32-detail-page .image-card {
  margin: 0;
  border: 1px solid var(--hb-card-border);
  border-radius: var(--radius-2xl);
  background: var(--hb-card-bg);
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(47, 106, 71, 0.1);
}

.rv32-detail-page .image-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 22rem;
  object-fit: contain;
  background: transparent;
}

.rv32-detail-page .image-card figcaption {
  padding: 0.58rem 0.7rem 0.72rem;
  color: var(--hb-fg-secondary);
  font-size: 0.82rem;
  line-height: 1.6;
}

.rv32-detail-page .video-card video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 24rem;
  background: #000;
}

/* Award image placed in sidebar above TOC */
.ai-fixed-award {
  max-width: 11rem;
  margin: 0 0 0.75rem;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid var(--hb-card-border);
  background: var(--hb-card-bg);
}

.ai-fixed-award img {
  display: block;
  width: 100%;
  height: auto;
}

.rv32-sidebar-award {
  max-width: 11rem;
  margin: 0 0 0.75rem;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid var(--hb-card-border);
  background: var(--hb-card-bg);
}

.rv32-sidebar-award img {
  display: block;
  width: 100%;
  height: auto;
}

.rv32-sidebar-award figcaption {
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
  color: var(--hb-muted);
  text-align: center;
}

.ai-pattern-layout {
  margin-top: 0.78rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
}

.ai-pattern-stack {
  display: grid;
  gap: 0.8rem;
}

.ai-pattern-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.rv32-detail-page .ai-equal-height-card img {
  height: 22rem;
  max-height: none;
  object-fit: contain;
}

.ai-rotate-left-frame {
  display: block;
}

.ai-rotate-left-media {
  min-height: 22rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.2rem;
  background: transparent;
  overflow: hidden;
}

.rv32-detail-page .ai-rotate-left-img {
  width: auto;
  height: min(19.2rem, 40vw);
  max-width: none;
  max-height: none;
  margin: 0 auto;
  transform: rotate(-90deg);
  transform-origin: center;
}

.rv32-zoomable {
  cursor: zoom-in;
}

.rv32-pdf-wrap {
  margin-top: 0.75rem;
}

.rv32-pdf-frame {
  width: 100%;
  height: min(78vh, 920px);
  border: 1px solid var(--hb-card-border);
  border-radius: var(--radius-2xl);
  background: #fff;
}

.rv32-resource-title {
  margin: 1rem 0 0.45rem;
  font-size: 1rem;
  color: var(--hb-primary-700);
}

.rv32-file-grid {
  margin-bottom: 0.25rem;
}

.rv32-manual-actions {
  margin-top: 0.55rem;
}

.rv32-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  z-index: 20000;
  padding: 1.25rem;
}

.rv32-lightbox.open {
  display: flex;
}

.rv32-lightbox-panel {
  width: min(1040px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: var(--radius-2xl);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.rv32-lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.78rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--hb-card-bg);
  position: sticky;
  top: 0;
}

.rv32-lightbox-title {
  color: var(--hb-fg);
  font-weight: 900;
  font-size: 0.9rem;
}

.rv32-lightbox-close {
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: var(--radius-2xl);
  padding: 0.32rem 0.62rem;
  background: var(--hb-card-bg);
  color: var(--hb-fg);
  font-weight: 800;
  cursor: pointer;
}

.rv32-lightbox-body {
  padding: 0.85rem;
}

.rv32-lightbox-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.rv32-lightbox-body img.rv32-lightbox-rotate-left {
  width: auto;
  max-width: min(84vh, 95vw);
  max-height: min(84vw, 82vh);
  transform: rotate(-90deg);
  transform-origin: center;
}

.assistant-dock {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 13000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.assistant-fab {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--hb-neutral-200);
  border-radius: var(--radius-full);
  background: var(--hb-card-bg);
  color: var(--hb-primary-600);
  padding: 0.5rem 0.95rem 0.5rem 0.55rem;
  font-size: 0.93rem;
  font-weight: 800;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.assistant-fab:hover {
  background: var(--hb-card-bg);
  transform: translateY(-1px);
}

.assistant-fab-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, var(--hb-primary-500) 0%, var(--hb-primary-600) 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.assistant-fab-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-dock .assistant-shell {
  width: min(23.5rem, calc(100vw - 1.5rem));
  height: min(34rem, calc(100vh - 8rem));
  display: none;
  flex-direction: column;
  border: 1px solid var(--hb-card-border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: var(--hb-card-bg);
  box-shadow: var(--shadow-xl);
}

.assistant-dock.is-open .assistant-shell {
  display: flex;
}

.assistant-shell-header,
.assistant-page-shell-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.95rem 1rem 0.75rem;
  border-bottom: 1px solid var(--primary-soft);
  background: linear-gradient(135deg, var(--hb-card-bg), var(--hb-primary-50));
}

.assistant-shell-kicker {
  margin: 0;
  color: var(--hb-primary-500);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistant-shell-header h2,
.assistant-page-shell-head h2 {
  margin: 0.18rem 0 0;
  font-size: 1.04rem;
  color: var(--hb-primary-700);
}

.assistant-shell-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.assistant-shell-action {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hb-neutral-200);
  border-radius: var(--radius-2xl);
  background: var(--hb-card-bg);
  color: var(--hb-primary-700);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.assistant-shell-action:hover {
  background: var(--hb-card-bg);
}

.assistant-status {
  margin: 0.28rem 0 0;
  color: var(--hb-muted);
  font-size: 0.79rem;
  line-height: 1.5;
}

.assistant-status[data-tone="ready"] {
  color: var(--hb-primary-600);
}

.assistant-status[data-tone="error"] {
  color: var(--hb-primary-600);
}

.assistant-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.95rem;
  background:
    radial-gradient(circle at top left, var(--hb-bg-soft) 0%, transparent 42%),
    linear-gradient(180deg, var(--hb-bg-soft), var(--hb-card-bg));
}

.assistant-message {
  display: grid;
  gap: 0.24rem;
  margin-bottom: 0.85rem;
}

.assistant-message-user {
  justify-items: end;
}

.assistant-message-assistant {
  justify-items: start;
}

.assistant-message-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--hb-muted);
}

.assistant-message-bubble {
  max-width: min(100%, 38rem);
  padding: 0.72rem 0.84rem;
  border-radius: var(--radius-2xl);
  line-height: 1.72;
  font-size: 0.93rem;
  word-break: break-word;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.08);
  background: var(--hb-card-bg);
  color: var(--hb-fg);
  border: 1px solid var(--hb-card-border);
}

.assistant-message-bubble p {
  margin: 0;
}

.assistant-message-bubble p + p,
.assistant-message-bubble p + ul,
.assistant-message-bubble p + ol,
.assistant-message-bubble ul + p,
.assistant-message-bubble ol + p,
.assistant-message-bubble ul + ul,
.assistant-message-bubble ol + ol,
.assistant-message-bubble ul + ol,
.assistant-message-bubble ol + ul {
  margin-top: 0.72rem;
}

.assistant-message-bubble ul,
.assistant-message-bubble ol {
  margin: 0;
  padding-left: 1.2rem;
}

.assistant-message-bubble li + li {
  margin-top: 0.28rem;
}

.assistant-message-bubble strong {
  font-weight: 800;
}

.assistant-message-bubble code {
  padding: 0.08rem 0.34rem;
  border-radius: 0.4rem;
  background: var(--primary-soft);
  font-size: 0.92em;
}

.assistant-message-assistant .assistant-message-bubble {
  background: var(--hb-card-bg);
  color: var(--hb-fg-secondary);
  border: 1px solid var(--hb-card-border);
  border-top-left-radius: 8px;
}

.assistant-message-user .assistant-message-bubble {
  background: linear-gradient(135deg, var(--hb-primary-500), var(--hb-primary-600));
  color: #ffffff;
  border-top-right-radius: 8px;
}

.assistant-message-user .assistant-message-bubble code {
  background: rgba(255, 255, 255, 0.18);
}

.assistant-message-bubble a {
  color: var(--hb-primary-600);
  font-weight: 700;
}

.assistant-message-user .assistant-message-bubble a {
  color: #ffffff;
}

.assistant-message-typing .assistant-message-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  min-height: 2.6rem;
}

.assistant-typing-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: var(--radius-full);
  background: #6f9b7f;
  animation: assistantTyping 1s ease-in-out infinite;
}

.assistant-typing-dot:nth-child(2) {
  animation-delay: 0.14s;
}

.assistant-typing-dot:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes assistantTyping {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-0.18rem);
    opacity: 1;
  }
}

.assistant-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem 0.95rem;
  border-top: 1px solid var(--primary-soft);
  background: var(--surface-raised);
}

.assistant-input {
  width: 100%;
  border: 1px solid var(--hb-card-border);
  border-radius: var(--radius-2xl);
  background: var(--hb-card-bg);
  color: var(--hb-fg-secondary);
  padding: 0.74rem 0.82rem;
  font-size: 0.95rem;
  outline: none;
}

.assistant-input:focus {
  border-color: rgba(47, 106, 71, 0.6);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.assistant-send {
  border: none;
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, var(--hb-primary-500), var(--hb-primary-600));
  color: #ffffff;
  padding: 0 1rem;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  min-width: 4.25rem;
}

.assistant-send:hover {
  filter: brightness(1.03);
}

.assistant-send:disabled,
.assistant-input:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.assistant-page-main {
  max-width: 1100px;
}

.assistant-page-intro {
  margin-top: 1rem;
}

.assistant-page-summary {
  margin: 0.78rem 0 0;
  color: var(--hb-fg-secondary);
  line-height: 1.8;
  font-size: 1.02rem;
}

.assistant-page-note {
  margin: 0.55rem 0 0;
  color: var(--hb-muted);
  line-height: 1.7;
}

.assistant-suggestion-list {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.assistant-suggestion {
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-full);
  background: var(--hb-card-bg);
  color: var(--hb-primary-700);
  padding: 0.48rem 0.85rem;
  font-size: 0.87rem;
  font-weight: 700;
  cursor: pointer;
}

.assistant-suggestion:hover {
  background: var(--primary-light);
}

.assistant-page-shell {
  margin-top: 1rem;
  padding: 0;
  overflow: hidden;
}

.assistant-page-shell .assistant-messages {
  height: min(62vh, 42rem);
  padding-top: 1rem;
}

.assistant-page-shell .assistant-message-bubble {
  max-width: min(100%, 52rem);
}

@media (max-width: 1220px) {
  .site-nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.42rem);
    left: 1rem;
    right: 1rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.65rem;
    padding: 0.9rem;
    border: 1px solid var(--hb-card-border);
    border-radius: var(--radius-2xl);
    background: var(--hb-card-bg);
    box-shadow: var(--shadow-lg);
    max-height: min(calc(100vh - var(--header-h) - 1.4rem), 34rem);
    overflow: auto;
  }

  .site-header.is-nav-open .site-nav {
    display: flex;
  }

  .nav-item-group {
    display: grid;
    gap: 0.35rem;
  }

  .site-nav > a,
  .site-nav .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 0.58rem 0.78rem;
    border-radius: var(--radius-2xl);
  }

  .site-nav .has-submenu > .nav-link::after {
    content: "";
    margin: 0;
  }

  .nav-submenu {
    position: static;
    min-width: 0;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 0 0 0 0.45rem;
    border: none;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    gap: 0.32rem;
  }

  .nav-item-group:hover > .nav-submenu,
  .nav-item-group:focus-within > .nav-submenu {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .site-nav .nav-submenu a {
    padding: 0.45rem 0.72rem;
    border-radius: var(--radius-2xl);
    background: rgba(247,243,235,0.88);
    font-size: 0.84rem;
  }

  .site-nav .nav-item-group:nth-last-child(-n + 2) .nav-submenu {
    left: 0;
    right: auto;
  }
}

@media (max-width: 1120px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card-academic {
    grid-column: 1 / -1;
  }

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

  .rv32-layout {
    grid-template-columns: 1fr;
  }

  .rv32-side {
    grid-column: 1;
    justify-self: stretch;
    transform: none;
    position: static;
    left: auto;
    top: auto;
    width: auto;
    z-index: auto;
    margin-bottom: 1rem;
  }

  .rv32-toc {
    position: static;
    gap: 0.28rem;
    max-height: none;
    overflow: visible;
  }

  .rv32-content {
    grid-column: 1;
  }

  .rv32-toc a {
    padding: 0.3rem 0.45rem;
  }
}

/* Sidebar layout: TOC sits reliably beside content */
main.container.has-sidebar {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2.5rem;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 1440px) {
  main.container.has-sidebar {
    gap: 4rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

main.container.has-sidebar .rv32-side {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  width: var(--rv32-toc-width);
  flex-shrink: 0;
  align-self: flex-start;
  order: -1;
  margin-top: 1.5rem;
}

main.container.has-sidebar .rv32-detail-page {
  flex-shrink: 0;
  width: 1080px;
  margin: 1.5rem 0;
  padding: 1rem;
}

/* Full-bleed images inside detail pages with sidebar */
main.container.has-sidebar .rv32-detail-page .image-card {
  margin-left: -1rem;
  margin-right: -1rem;
  border-radius: var(--radius-md);
}

main.container.has-sidebar .rv32-detail-page .image-card img {
  border-radius: 0;
}

/* Medium/small screens: stack vertically */
@media (max-width: 1200px) {
  main.container.has-sidebar {
    flex-direction: column;
    align-items: stretch;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  main.container.has-sidebar .rv32-side {
    position: static;
    width: auto;
    order: 0;
    margin-bottom: 1rem;
  }

  main.container.has-sidebar .rv32-detail-page {
    width: auto;
    max-width: 1080px;
    margin: 1.5rem auto;
    padding: 1.4rem;
  }

  main.container.has-sidebar .rv32-detail-page .image-card {
    margin-left: 0;
    margin-right: 0;
    border-radius: var(--radius-2xl);
  }

  .ai-fixed-award,
  .rv32-sidebar-award {
    max-width: 18rem;
    margin: 0 auto 0.8rem;
  }
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-photo-wrap {
    justify-self: start;
  }

  .metric-grid,
  .course-grid,
  .exp-grid,
  .skill-work-grid,
  .nested-grid-2,
  .github-stat-split,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .detail-file-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .principle-grid,
  .dual-preview-grid,
  .ai-pattern-layout,
  .ai-pattern-pair,
  .rv32-media-grid,
  .rv32-video-grid {
    grid-template-columns: 1fr;
  }



  .rv32-hero {
    margin-left: 0;
    min-height: 0;
  }

  .rv32-detail-page .ai-equal-height-card img,
  .rv32-detail-page .ai-rotate-left-img {
    height: auto;
    max-width: 100%;
    transform: none;
  }

  .ai-rotate-left-frame {
    min-height: 0;
  }

  .ai-rotate-left-media {
    min-height: 0;
    padding: 0;
  }

  .amap-canvas {
    height: 320px;
  }

  .assistant-dock {
    left: 0.82rem;
    bottom: 0.82rem;
  }

  .assistant-dock .assistant-shell {
    width: min(23rem, calc(100vw - 1.64rem));
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 4.2rem;
  }

  .header-inner {
    gap: 0.65rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .logo-badge {
    width: 8.2rem;
  }

  .site-nav {
    left: 0.75rem;
    right: 0.75rem;
    top: calc(100% + 0.35rem);
    padding: 0.82rem;
  }

  .site-nav > a,
  .site-nav .nav-link {
    font-size: 0.84rem;
    padding: 0.48rem 0.68rem;
  }

  .brand-main {
    font-size: 0.98rem;
  }

  .brand-sub {
    display: none;
  }

  .site-nav-toggle {
    min-width: 2.7rem;
    min-height: 2.7rem;
    padding: 0.35rem 0.72rem;
  }

  .hero,
  .panel,
  .detail-page {
    padding: 1.1rem;
    border-radius: var(--radius-2xl);
  }

  .nested-card {
    padding: 0.84rem 0.86rem;
  }

  .skill-badge-wall img {
    height: 1.24rem;
  }

  .detail-page-award {
    padding-left: 1.1rem;
    padding-top: 10.25rem;
    min-height: auto;
  }

  .detail-award-corner {
    left: 1.1rem;
    top: 1.1rem;
    width: calc(100% - 2.2rem);
    height: 8.2rem;
  }

  .amap-canvas {
    height: 270px;
  }

  .hero-photo {
    width: 145px;
    height: 184px;
  }

  .hero-subtitle {
    font-size: 1.12rem;
  }

  .hero-summary {
    font-size: 1rem;
    line-height: 1.75;
  }

  .assistant-fab {
    padding-right: 0.82rem;
    font-size: 0.88rem;
  }

  .assistant-dock {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .assistant-dock .assistant-shell {
    width: min(100vw - 1.5rem, 24rem);
    height: min(33rem, calc(100vh - 7.5rem));
  }

  .assistant-form {
    grid-template-columns: 1fr;
  }

  .assistant-send {
    min-height: 2.85rem;
  }

  .assistant-suggestion-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .rv32-hero {
    padding: 0.84rem;
  }

  .rv32-pill {
    font-size: 0.75rem;
  }

  .rv32-lightbox {
    padding: 0.8rem;
  }

  .container {
    padding-top: 1rem;
  }
}

@media (max-width: 480px) {
  .logo-badge {
    width: 6.9rem;
  }

  .brand-main {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-nav-toggle {
    min-width: 2.55rem;
    padding: 0.35rem 0.58rem;
  }

  .site-nav-toggle-text {
    display: none;
  }
}


.dark .nested-head h3 {
  color: var(--hb-primary-300);
}

.dark .nested-hint {
  color: var(--hb-primary-300);
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--hb-card-border);
}

.dark .nested-label {
  color: var(--hb-primary-300);
}

.dark .nested-text {
  color: var(--hb-fg-secondary);
}

.dark .exp-item h3 {
  color: var(--hb-fg);
}

.dark .exp-item p {
  color: var(--hb-fg-secondary);
}

.dark .exp-advisor {
  color: var(--hb-primary-300);
}

.dark .exp-date {
  color: var(--hb-primary-300);
}

.dark .course-name {
  color: var(--hb-fg);
}

.dark .course-score {
  color: var(--hb-primary-300);
}

.dark .course-action {
  color: var(--hb-primary-300);
}

.dark .metric-title {
  color: var(--hb-fg-secondary);
}

.dark .rank-main,
.dark .rank-sub,
.dark .metric-value {
  color: var(--hb-primary-300);
}

.dark .hero-kicker {
  color: var(--hb-primary-400);
}

.dark .hero-subtitle {
  color: var(--hb-fg);
}

.dark .detail-action {
  color: var(--hb-primary-300);
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

.dark .detail-link-btn {
  background: linear-gradient(135deg, var(--hb-primary-500), var(--hb-primary-600));
  border-color: transparent;
  color: #ffffff;
}
.dark .detail-link-btn:hover {
  background: linear-gradient(135deg, var(--hb-primary-400), var(--hb-primary-500));
}

.dark .detail-meta {
  color: var(--hb-primary-300);
}

.dark .detail-page p {
  color: var(--hb-fg-secondary);
}

.dark .detail-bullet-list li {
  color: var(--hb-fg-secondary);
}

.dark .detail-course-page p {
  color: var(--hb-fg-secondary);
}

.dark .detail-course-page code {
  background: rgba(59, 130, 246, 0.15);
  color: var(--hb-primary-300);
}

.dark .detail-preview-image {
  border-color: var(--hb-card-border);
}

.dark .detail-file-grid a {
  background: var(--hb-bg-soft);
  border-color: var(--hb-card-border);
  color: var(--hb-fg-secondary);
}

.dark .teacher-link {
  color: var(--hb-secondary-400);
}

.dark .section-note {
  color: var(--hb-muted);
}

.dark .skills-inline-note {
  color: var(--hb-fg-secondary);
}

.dark .skills-badge-note {
  color: var(--hb-muted);
}

.dark .site-footer {
  color: var(--hb-muted);
}

.dark .github-stat-subtitle {
  color: var(--hb-muted);
}

.dark .assistant-message-bubble code {
  background: rgba(59, 130, 246, 0.15);
  color: var(--hb-primary-300);
}

/* ============================================================
   KaTeX Integration
   ============================================================ */

.katex {
  font-size: 1.05em;
  line-height: 1.4;
}

.katex-display {
  margin: 1.2rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.6rem 0;
}

.katex-display .katex {
  font-size: 1.12em;
}

.katex-html {
  color: var(--hb-fg);
}

/* Inline math baseline alignment */
.katex-inline .katex {
  vertical-align: baseline;
}

/* Scrollbar styling for overflow equations */
.katex-display::-webkit-scrollbar {
  height: 4px;
}
.katex-display::-webkit-scrollbar-track {
  background: transparent;
}
.katex-display::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 2px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--hb-bg-soft);
}
::-webkit-scrollbar-thumb {
  background: var(--hb-neutral-300);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--hb-neutral-400);
}

/* ============================================================
   DARK MODE — HugoBlox Academic CV Style
   ============================================================ */

.dark {
  color-scheme: dark;

  /* Primary: Blue (for dark mode readability) */
  --hb-primary-50: #172554;
  --hb-primary-100: #1e3a8a;
  --hb-primary-200: #1e40af;
  --hb-primary-300: #3b82f6;
  --hb-primary-400: #60a5fa;
  --hb-primary-500: #3b82f6;
  --hb-primary-600: #60a5fa;
  --hb-primary-700: #93c5fd;
  --hb-primary-800: #bfdbfe;
  --hb-primary-900: #dbeafe;
  --hb-primary-950: #eff6ff;

  /* Surfaces */
  --hb-bg: #0f172a;
  --hb-bg-soft: #1e293b;
  --hb-fg: #f8fafc;
  --hb-fg-secondary: #e2e8f0;
  --hb-muted: #9ca3af;
  --hb-header-bg: #0f172a;
  --hb-header-fg: #f8fafc;
  --hb-footer-bg: #111827;
  --hb-footer-fg: #e5e7eb;

  /* Cards */
  --hb-card-bg: #1e293b;
  --hb-card-border: rgba(255, 255, 255, 0.10);
  --hb-card-ring: rgba(255, 255, 255, 0.12);

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
  --shadow-primary: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
  --shadow-primary-hover: 0 20px 25px -5px rgba(59, 130, 246, 0.35);

  /* Lines */
  --line: var(--hb-fg-secondary);
  --line-strong: rgba(99, 102, 241, 0.25);
  --line-subtle: rgba(255, 255, 255, 0.06);
  --reading-track: rgba(51, 65, 85, 0.88);

  /* Legacy */
  --bg: var(--hb-bg);
  --bg-soft: var(--hb-bg-soft);
  --surface: var(--hb-card-bg);
  --surface-raised: rgba(30, 41, 59, 0.96);
  --panel: rgba(30, 41, 59, 0.94);
  --ink: var(--hb-fg);
  --ink-secondary: var(--hb-fg-secondary);
  --muted: var(--hb-muted);
  --primary: var(--hb-primary-400);
  --primary-dark: var(--hb-primary-300);
  --primary-light: rgba(99, 102, 241, 0.15);
  --primary-soft: rgba(99, 102, 241, 0.15);
  --blue: var(--hb-primary-400);
  --blue-strong: var(--hb-primary-300);
  --blue-soft: rgba(99, 102, 241, 0.15);
}

.dark body {
  background: var(--hb-bg);
  color: var(--hb-fg);
}

.dark .site-header {
  background: var(--hb-header-bg);
  color: var(--hb-header-fg);
  border-bottom-color: var(--hb-card-border);
}

.dark .site-nav > a:hover,
.dark .site-nav .nav-link:hover,
.dark .site-nav .nav-link.active,
.dark .site-nav .nav-item-group:hover > .nav-link {
  background: rgba(99, 102, 241, 0.15);
  color: var(--hb-primary-300);
}

.dark .nav-submenu {
  background: rgba(30, 41, 59, 0.98);
  border-color: var(--hb-card-border);
}

.dark .metric-card,
.dark .exp-item,
.dark .nested-card,
.dark .course-card,
.dark .hero,
.dark .panel {
  background: var(--hb-card-bg);
  border-color: var(--hb-card-border);
  box-shadow: var(--shadow-lg);
}

.dark .code-snippet {
  background: var(--hb-bg-soft);
  border-color: var(--hb-card-border);
  color: var(--hb-fg-secondary);
}

.dark .summary-card {
  background: var(--hb-card-bg);
  border-color: var(--hb-card-border);
}

.dark .metric-card-link:hover,
.dark .course-card-link:hover {
  box-shadow: var(--shadow-xl);
}

.dark .hero-subtitle,
.dark .metric-title,
.dark .rank-main,
.dark .rank-sub,
.dark .metric-value,
.dark .course-name,
.dark .course-score,
.dark .exp-date,
.dark .nested-label,
.dark .nested-hint,
.dark .detail-action,
.dark .detail-subtitle,
.dark .detail-link-btn,
.dark .detail-file-title {
  color: var(--hb-fg);
}

.dark .hero-summary,
.dark .nested-text,
.dark .metric-note,
.dark .skills-badge-note,
.dark .skills-inline-note,
.dark .section-note {
  color: var(--hb-muted);
}

.dark .teacher-link {
  color: var(--hb-secondary-400);
  border-bottom-color: rgba(45, 212, 191, 0.4);
}

.dark .teacher-link:hover {
  color: var(--hb-secondary-300);
}

.dark .github-stat-block {
  background: linear-gradient(165deg, #1e293b 0%, #0f172a 100%);
}

.dark .github-stat-subtitle {
  color: var(--hb-muted);
}

.dark .github-stat-image {
  background: #0f172a;
}

.dark .code-snippet code,
.dark .detail-course-page code {
  background: rgba(99, 102, 241, 0.15);
  color: var(--hb-primary-300);
}

.dark .module-table th {
  background: rgba(59, 130, 246, 0.15);
  color: var(--hb-primary-300);
}
.dark .module-table td {
  color: var(--hb-fg-secondary);
}

.dark .github-dark-block,
.dark .github-dark-card {
  background: #1e293b;
}

/* Inline code in prose style */
.dark code:not(pre code) {
  background: rgba(99, 102, 241, 0.12);
  color: var(--hb-primary-300);
  border-radius: var(--radius-md);
  padding: 0.125rem 0.375rem;
  font-size: 0.875em;
}

/* KaTeX in dark mode */
.dark .katex-html {
  color: var(--hb-fg);
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.dark ::-webkit-scrollbar-track {
  background: var(--hb-bg-soft);
}
.dark ::-webkit-scrollbar-thumb {
  background: var(--hb-neutral-700);
  border-radius: var(--radius-full);
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: var(--hb-neutral-600);
}

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--hb-neutral-300);
  background: #ffffff;
  color: var(--hb-neutral-700);
  cursor: pointer;
  transition: var(--transition-base);
  flex-shrink: 0;
  position: relative;
  z-index: 25;
  box-shadow: var(--shadow-sm);
}
.theme-toggle:hover {
  background: var(--hb-neutral-100);
  border-color: var(--hb-neutral-400);
  color: var(--hb-primary-600);
}
.dark .theme-toggle {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(30, 41, 59, 0.95);
  color: var(--hb-neutral-200);
}
.dark .theme-toggle:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--hb-primary-300);
}
.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.dark .assistant-message-assistant .assistant-message-bubble {
  background: var(--hb-bg-soft);
  color: var(--hb-fg);
  border-color: var(--hb-card-border);
}

.dark .assistant-message-user .assistant-message-bubble {
  background: var(--hb-primary-500);
}

.dark .assistant-message-label {
  color: var(--hb-muted);
}

.dark .assistant-shell-header,
.dark .assistant-page-shell-head {
  border-bottom-color: var(--hb-card-border);
}

.dark .assistant-form {
  border-top-color: var(--hb-card-border);
}

.dark .assistant-suggestion {
  border-color: var(--hb-card-border);
  color: var(--hb-fg);
}

.dark .assistant-suggestion:hover {
  background: rgba(99, 102, 241, 0.12);
}

.dark .assistant-status[data-tone="ready"] {
  color: var(--hb-secondary-400);
}

.dark .assistant-status[data-tone="error"] {
  color: var(--hb-primary-400);
}

.dark .assistant-dock .assistant-shell {
  background: var(--hb-card-bg);
  border-color: var(--hb-card-border);
}

.dark .assistant-messages {
  background:
    radial-gradient(circle at top left, rgba(30, 41, 59, 0.9) 0%, transparent 42%),
    linear-gradient(180deg, var(--hb-bg), var(--hb-card-bg));
}

.dark .assistant-input {
  background: var(--hb-bg-soft);
  color: var(--hb-fg);
  border-color: var(--hb-card-border);
}

.dark .assistant-input::placeholder {
  color: var(--hb-muted);
}

.dark .assistant-send {
  background: var(--hb-primary-600);
  color: #ffffff;
}

.dark .assistant-send:hover {
  background: var(--hb-primary-500);
}

.dark .assistant-page-shell {
  background: var(--hb-card-bg);
}

.dark .assistant-page-shell-head {
  background: var(--hb-card-bg);
  color: var(--hb-fg);
}

.dark .assistant-shell-header {
  background: var(--hb-card-bg);
  color: var(--hb-fg);
}

.dark .assistant-shell-kicker {
  color: var(--hb-muted);
}

.dark .assistant-shell-header h2,
.dark .assistant-page-shell-head h2 {
  color: var(--hb-fg);
}

.dark .assistant-shell-action {
  background: var(--hb-bg-soft);
  color: var(--hb-fg);
  border-color: var(--hb-card-border);
}

.dark .assistant-shell-action:hover {
  background: var(--hb-neutral-700);
}

.dark .assistant-status {
  color: var(--hb-muted);
}

.dark .assistant-fab {
  background: var(--hb-card-bg);
  border-color: var(--hb-card-border);
  color: var(--hb-primary-300);
  box-shadow: var(--shadow-lg);
}

.dark .assistant-fab:hover {
  background: var(--hb-bg-soft);
}

/* ===== Final override: Hugo biography must have NO background/border ===== */
.hero.hero-biography,
.dark .hero.hero-biography {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
.hero.hero-biography:hover,
.dark .hero.hero-biography:hover {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
}

/* ===== TeX-style helpers for detail pages ===== */
.tex-table-wrap {
  margin: 1.2rem 0;
  overflow-x: auto;
}

.tex-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5pt;
  line-height: 1.6;
}

.tex-table thead {
  border-top: 2px solid var(--hb-fg);
  border-bottom: 1px solid var(--hb-fg);
}

.tex-table tbody {
  border-bottom: 2px solid var(--hb-fg);
}

.tex-table th,
.tex-table td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.tex-table th {
  font-weight: 700;
}

.tex-table tbody tr:nth-child(even) {
  background: rgba(128, 128, 128, 0.05);
}

.tex-table-caption {
  font-size: 10.5pt;
  text-align: center;
  margin-bottom: 0.4rem;
  color: var(--hb-muted);
}

.tex-enumerate,
.tex-itemize {
  padding-left: 2em;
  margin: 0.6em 0;
}

.tex-enumerate {
  list-style: decimal;
}

.tex-itemize {
  list-style: disc;
}

.tex-enumerate li,
.tex-itemize li {
  margin: 0.3em 0;
}

.tex-bibitem {
  font-size: 10.5pt;
  margin: 0.4em 0;
  padding-left: 2em;
  text-indent: -2em;
  line-height: 1.6;
}
