/* ============================================
   Xin Luna Dong — Academic Website
   Style: Academic Modern
   ============================================ */

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

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #1a1a2e;
  background: #f5f6f8;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: #163c6e; text-decoration: none; transition: color .2s; }
a:hover { color: #c0392b; }
a:visited { color: #4a3f6b; }

ul, ol { padding-left: 1.25em; }
li + li { margin-top: .35em; }

/* ---------- Utility ---------- */
.container { max-width: 1000px; margin: 0 auto; padding: 0 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.text-small { font-size: .85rem; color: #555; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e0e2e6;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-nav .nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #163c6e;
  white-space: nowrap;
}

.site-nav .nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

.site-nav .nav-links a {
  font-size: .9rem;
  font-weight: 600;
  color: #444;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.site-nav .nav-links a:hover,
.site-nav .nav-links a.active {
  color: #163c6e;
  border-bottom-color: #163c6e;
}

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; font-size: 1.5rem; color: #333; }

/* ---------- Hero ---------- */
.hero {
  background: #fff;
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid #e0e2e6;
}

.hero-inner {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.hero-photo {
  flex-shrink: 0;
  width: 180px;
  height: 240px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.hero-left {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 180px;
}

.hero-contact {
  margin-top: .75rem;
  font-size: .78rem;
  color: #555;
  line-height: 1.5;
  text-align: center;
}

.hero-text { flex: 1; }

.hero-text h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #163c6e;
  margin-bottom: .25rem;
}

.hero-text .subtitle {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 1rem;
}

.hero-text .bio {
  font-size: .95rem;
  color: #333;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.hero-links a {
  display: inline-block;
  font-size: .85rem;
  font-weight: 600;
  padding: .4rem .9rem;
  border: 1.5px solid #163c6e;
  border-radius: 6px;
  color: #163c6e;
  transition: background .2s, color .2s;
}

.hero-links a:hover {
  background: #163c6e;
  color: #fff;
}

/* ---------- Honors Ribbon ---------- */
.honors {
  background: linear-gradient(135deg, #163c6e 0%, #1e507a 100%);
  color: #fff;
  padding: 1rem 0;
}

.honors-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.25rem;
  list-style: none;
  padding: 0;
}

.honors-list li {
  font-size: .82rem;
  font-weight: 600;
  padding: .3rem .75rem;
  background: rgba(255,255,255,.13);
  border-radius: 20px;
  white-space: nowrap;
  margin: 0;
}

.honors-list .gold {
  background: rgba(201,148,46,.25);
  color: #fde9a9;
}

/* ---------- Sections ---------- */
.section {
  padding: 2.5rem 0;
}

.section + .section {
  border-top: 1px solid #e0e2e6;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #163c6e;
  margin-bottom: 1.25rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid #dde3ea;
  display: inline-block;
}

.section-title a { color: inherit; }

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

.news-list li {
  display: flex;
  gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid #eee;
  font-size: .92rem;
  margin: 0;
}

.news-list .news-date {
  flex-shrink: 0;
  width: 70px;
  font-weight: 700;
  color: #163c6e;
  font-size: .82rem;
}

/* ---------- Cards Grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #fff;
  border: 1px solid #e0e2e6;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: box-shadow .25s;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.09);
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #163c6e;
  margin-bottom: .5rem;
}

.card p {
  font-size: .9rem;
  color: #444;
  line-height: 1.6;
}

.card .card-footer {
  margin-top: .75rem;
  font-size: .85rem;
  font-weight: 600;
}

.card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 1rem;
}

/* ---------- Book Cards ---------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.book-card {
  display: flex;
  gap: 1.25rem;
  background: #fff;
  border: 1px solid #e0e2e6;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.book-card img {
  width: 90px;
  flex-shrink: 0;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.book-card .book-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #163c6e;
  margin-bottom: .35rem;
}

.book-card .book-info p {
  font-size: .85rem;
  color: #555;
  line-height: 1.5;
}

/* ---------- Talk Timeline ---------- */
.talk-list {
  list-style: none;
  padding: 0;
  border-left: 3px solid #dde3ea;
  margin-left: .5rem;
}

.talk-list li {
  padding: .75rem 0 .75rem 1.25rem;
  position: relative;
  margin: 0;
}

.talk-list li::before {
  content: '';
  position: absolute;
  left: -7.5px;
  top: 1rem;
  width: 12px;
  height: 12px;
  background: #163c6e;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #dde3ea;
}

.talk-list .talk-title {
  font-weight: 700;
  color: #1a1a2e;
  font-size: .95rem;
}

.talk-list .talk-venues {
  display: block;
  font-size: .85rem;
  color: #555;
  margin-top: .2rem;
}

.talk-resource {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  color: #163c6e;
  background: #e8edf4;
  padding: .12rem .45rem;
  border-radius: 4px;
  margin-right: .15rem;
  vertical-align: middle;
  letter-spacing: .01em;
}

.talk-resource:hover {
  background: #163c6e;
  color: #fff;
}

.talk-resource:visited {
  color: #163c6e;
}

.talk-resource:visited:hover {
  color: #fff;
}

/* ---------- Paper List ---------- */
.paper-section { margin-bottom: 2rem; }
.paper-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #163c6e;
  margin-bottom: .75rem;
}

.paper-list {
  list-style: none;
  padding: 0;
}

.paper-list li {
  padding: .55rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: .9rem;
  line-height: 1.6;
  margin: 0;
}

.paper-list .venue {
  font-style: italic;
  color: #555;
}

.paper-list .paper-links a {
  font-weight: 600;
  font-size: .82rem;
}

.paper-list .award {
  display: inline-block;
  background: #fef3cd;
  color: #856404;
  font-size: .75rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 3px;
  margin-left: .25rem;
}

/* ---------- Benchmark / Dataset Cards ---------- */
.bench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.bench-card {
  background: #fff;
  border: 1px solid #e0e2e6;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  font-size: .9rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.bench-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #163c6e;
  margin-bottom: .3rem;
}

.bench-card p {
  font-size: .82rem;
  color: #555;
}

/* ---------- Activities / Service Table ---------- */
.service-section { margin-bottom: 1.75rem; }
.service-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #163c6e;
  margin-bottom: .5rem;
}
.service-section p, .service-section li {
  font-size: .9rem;
  line-height: 1.6;
}

/* ---------- Patent List ---------- */
.patent-list { list-style: decimal; padding-left: 1.5em; }
.patent-list li {
  font-size: .9rem;
  padding: .3rem 0;
  margin: 0;
}

/* ---------- About / Personal ---------- */
.about-intro {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.about-intro img {
  width: 200px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  flex-shrink: 0;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.lesson-card {
  background: #fff;
  border: 1px solid #e0e2e6;
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}

.lesson-card img {
  border-radius: 6px;
  margin: .75rem auto 0;
  max-height: 180px;
}

.lesson-card h4 {
  font-size: 1rem;
  color: #163c6e;
  margin-bottom: .5rem;
}

/* ---------- Content Section (subpages) ---------- */
.content-section {
  padding: 2.5rem 0;
}

.content-section + .content-section {
  border-top: 1px solid #e0e2e6;
}

.content-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #163c6e;
  margin-bottom: 1.25rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid #dde3ea;
  display: inline-block;
}

.content-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #163c6e;
  margin-top: 2rem;
  margin-bottom: .75rem;
}

.alt-bg {
  background: #fff;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #1a1a2e;
  color: #aab;
  padding: 2rem 0;
  font-size: .85rem;
  text-align: center;
}

.site-footer a { color: #8ab4f8; }
.site-footer a:hover { color: #fff; }
.site-footer .footer-links {
  margin-bottom: .75rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------- Page Header (subpages) ---------- */
.page-header {
  background: #fff;
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid #e0e2e6;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #163c6e;
}

.page-header p {
  font-size: .95rem;
  color: #555;
  margin-top: .35rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero-inner { flex-direction: column; align-items: center; text-align: center; }
  .hero-photo { width: 140px; height: 140px; }
  .hero-links { justify-content: center; }
  .about-intro { flex-direction: column; align-items: center; text-align: center; }

  .site-nav .nav-links { display: none; }
  .nav-toggle { display: block; }
  .site-nav .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #e0e2e6;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
  }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .card-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: 1fr; }
  .bench-grid { grid-template-columns: 1fr 1fr; }
}
