/* ==========================================================================
   Li Zhiyang Academic Portfolio - Minimalist & High-End Design System
   Inspired by Geist (Vercel), shadcn/ui, and top-tier academic portals
   ========================================================================== */

:root {
  --font-sans: 'Geist', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', monospace;
  --font-serif: 'Newsreader', Georgia, serif;

  /* Dark Theme (Default) */
  --bg-page: #09090b;
  --bg-subtle: #121216;
  --bg-card: rgba(24, 24, 28, 0.6);
  --bg-card-hover: rgba(32, 32, 38, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-active: rgba(16, 185, 129, 0.4);

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --accent-green: #10b981;
  --accent-blue: #38bdf8;
  --accent-bili: #00aeec;
  --accent-indigo: #818cf8;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.light-theme {
  --bg-page: #ffffff;
  --bg-subtle: #fafafa;
  --bg-card: rgba(250, 250, 250, 0.8);
  --bg-card-hover: #f4f4f5;

  --border-subtle: #e4e4e7;
  --border-hover: #d4d4d8;
  --border-active: rgba(16, 185, 129, 0.6);

  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
}

/* ==========================================================================
   Reset & Base Layout
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.ambient-glow {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 1000px;
  height: 400px;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.07) 0%, rgba(56, 189, 248, 0.03) 50%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* Container */
.main-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 6.5rem 1.5rem 4rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Site Header & Navigation
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}

body.light-theme .site-header {
  background: rgba(255, 255, 255, 0.85);
}

.header-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-initials {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-en {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.85rem;
  margin-left: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: var(--transition);
}

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

.icon-sun { display: none; color: #f59e0b; }
body.light-theme .icon-sun { display: block; }
body.light-theme .icon-moon { display: none; }

.btn-contact-nav {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: var(--bg-page);
  transition: var(--transition);
}

.btn-contact-nav:hover {
  opacity: 0.9;
}

.menu-btn-mobile {
  display: none;
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 1.5rem 0 3rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-profile-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.hero-avatar-box {
  position: relative;
  flex-shrink: 0;
}

.avatar-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

body.light-theme .avatar-ring {
  background: linear-gradient(135deg, #f4f4f5 0%, #e4e4e7 100%);
}

.status-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-green);
  border: 2px solid var(--bg-page);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.6rem;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}

.hero-name {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero-name-sub {
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 6px;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.hero-statement {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1.75rem;
}

.hero-statement strong {
  color: var(--text-primary);
  font-weight: 600;
}

.hero-link-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.badge-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: var(--transition);
}

.badge-link:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.badge-link.bilibili:hover {
  color: var(--accent-bili);
  border-color: rgba(0, 174, 236, 0.4);
}

/* ==========================================================================
   Section Standard
   ========================================================================== */
.content-section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.title-num {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.prose-content p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-size: 0.98rem;
  line-height: 1.8;
}

.prose-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.research-philosophy {
  margin: 1.75rem 0 0.5rem 0;
  padding: 1.1rem 1.35rem;
  border-left: 2px solid var(--text-primary);
  background: var(--bg-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.65;
  font-style: italic;
}

/* ==========================================================================
   Research Interests Grid
   ========================================================================== */
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.research-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.research-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.card-header-icon {
  font-size: 1.2rem;
  color: var(--accent-green);
  margin-bottom: 0.85rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.card-tags span {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Projects Showcase List
   ========================================================================== */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-entry {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.project-entry:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.project-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.entry-type {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent-green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.entry-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.project-entry-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
  line-height: 1.4;
}

.project-entry-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.entry-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.entry-bullets li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.2rem;
  line-height: 1.6;
}

.entry-bullets li::before {
  content: "•";
  position: absolute;
  left: 0.2rem;
  color: var(--text-muted);
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.entry-tags span {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Skills Category List
   ========================================================================== */
.skills-category-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.skill-group {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.skill-group-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stag {
  font-size: 0.82rem;
  padding: 0.3rem 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition);
}

.stag:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ==========================================================================
   Bilibili Box
   ========================================================================== */
.bilibili-box {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid rgba(0, 174, 236, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bili-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bili-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: #00aeec;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.bili-channel-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.bili-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.bili-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.btn-bili-visit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #00aeec;
  transition: var(--transition);
}

.btn-bili-visit:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Timeline / Education
   ========================================================================== */
.timeline-block {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.timeline-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  align-items: baseline;
}

.time-col {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.desc-col .time-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.desc-col .time-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.desc-col .time-detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-panel {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.contact-lead {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.contact-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-contact-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: var(--bg-page);
  transition: var(--transition);
}

.btn-contact-main:hover {
  opacity: 0.9;
}

.btn-contact-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: var(--transition);
}

.btn-contact-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-subtext a {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-popup {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text-primary);
  color: var(--bg-page);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(80px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  z-index: 2000;
}

.toast-popup.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .menu-btn-mobile {
    display: block;
  }
  .research-grid {
    grid-template-columns: 1fr;
  }
  .timeline-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .hero-name {
    font-size: 1.75rem;
  }
}
