/* ============================================
   Luka Homepage
   Fresh minimal academic homepage template
   ============================================ */

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

body.theme-luka,
body.theme-luka *,
body.theme-luka *::before,
body.theme-luka *::after {
  box-sizing: border-box;
}

:root {
  --luka-bg: #fbfdf9;
  --luka-text: #2f3d35;
  --luka-accent: #62b883;
  --luka-secondary: #748278;
  --luka-border: rgba(98, 184, 131, 0.2);
  --luka-shadow: rgba(98, 184, 131, 0.15);
  --luka-social-bg: #ffffff;
  --luka-social-text: #5f7567;
  --luka-footer-border: rgba(98, 184, 131, 0.15);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --luka-bg: #171f1a;
    --luka-text: #d5ded8;
    --luka-accent: #8fd5ad;
    --luka-secondary: #9aa89f;
    --luka-border: rgba(143, 213, 173, 0.2);
    --luka-shadow: rgba(0, 0, 0, 0.3);
    --luka-social-bg: #202a24;
    --luka-social-text: #d5ded8;
    --luka-footer-border: rgba(143, 213, 173, 0.15);
  }
}

[data-theme="dark"] {
  --luka-bg: #171f1a;
  --luka-text: #d5ded8;
  --luka-accent: #8fd5ad;
  --luka-secondary: #9aa89f;
  --luka-border: rgba(143, 213, 173, 0.2);
  --luka-shadow: rgba(0, 0, 0, 0.3);
  --luka-social-bg: #202a24;
  --luka-social-text: #d5ded8;
  --luka-footer-border: rgba(143, 213, 173, 0.15);
}

[data-theme="light"] {
  --luka-bg: #fbfdf9;
  --luka-text: #2f3d35;
  --luka-accent: #62b883;
  --luka-secondary: #748278;
  --luka-border: rgba(98, 184, 131, 0.2);
  --luka-shadow: rgba(98, 184, 131, 0.15);
  --luka-social-bg: #ffffff;
  --luka-social-text: #5f7567;
  --luka-footer-border: rgba(98, 184, 131, 0.15);
}

body.theme-luka {
  background: var(--luka-bg);
  color: var(--luka-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.theme-luka a {
  color: var(--luka-accent);
  text-decoration: none;
}

body.theme-luka a:hover {
  filter: brightness(1.15);
}

body.theme-luka .top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--luka-bg);
  border-bottom: 1px solid var(--luka-footer-border);
  z-index: 1000;
}

body.theme-luka .nav-container {
  width: 100%;
  max-width: 1120px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.theme-luka .nav-left a {
  color: var(--luka-text);
  font-size: 18px;
  font-weight: 600;
}

body.theme-luka .nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

body.theme-luka .nav-right a {
  color: var(--luka-secondary);
  font-size: 14px;
  font-weight: 500;
}

body.theme-luka .nav-right a:hover {
  color: var(--luka-accent);
}

body.theme-luka .theme-toggle {
  border: none;
  background: transparent;
  color: var(--luka-text);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.theme-luka .theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.theme-luka .theme-toggle .icon-sun {
  display: none;
}

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

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

body.theme-luka .theme-toggle:hover {
  background: var(--luka-border);
  color: var(--luka-accent);
}

body.theme-luka .wrapper {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  min-height: 100vh;
}

body.theme-luka .sidebar {
  width: 320px;
  flex-shrink: 0;
  position: fixed;
  top: 60px;
  left: calc(50% - 560px);
  height: calc(100vh - 60px);
  overflow-y: auto;
  text-align: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 60px;
  z-index: 100;
}

body.theme-luka .profile-card {
  width: 100%;
  padding: 0 20px;
  text-align: center;
}

body.theme-luka .image.avatar {
  display: block;
  margin: 0 auto 28px;
}

body.theme-luka .image.avatar img {
  width: 150px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 6px 24px var(--luka-shadow);
}

body.theme-luka .site-name {
  margin: 0 0 8px;
  color: var(--luka-text);
  font-size: 28px;
  line-height: 1.2;
}

body.theme-luka .site-name-cn {
  margin: 0 0 8px;
  color: var(--luka-secondary);
  font-size: 17px;
}

body.theme-luka .site-email {
  margin: 0 0 24px;
  color: var(--luka-secondary);
  font-size: 13px;
  font-family: "Ubuntu Mono", "SFMono-Regular", monospace;
  word-break: break-all;
}

body.theme-luka .social-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

body.theme-luka .social-icons a {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--luka-social-bg);
  color: var(--luka-social-text) !important;
  box-shadow: 0 2px 8px rgba(61, 57, 41, 0.08);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

body.theme-luka .social-icons a:hover {
  background: var(--luka-accent);
  color: #fff !important;
  transform: translateY(-2px);
}

body.theme-luka .social-icons svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.theme-luka .social-icons a[aria-label="GitHub"] svg {
  fill: currentColor;
  stroke: none;
}

body.theme-luka .visitor-card {
  margin: 40px auto 0;
  width: 240px;
  padding: 18px 16px;
  border: 1px dashed var(--luka-border);
  border-radius: 14px;
  color: var(--luka-secondary);
  text-align: left;
}

body.theme-luka .visitor-card-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--luka-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.theme-luka .visitor-card-body {
  font-size: 13px;
  line-height: 1.6;
}

body.theme-luka .content {
  flex: 1;
  min-width: 0;
  margin-left: 320px;
  padding: 120px 40px 80px 60px;
}

body.theme-luka .section {
  margin-bottom: 44px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

body.theme-luka .section.visible {
  opacity: 1;
  transform: translateY(0);
}

body.theme-luka .section-title {
  display: inline-block;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--luka-accent);
  color: var(--luka-accent);
  font-size: 19px;
  font-weight: 600;
}

body.theme-luka .section-body p {
  margin: 0 0 14px;
}

body.theme-luka .card {
  background: transparent;
  padding: 0;
  box-shadow: none;
}

body.theme-luka .timeline-item {
  position: relative;
  margin-left: 20px;
  padding-left: 8px;
  padding-bottom: 20px;
}

body.theme-luka .timeline-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--luka-accent), rgba(98, 184, 131, 0.12));
}

body.theme-luka .timeline-item:last-child::before {
  bottom: 50%;
}

body.theme-luka .timeline-item::after {
  content: "";
  position: absolute;
  left: -25px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--luka-accent);
  border: 2px solid var(--luka-bg);
}

body.theme-luka .experience-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

body.theme-luka .institution-logo {
  width: 64px;
  height: 52px;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  padding: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 2px 10px rgba(47, 61, 53, 0.06);
}

body.theme-luka .institution-logo.logo-mark {
  width: 64px;
}

body.theme-luka .experience-content {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

body.theme-luka .experience-content p {
  margin: 0 0 2px;
}

body.theme-luka .exp-title {
  font-size: 15px;
  color: var(--luka-text);
}

body.theme-luka .exp-detail {
  font-size: 14px;
  color: var(--luka-secondary);
}

body.theme-luka .exp-period {
  font-size: 13px;
  color: var(--luka-accent);
  font-weight: 500;
}

body.theme-luka .project-card {
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.7;
}

/* News timeline */
body.theme-luka .news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

body.theme-luka .news-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--luka-border);
}

body.theme-luka .news-item:last-child {
  border-bottom: none;
}

body.theme-luka .news-date {
  flex-shrink: 0;
  width: 64px;
  font-size: 13px;
  font-weight: 600;
  color: var(--luka-accent);
  font-family: "Ubuntu Mono", "SFMono-Regular", monospace;
}

body.theme-luka .news-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--luka-text);
}

body.theme-luka .news-text a {
  font-size: 13px;
  font-weight: 500;
}

body.theme-luka .publications ol.bibliography {
  list-style: none;
  padding: 0;
  margin: 0;
}

body.theme-luka .publications ol.bibliography li {
  margin-bottom: 14px;
  padding: 15px 0 15px 16px;
  border-left: 3px solid var(--luka-accent);
}

body.theme-luka .pub-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

body.theme-luka .pub-img {
  flex-shrink: 0;
  width: 160px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--luka-border);
}

body.theme-luka .pub-img img {
  width: 100%;
  height: auto;
  display: block;
}

body.theme-luka .pub-img-placeholder {
  width: 160px;
  height: 90px;
  background: var(--luka-border);
  border-radius: 6px;
  flex-shrink: 0;
}

body.theme-luka .pub-content .title {
  margin-bottom: 4px;
  color: var(--luka-text);
  font-size: 15px;
  font-weight: 600;
}

body.theme-luka .pub-content .author {
  margin-bottom: 4px;
  color: var(--luka-secondary);
  font-size: 14px;
}

body.theme-luka .pub-content .periodical {
  margin-bottom: 4px;
  color: var(--luka-accent);
  font-size: 14px;
}

body.theme-luka .pub-content .pub-tldr {
  margin-bottom: 4px;
  color: var(--luka-secondary);
  font-size: 13px;
  font-style: italic;
  line-height: 1.5;
}

body.theme-luka .pub-content .links {
  margin-top: 4px;
}

body.theme-luka .pub-content .links a {
  font-size: 13px;
  font-weight: 500;
}

body.theme-luka .awards-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.theme-luka .award-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

body.theme-luka .award-icon {
  flex-shrink: 0;
  width: 28px;
  color: var(--luka-accent);
  font-size: 20px;
  text-align: center;
}

body.theme-luka .award-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.theme-luka .award-text {
  color: var(--luka-text);
  font-size: 14px;
}

body.theme-luka .site-footer {
  width: 100%;
  flex-basis: 100%;
  padding: 32px 24px 40px 380px;
  text-align: center;
}

body.theme-luka .site-footer p {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--luka-footer-border);
  color: var(--luka-secondary);
  font-size: 13px;
}

body.theme-luka .template-credit {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
}

body.theme-luka h1,
body.theme-luka h2,
body.theme-luka h3,
body.theme-luka h4,
body.theme-luka strong {
  color: var(--luka-text);
}

@media (max-width: 1080px) {
  body.theme-luka .nav-container {
    padding: 0 20px;
  }

  body.theme-luka .nav-right {
    gap: 12px;
  }

  body.theme-luka .nav-right a {
    display: none;
  }

  body.theme-luka .wrapper {
    flex-direction: column;
    padding: 0 20px;
  }

  body.theme-luka .sidebar {
    position: static;
    left: auto;
    width: 100%;
    height: auto;
    padding-top: 80px;
    overflow: visible;
  }

  body.theme-luka .profile-card {
    padding: 0;
  }

  body.theme-luka .content {
    margin-left: 0;
    padding: 32px 0 48px;
  }

  body.theme-luka .site-footer {
    padding: 32px 0;
  }

  body.theme-luka .site-footer p {
    padding-top: 0;
    border-top: none;
  }
}

@media (max-width: 640px) {
  body.theme-luka .image.avatar img {
    width: 120px;
    height: 160px;
  }

  body.theme-luka .site-name {
    font-size: 24px;
  }

  body.theme-luka .experience-item {
    gap: 12px;
  }

  body.theme-luka .institution-logo {
    width: 58px;
    height: 46px;
    padding: 5px;
  }

  body.theme-luka .institution-logo.logo-mark {
    width: 58px;
  }

  body.theme-luka .visitor-card {
    width: 100%;
    max-width: 280px;
  }
}

/* Journey section */
body.theme-luka .journey-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

body.theme-luka .journey-card {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--luka-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

body.theme-luka .journey-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--luka-shadow);
}

body.theme-luka .journey-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

body.theme-luka .journey-cover .carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.3s ease;
}

body.theme-luka .journey-cover .carousel-slide.active {
  opacity: 1;
}

body.theme-luka .journey-card:hover .carousel-slide.active {
  transform: scale(1.05);
}

body.theme-luka .journey-carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

body.theme-luka .journey-carousel-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.3s;
}

body.theme-luka .journey-carousel-dots .dot.active {
  background: #fff;
}

body.theme-luka .journey-info {
  padding: 12px 14px;
}

body.theme-luka .journey-info .journey-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--luka-text);
}

body.theme-luka .journey-info .journey-date {
  margin: 0;
  font-size: 13px;
  color: var(--luka-accent);
  font-weight: 500;
}

body.theme-luka .journey-more {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
}

/* Journey gallery page */
body.theme-luka .journey-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 100px 40px 60px;
}

body.theme-luka .journey-page-header {
  margin-bottom: 48px;
}

body.theme-luka .journey-page-header h1 {
  margin: 0 0 8px;
  font-size: 32px;
  color: var(--luka-text);
}

body.theme-luka .journey-page-header p {
  margin: 0;
  color: var(--luka-secondary);
  font-size: 16px;
}

body.theme-luka .gallery-section {
  margin-bottom: 56px;
}

body.theme-luka .gallery-title {
  margin: 0 0 4px;
  font-size: 20px;
  color: var(--luka-text);
}

body.theme-luka .gallery-date {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--luka-accent);
  font-weight: 500;
}

body.theme-luka .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

body.theme-luka .gallery-item {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
}

body.theme-luka .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

body.theme-luka .gallery-item:hover img {
  transform: scale(1.05);
}

/* Lightbox */
body.theme-luka .lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
}

body.theme-luka .lightbox.active {
  display: flex;
}

body.theme-luka .lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

body.theme-luka .lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  line-height: 1;
}

body.theme-luka .lightbox-prev,
body.theme-luka .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 40px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

body.theme-luka .lightbox-prev:hover,
body.theme-luka .lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
}

body.theme-luka .lightbox-prev {
  left: 20px;
}

body.theme-luka .lightbox-next {
  right: 20px;
}

@media (max-width: 1080px) {
  body.theme-luka .journey-page {
    padding: 80px 20px 40px;
  }
}

@media (max-width: 640px) {
  body.theme-luka .journey-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body.theme-luka .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

  body.theme-luka .lightbox-prev,
  body.theme-luka .lightbox-next {
    width: 36px;
    height: 36px;
    font-size: 28px;
  }

  body.theme-luka .pub-row {
    flex-direction: column;
    gap: 10px;
  }

  body.theme-luka .pub-img,
  body.theme-luka .pub-img-placeholder {
    width: 100%;
    max-width: 280px;
  }

  body.theme-luka .news-item {
    flex-direction: column;
    gap: 2px;
  }

  body.theme-luka .news-date {
    width: auto;
  }
}

@media (max-width: 480px) {
  body.theme-luka .section {
    margin-bottom: 32px;
  }

  body.theme-luka .section-title {
    font-size: 18px;
  }

  body.theme-luka .project-card,
  body.theme-luka .exp-detail,
  body.theme-luka .award-text,
  body.theme-luka .pub-content .author,
  body.theme-luka .pub-content .periodical {
    font-size: 13px;
  }
}
