/* ===================================================
   Academic Homepage - Huayuchen (Hua Yuchen)
   Style Sheet
   =================================================== */

/* ----- Variables ----- */
:root {
  --primary: #1a365d;
  --primary-light: #2a4a7f;
  --accent: #3182ce;
  --accent-hover: #2c5282;
  --accent-light: #ebf4ff;
  --text: #1a202c;
  --text-muted: #718096;
  --text-light: #a0aec0;
  --bg: #ffffff;
  --bg-alt: #f7fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --radius: 8px;
  --max-width: 960px;
  --nav-height: 64px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

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

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

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

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

img { max-width: 100%; height: auto; }

::selection {
  background: var(--accent);
  color: white;
}

/* Chinese text support */
[lang="zh"] {
  font-family: 'Noto Sans SC', var(--font-sans);
}

/* ----- Navigation ----- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

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

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.nav-logo:hover { color: var(--accent); }
.nav-logo .cn-name { font-weight: 400; color: var(--text-muted); font-size: 0.85rem; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  align-items: center;
}

.nav-links a {
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-light);
}

/* Mobile menu */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}
.nav-toggle svg { width: 24px; height: 24px; }

/* ----- Main Layout ----- */
.main {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

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

.section {
  padding: 60px 0;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.section-title-zh {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-weight: 400;
}

/* ----- Hero ----- */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-name {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.hero-name .cn { font-weight: 400; font-size: 1.6rem; color: var(--text-muted); }

.hero-title {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 4px;
}

.hero-affiliation {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.tag {
  display: inline-block;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 20px;
  transition: all 0.2s;
  white-space: nowrap;
}
.tag:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
}

.hero-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
}

/* ----- About ----- */
.about-content {
  max-width: 720px;
  margin: 0 auto;
}

.about-content p {
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.8;
}
.about-content p:last-child { margin-bottom: 0; }

.about-zh {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.8;
}
.about-zh-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* ----- News ----- */
.news-list {
  list-style: none;
}

.news-item {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.news-item:last-child { border-bottom: none; }

.news-date {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 80px;
  padding-top: 2px;
}

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

/* ----- Research Interests ----- */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.interest-card {
  padding: 20px 24px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  transition: all 0.2s;
  border: 1px solid transparent;
}
.interest-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.interest-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

.interest-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ----- Publications ----- */
.pub-list { list-style: none; }

.pub-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:last-child { border-bottom: none; }

.pub-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.pub-authors strong { color: var(--text); font-weight: 600; }

.pub-venue {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.pub-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  transition: all 0.2s;
}
.pub-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ----- Projects ----- */
.project-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  transition: all 0.2s;
}
.project-card:last-child { margin-bottom: 0; }
.project-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.project-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.project-status.published { background: #c6f6d5; color: #22543d; }
.project-status.ongoing { background: #fefcbf; color: #744210; }
.project-status.other { background: var(--bg-alt); color: var(--text-muted); }

.project-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.project-summary {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.7;
}

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

.project-tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 12px;
}

/* ----- Sections for CV page (Experience, Education, etc.) ----- */
.timeline-item {
  position: relative;
  padding: 0 0 28px 24px;
  border-left: 2px solid var(--border);
  margin-left: 4px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.timeline-org {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 2px;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.timeline-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 4px;
}
.timeline-desc ul {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}
.timeline-desc li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 3px;
}
.timeline-desc li::before {
  content: '·';
  position: absolute;
  left: 4px;
  font-weight: 700;
  color: var(--accent);
}

/* ----- Skills ----- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.skill-item {
  padding: 8px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.skill-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ----- Contact Page ----- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  max-width: 650px;
  margin: 0 auto;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.contact-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.contact-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  border-radius: 10px;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.contact-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}

/* ----- Philosophy Section ----- */
.philosophy-block {
  padding: 28px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  margin: 16px 0;
}

.philosophy-block p {
  font-size: 0.95rem;
  line-height: 1.8;
  font-style: italic;
  color: var(--text);
}

/* ----- Ongoing Work ----- */
.ongoing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.ongoing-item {
  padding: 20px;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.ongoing-item:hover {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-light);
}

.ongoing-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

.ongoing-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ----- Footer ----- */
.footer {
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

/* ----- Page Header ----- */
.page-header {
  padding: 48px 0 32px;
  text-align: center;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.page-header p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .nav-links { display: none; }

  .nav-toggle { display: block; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    gap: 2px;
  }

  .nav-links.open a {
    display: block;
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  .hero { padding: 60px 0 40px; }
  .hero-name { font-size: 1.8rem; }
  .hero-name .cn { font-size: 1.3rem; }

  .section { padding: 40px 0; }

  .interests-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .contact-grid { grid-template-columns: 1fr; }

  .timeline-header { flex-direction: column; gap: 4px; }
  .timeline-date { white-space: normal; }
}

@media (max-width: 480px) {
  .hero { padding: 40px 0 32px; }
  .hero-name { font-size: 1.5rem; }
  .hero-name .cn { font-size: 1.1rem; }
  .section-title { font-size: 1.3rem; }
  .project-card { padding: 20px; }
}
