/* ============================================================
   Personal Academic Website — Xinjing Guo
   Color scheme matches CV: primary #1A3A5C, accent #26A69A
   ============================================================ */

:root {
  --primary: #1a3a5c;
  --primary-light: #2a5580;
  --secondary: #3e5f8a;
  --accent: #26a69a;
  --accent-light: #b2dfdb;
  --accent-bg: #e8f5f3;
  --bg: #fafbfd;
  --sidebar-bg: #f0f4f8;
  --text: #263238;
  --text-light: #78909c;
  --border: #e0e6ec;
  --white: #ffffff;
  --gold: #f9a825;
  --shadow: 0 2px 12px rgba(26, 58, 92, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 58, 92, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    "Noto Serif SC",
    -apple-system,
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */
.header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--white);
  padding: 3rem 0 2.5rem;
}

.header-bg {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.03);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.header-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.header-text {
  flex: 1;
}

.name {
  font-family: "Noto Serif SC", serif;
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.name-en {
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  opacity: 0.7;
  letter-spacing: 0.02em;
  margin-left: 0.8rem;
}

.title {
  font-size: 1.05rem;
  opacity: 0.9;
  margin-bottom: 0.15rem;
}

.affiliation {
  font-size: 0.95rem;
  opacity: 0.75;
  margin-bottom: 1rem;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

.contact-row a {
  color: var(--accent-light);
  text-decoration: none;
}

.contact-row a:hover {
  text-decoration: underline;
}

.contact-row .sep {
  color: var(--accent-light);
  margin: 0 0.3rem;
}

.contact-row i {
  margin-right: 0.3rem;
}

.header-photo img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* ---- Navigation ---- */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.nav a {
  display: block;
  padding: 0.85rem 1.2rem;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav a:hover {
  color: var(--primary);
  border-bottom-color: var(--accent);
}

/* ---- Main ---- */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}

/* ---- Section ---- */
.section {
  padding-top: 2.5rem;
}

.section h2 {
  font-family: "Noto Serif SC", serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.section h2 i {
  color: var(--accent);
  margin-right: 0.5rem;
  font-size: 1.1rem;
}

/* ---- Research Overview ---- */
.overview-lead {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  padding: 1rem 1.2rem;
  background: var(--sidebar-bg);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

.two-paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.path-card {
  padding: 1.2rem 1.4rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow);
}

.path-card p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
}

.path-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
}

.forward .path-label {
  background: var(--accent-bg);
  color: var(--accent);
}

.inverse .path-label {
  background: #fff3e0;
  color: #e65100;
}

/* Flow Diagram */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1.5rem 1rem;
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  flex-wrap: wrap;
}

.flow-node {
  text-align: center;
  padding: 1rem 1.5rem;
  background: var(--sidebar-bg);
  border-radius: 10px;
  min-width: 160px;
  border: 1px solid var(--border);
}

.flow-icon {
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.flow-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.4;
}

.flow-text small {
  font-weight: 400;
  color: var(--text-light);
  font-size: 0.75rem;
}

.flow-arrow {
  color: var(--accent);
  font-size: 1.2rem;
}

.flow-feedback {
  width: 100%;
  text-align: center;
  padding-top: 0.6rem;
  margin-top: 0.2rem;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
  color: #e65100;
  font-weight: 500;
}

/* ---- Timeline ---- */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--accent);
  z-index: 1;
}

.timeline-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.timeline-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.timeline-meta {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-style: italic;
}

.timeline-content ul {
  list-style: none;
  padding: 0;
}

.timeline-content li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  line-height: 1.65;
}

.timeline-content li::before {
  content: "\f0da";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  top: 0.3rem;
}

.highlight {
  background: linear-gradient(transparent 60%, var(--accent-light) 60%);
  font-weight: 600;
}

/* ---- Software Grid ---- */
.software-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.software-card {
  padding: 1.3rem 1.4rem;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

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

.software-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.software-header h3 {
  font-size: 1.15rem;
  color: var(--primary);
  font-weight: 700;
}

.software-role {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.software-date {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-left: auto;
}

.software-full {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.software-card p:last-child {
  font-size: 0.88rem;
  line-height: 1.6;
}
.software-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
}
.software-link:hover {
  background: var(--primary);
  color: #fff;
}

/* ---- Publications ---- */
.pub-list {
  counter-reset: pub;
  list-style: none;
  padding: 0;
}

.pub-list li {
  counter-increment: pub;
  position: relative;
  padding: 0.8rem 0 0.8rem 2.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.7;
}

.pub-list li:last-child {
  border-bottom: none;
}

.pub-list li::before {
  content: "[" counter(pub) "]";
  position: absolute;
  left: 0;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
}

.pub-authors {
  color: var(--text);
}
.pub-authors u {
  font-weight: 600;
}
.pub-title {
  color: var(--primary);
}
.pub-venue {
  color: var(--text-light);
}

/* ---- Awards ---- */
.awards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.award-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.award-item i {
  color: var(--gold);
  font-size: 1rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.award-item strong {
  display: block;
  color: var(--primary);
  font-size: 0.88rem;
}

.award-item span {
  font-size: 0.78rem;
  color: var(--text-light);
}

.award-item.major {
  background: linear-gradient(135deg, #fffde7 0%, var(--white) 100%);
  border-color: #ffe082;
}

/* ---- Education (ResearchGate-style vertical list) ---- */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.edu-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.edu-item:last-child {
  border-bottom: none;
}

.edu-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--secondary);
  font-size: 1.1rem;
}

.edu-body {
  flex: 1;
}

.edu-degree {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.edu-badge {
  font-size: 0.7rem;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-weight: 600;
  margin-left: 0.3rem;
}

.edu-school {
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.edu-date {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.8rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
}

/* ---- Responsive: Tablet ---- */
@media (max-width: 960px) {
  .software-grid {
    grid-template-columns: 1fr 1fr;
  }
  .awards-grid {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 0 1.2rem 2rem;
  }
}

/* ---- Responsive: Mobile ---- */
@media (max-width: 640px) {
  /* Header */
  .header {
    padding: 2rem 0 1.8rem;
  }
  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 1.2rem;
    padding: 0 1rem;
  }
  .header-photo {
    order: -1;
  }
  .header-photo img {
    width: 100px;
    height: 100px;
  }
  .name {
    font-size: 1.8rem;
  }
  .name-en {
    display: block;
    margin-left: 0;
    margin-top: 0.2rem;
    font-size: 0.95rem;
  }
  .title {
    font-size: 0.9rem;
  }
  .affiliation {
    font-size: 0.85rem;
  }
  .contact-row {
    justify-content: center;
    font-size: 0.78rem;
    gap: 0.3rem;
  }
  .contact-row .sep {
    margin: 0 0.15rem;
  }

  /* Navigation */
  .nav-inner {
    padding: 0 0.8rem;
    -webkit-overflow-scrolling: touch;
  }
  .nav a {
    padding: 0.7rem 0.8rem;
    font-size: 0.8rem;
  }

  /* Main content */
  .main {
    padding: 0 1rem 2rem;
  }
  .section {
    padding-top: 1.8rem;
  }
  .section h2 {
    font-size: 1.15rem;
  }

  /* Research Overview */
  .overview-lead {
    font-size: 0.92rem;
    padding: 0.8rem 1rem;
  }
  .two-paths {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  .path-card {
    padding: 1rem;
  }
  .path-card p {
    font-size: 0.85rem;
  }

  /* Flow diagram */
  .flow-diagram {
    flex-direction: column;
    padding: 1rem 0.8rem;
    gap: 0.5rem;
  }
  .flow-node {
    min-width: unset;
    width: 100%;
    padding: 0.8rem 1rem;
  }
  .flow-arrow {
    transform: rotate(90deg);
  }
  .flow-feedback {
    font-size: 0.75rem;
  }

  /* Timeline */
  .timeline {
    padding-left: 1.5rem;
  }
  .timeline-dot {
    left: -1.5rem;
    width: 14px;
    height: 14px;
  }
  .timeline-content h3 {
    font-size: 0.92rem;
  }
  .timeline-content li {
    font-size: 0.85rem;
    padding-left: 1rem;
  }
  .timeline-meta {
    font-size: 0.75rem;
  }
  .timeline-date {
    font-size: 0.75rem;
  }

  /* Software */
  .software-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  .software-card {
    padding: 1rem;
  }
  .software-header {
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  .software-header h3 {
    font-size: 1rem;
  }
  .software-date {
    margin-left: 0;
  }
  .software-card p:last-child {
    font-size: 0.84rem;
  }

  /* Publications */
  .pub-list li {
    padding: 0.7rem 0 0.7rem 2rem;
    font-size: 0.84rem;
  }

  /* Awards */
  .awards-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .award-item {
    padding: 0.6rem 0.8rem;
    font-size: 0.84rem;
  }
  .award-item strong {
    font-size: 0.84rem;
  }

  /* Education */
  .edu-item {
    padding: 0.8rem 0;
    gap: 0.8rem;
  }
  .edu-icon {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }
  .edu-degree {
    font-size: 0.88rem;
  }
  .edu-school {
    font-size: 0.84rem;
  }

  /* Footer */
  .footer {
    padding: 1.5rem 1rem;
    font-size: 0.75rem;
  }
}

/* Prevent horizontal overflow on all screens */
html,
body {
  overflow-x: hidden;
}
img {
  max-width: 100%;
  height: auto;
}
.timeline-content,
.path-card p,
.overview-lead,
.pub-list li {
  overflow-wrap: break-word;
  word-break: break-word;
}
