/* ===== Variables ===== */
:root {
  --accent:       #003087;
  --accent-dark:  #00226b;
  --accent-light: #e8edf7;
  --text:         #1a1a1a;
  --text-muted:   #666;
  --border:       #e2e5ea;
  --bg:           #ffffff;
  --bg-alt:       #f6f7fb;
  --radius:       5px;
  --max-w:        960px;
  --font: system-ui, -apple-system, 'Segoe UI', Arial,
          'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ===== Language toggle ===== */
body[data-lang="en"] .zh { display: none; }
body[data-lang="zh"] .en { display: none; }

/* ===== Layout ===== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 15px 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.01em;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--accent); }
.lang-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font);
  letter-spacing: 0.04em;
  transition: all 0.2s;
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Hero ===== */
.hero {
  padding: 76px 0 68px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(160deg, #f0f4fb 0%, #ffffff 60%);
}
.hero-affiliation {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.75;
  margin-bottom: 34px;
}
.hero-links { display: flex; gap: 12px; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  font-family: var(--font);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-secondary:hover { background: var(--accent-light); }

/* ===== Sections ===== */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 40px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ===== News ===== */
.news-list {
  display: grid;
  gap: 18px;
}
.news-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.news-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.news-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 8px;
}
.news-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 10px;
}
.news-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== Research Grid ===== */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.research-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.research-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 14px rgba(0, 48, 135, 0.09);
}
.research-num {
  font-size: 26px;
  font-weight: 800;
  color: #ccd8ef;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.research-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 10px;
}
.research-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ===== Publication Filters ===== */
.pub-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.filter-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 15px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font);
  transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== Publication List ===== */
.pub-year-group { margin-bottom: 44px; }
.pub-year {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
  padding-left: 11px;
  border-left: 3px solid var(--accent);
  line-height: 1.3;
}
.pub-list { list-style: none; }
.pub-item {
  display: flex;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s;
}
.pub-item.hidden { display: none; }

/* Venue column */
.pub-venue-wrap {
  flex-shrink: 0;
  width: 116px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding-top: 1px;
}
.pub-venue {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.pub-venue.preprint { background: #f0f0f0; color: #777; }
.pub-venue.wsdm     { background: #e8f0fe; color: #1a56db; }
.pub-venue.neurips  { background: #fce8e6; color: #b91c1c; }
.pub-venue.icml     { background: #fef3c7; color: #92400e; }
.pub-venue.www      { background: #e6f4ea; color: #166534; }
.pub-venue.kdd      { background: #f3e8fd; color: #6b21a8; }
.pub-venue.cikm     { background: #fff3e0; color: #c2410c; }
.pub-venue.tist     { background: #e6f7f7; color: #0e7490; }
.pub-award {
  font-size: 10px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
}

/* Topic tags in venue column */
.pub-venue-wrap .tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 500;
  white-space: nowrap;
}
.tag.forecasting   { background: #e8f0fe; color: #1a56db; }
.tag.classification{ background: #e6f4ea; color: #166534; }
.tag.anomaly       { background: #fff4e5; color: #b45309; }
.tag.foundation    { background: #fce8e6; color: #b91c1c; }
.tag.agent         { background: #f3e8fd; color: #6b21a8; }
.tag.survey        { background: #fff3e0; color: #c2410c; }

/* Content column */
.pub-content { flex: 1; min-width: 0; }
.pub-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 5px;
}
.pub-authors {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}
.pub-links { display: flex; gap: 10px; flex-wrap: wrap; }
.pub-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  font-weight: 500;
  transition: border-color 0.15s;
}
.pub-link:hover { border-bottom-color: var(--accent); }

/* ===== Open Source ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 14px rgba(0, 48, 135, 0.09);
}
.project-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.project-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 999px;
  padding: 4px 10px;
  letter-spacing: 0.03em;
}
.project-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.project-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

/* ===== Funding ===== */
.funding-intro {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.funding-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.funding-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  min-width: 260px;
}
.funding-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.funding-abbr {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.2;
}
.funding-info { min-width: 0; }
.funding-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.funding-name-en {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* ===== Footer ===== */
.site-footer {
  background: #1a1a1a;
  color: #888;
  padding: 28px 0;
  font-size: 13px;
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 780px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .site-nav {
    width: 100%;
    gap: 18px;
    flex-wrap: wrap;
  }
  .news-item { grid-template-columns: 1fr; gap: 10px; }
  .research-grid { grid-template-columns: 1fr 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 28px; }
  .hero-desc { font-size: 15px; }
}
@media (max-width: 520px) {
  .container { padding: 0 18px; }
  .research-grid { grid-template-columns: 1fr; }
  .site-logo { font-size: 13px; }
  .site-nav {
    gap: 12px 16px;
    font-size: 13px;
  }
  .site-nav a { font-size: 13px; }
  .news-item { padding: 18px 16px; }
  .pub-item { flex-direction: column; gap: 8px; }
  .pub-venue-wrap { width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .project-card { padding: 20px 18px; }
  .hero { padding: 52px 0 48px; }
  .hero-links { flex-wrap: wrap; }
}
