/* ============================================
   Yili Wen - Academic Personal Website
   Dark theme — "Feel · Connect · Move"
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --color-bg: #0e0e0e;
  --color-bg-alt: #161616;
  --color-bg-card: #1c1c1c;
  --color-bg-card-hover: #222;
  --color-text: #e8e4de;
  --color-text-secondary: #9a9590;
  --color-text-muted: #6b6560;
  --color-accent: #c8b89a;
  --color-accent-hover: #ddd0b8;
  --color-border: #2a2a2a;
  --color-border-light: #333;
  --color-tag-bg: rgba(200, 184, 154, 0.12);
  --color-tag-text: #c8b89a;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --max-width: 920px;
  --nav-height: 56px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.3s;
}

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

::selection {
  background: rgba(200, 184, 154, 0.3);
  color: #fff;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---- Navigation ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(14, 14, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: 0.3px;
}

.nav-name:hover {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

.nav-links a.active {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text);
  cursor: pointer;
}

/* ---- Page Content ---- */
.page-content {
  padding-top: calc(var(--nav-height) + 48px);
  padding-bottom: 80px;
  min-height: calc(100vh - 100px);
}

.page-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 500;
  margin-bottom: 40px;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

/* ---- Hero / About ---- */
.hero-tagline {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 3px;
  color: var(--color-text-muted);
  text-transform: lowercase;
  margin-bottom: 32px;
  padding-bottom: 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 44px;
  align-items: start;
  margin-bottom: 40px;
}

.profile-photo {
  width: 180px;
  height: 220px;
  object-fit: cover;
  object-position: center top;
  border-radius: 6px;
  filter: grayscale(15%);
  transition: filter 0.5s ease;
}

.profile-photo:hover {
  filter: grayscale(0%);
}

.hero-info h1 {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.chinese-name {
  font-size: 20px;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-left: 4px;
}

.subtitle {
  font-size: 15px;
  color: var(--color-accent);
  font-weight: 400;
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

.affiliation {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.affiliation a {
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-light);
  transition: color 0.3s, border-color 0.3s;
}

.affiliation a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.contact-links {
  display: flex;
  gap: 12px;
}

.contact-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
  font-size: 15px;
  transition: all 0.3s;
  text-decoration: none;
}

.contact-links a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(200, 184, 154, 0.08);
}

/* ---- Bio ---- */
.bio {
  margin-bottom: 48px;
}

.bio p {
  margin-bottom: 14px;
  color: var(--color-text-secondary);
  line-height: 1.85;
  font-size: 14.5px;
}

.bio strong {
  color: var(--color-text);
  font-weight: 500;
}

.bio a {
  border-bottom: 1px solid var(--color-border-light);
}

.bio a:hover {
  border-color: var(--color-accent);
}

/* ---- Divider ---- */
.section-divider {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 48px 0;
}

/* ---- News ---- */
h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 24px;
  color: var(--color-text);
  letter-spacing: -0.3px;
}

.news-list {
  list-style: none;
  padding-left: 0;
  border-left: 2px solid var(--color-border-light);
  padding-left: 20px;
}

.news-list li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--color-text-secondary);
  transition: color 0.3s;
}

.news-list li:hover {
  color: var(--color-text);
}

.news-date {
  font-weight: 600;
  color: var(--color-accent);
  margin-right: 10px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.news-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  margin-right: 8px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.tag-paper { background: rgba(76, 175, 80, 0.15); color: #81c784; }
.tag-poster { background: rgba(255, 193, 7, 0.15); color: #ffd54f; }
.tag-new { background: rgba(100, 181, 246, 0.15); color: #90caf9; }
.tag-award { background: rgba(239, 83, 80, 0.15); color: #ef9a9a; }

/* ---- Publications ---- */
h3.pub-category {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 32px;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  letter-spacing: -0.2px;
}

.pub-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 20px;
  margin-bottom: 32px;
  padding: 20px;
  border-radius: 8px;
  transition: background 0.3s;
}

.pub-item:hover {
  background: var(--color-bg-alt);
}

.pub-year {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-accent);
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}

.pub-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 6px;
  color: var(--color-text);
}

.pub-authors {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

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

.pub-info {
  font-size: 13px;
  color: var(--color-text-muted);
  font-style: italic;
}

.venue-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 3px;
  background: rgba(200, 184, 154, 0.2);
  color: var(--color-accent);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.venue-poster {
  background: rgba(154, 149, 144, 0.2);
  color: var(--color-text-secondary);
}

.pub-links {
  margin-top: 8px;
  display: flex;
  gap: 12px;
}

.pub-link {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.3s;
}

.pub-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ---- Projects Section Title ---- */
.projects-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

/* ---- Research Project Cards ---- */
.research-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  padding: 24px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: 1px solid var(--color-border-light);
  background: var(--color-bg-card);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.research-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(200, 184, 154, 0.15);
  transform: translateY(-3px);
  text-decoration: none;
}

.research-card-img {
  width: 280px;
  height: 180px;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
}

.research-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.research-card:hover .research-card-img img {
  transform: scale(1.03);
}

.research-card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.research-card-info h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text);
  margin-bottom: 8px;
  transition: color 0.3s;
}

.research-card:hover .research-card-info h3 {
  color: var(--color-accent);
}

.research-card-authors {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.research-card-authors strong {
  color: var(--color-accent);
}

.research-card-venue {
  font-size: 13px;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 8px;
}

.research-card-desc {
  font-size: 13.5px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.research-card-links {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.research-card-links .pub-link {
  cursor: pointer;
}

.research-card-arrow {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: auto;
  padding-top: 8px;
  transition: color 0.3s;
  letter-spacing: 0.3px;
}

.research-card:hover .research-card-arrow {
  color: var(--color-accent);
}

@media (max-width: 768px) {
  .research-card {
    grid-template-columns: 1fr;
  }
  .research-card-img {
    width: 100%;
    height: 200px;
  }
}

/* ---- Projects Grid ---- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--color-bg-card);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-light);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.project-image-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
  transition: background 0.4s ease;
}

.project-card:hover .project-image-placeholder {
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
}

.project-cover-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-cover-img {
  transform: scale(1.03);
}

.project-body {
  padding: 20px;
}

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

.project-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 3px;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-body h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.4;
  color: var(--color-text);
  letter-spacing: -0.2px;
  transition: color 0.3s;
}

.project-card:hover .project-body h3 {
  color: var(--color-accent);
}

.project-body p {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ---- Project Card as Link ---- */
a.project-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.project-card:hover {
  text-decoration: none;
}

/* ---- Section Header with View All ---- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section-header h2 {
  margin-bottom: 24px;
}

.view-all {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---- Featured Projects ---- */
.featured-projects {
  margin-top: 12px;
}

.featured-projects .project-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* ---- CV Section ---- */
.cv-section {
  margin-bottom: 40px;
}

.cv-section h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 20px;
  color: var(--color-text);
  letter-spacing: -0.2px;
}

.cv-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 6px;
  transition: background 0.3s;
}

.cv-item:hover {
  background: var(--color-bg-alt);
}

.cv-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}

.cv-detail {
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

.cv-detail strong {
  color: var(--color-text);
  font-weight: 500;
}

.cv-note {
  font-size: 13px;
  color: var(--color-text-muted);
}

.cv-download {
  margin-top: 28px;
}

.cv-download a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s;
  text-decoration: none;
}

.cv-download a:hover {
  background: var(--color-accent);
  color: var(--color-bg);
}

/* ---- Skills Grid ---- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skill-group h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.skill-group p {
  font-size: 13.5px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ---- Slogan ---- */
/* ---- Chongqing Banner ---- */
.banner-full {
  width: 100%;
  height: 80px;
  overflow: hidden;
}

.banner-full img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}

.hero-tagline {
  text-align: center;
}

.slogan-header-img {
  height: auto;
  width: min(90%, 840px);
  animation: sloganGlow 4s ease-in-out infinite;
}

@keyframes sloganGlow {
  0%, 100% { opacity: 0.7; filter: brightness(1) drop-shadow(0 0 4px rgba(200, 184, 154, 0.2)); }
  50% { opacity: 1; filter: brightness(1.3) drop-shadow(0 0 16px rgba(200, 184, 154, 0.6)); }
}

.slogan-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.slogan-img {
  height: auto;
  width: min(85%, 720px);
  animation: sloganGlow 4s ease-in-out infinite;
}

/* ---- Footer ---- */
.footer {
  padding: 36px 0;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  letter-spacing: 0.3px;
}

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

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

/* ---- Project Detail Page ---- */
.project-hero-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 36px;
}

.project-hero-placeholder {
  width: 100%;
  height: 320px;
  background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
  border-radius: 8px;
  margin-bottom: 36px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
  padding: 20px 24px;
  background: var(--color-bg-alt);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.project-meta-item {
  flex: 1;
  min-width: 140px;
}

.project-meta-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.project-meta-value {
  font-size: 13.5px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.project-detail h2 {
  font-size: 20px;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.project-detail p {
  font-size: 14.5px;
  color: var(--color-text-secondary);
  line-height: 1.85;
  margin-bottom: 16px;
}

.project-detail ul {
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
}

.project-detail ul li {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.8;
  padding-left: 16px;
  position: relative;
  margin-bottom: 6px;
}

.project-detail ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--color-text-muted);
}

.project-detail .img-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.project-detail .img-row img,
.project-detail .img-full {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.project-detail .img-full {
  margin: 24px 0;
}

.project-detail .img-caption {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

.project-detail .bibtex {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 16px 20px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--color-text-muted);
  overflow-x: auto;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 16px 0;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.project-nav a {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  transition: color 0.3s;
}

.project-nav a:hover {
  color: var(--color-accent);
}

@media (max-width: 768px) {
  .project-meta {
    flex-direction: column;
    gap: 16px;
  }
  .project-detail .img-row {
    grid-template-columns: 1fr;
  }
}

/* ---- Page Fade-in Animation ---- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-content {
  animation: fadeIn 0.6s ease forwards;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 24px;
  }

  .profile-photo {
    width: 140px;
    height: 172px;
  }

  .contact-links {
    justify-content: center;
  }

  .bio {
    text-align: left;
  }

  .project-grid {
    grid-template-columns: 1fr !important;
  }

  .pub-item {
    grid-template-columns: 1fr;
    padding: 16px 12px;
  }

  .pub-year {
    margin-bottom: -8px;
  }

  .cv-item {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .cv-date {
    margin-bottom: -4px;
  }

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

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(14, 14, 14, 0.98);
    flex-direction: column;
    padding: 16px 28px;
    gap: 14px;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero-tagline {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 28px;
  }

  .hero-info h1 {
    font-size: 30px;
  }
}
