/* ═══════════════════════════════════════════════════════
   Yixin Wang — shared site styles
   ═══════════════════════════════════════════════════════ */

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

:root {
  --c-bg: #FFFFFF;
  --c-sidebar: #FAF9F6;
  --c-hover: #F5F3EE;
  --c-text: #1B1B1B;
  --c-text-2: #555;
  --c-text-3: #888;
  --c-accent: #1a5632;
  --c-accent-bg: #e9f2ec;
  --c-border: #E4E1D9;
  --c-border-light: #F0EDE6;

  /* Award palette */
  --c-award: #8a6914;
  --c-award-strong: #a67c1a;
  --c-award-bg: #fdf6df;
  --c-award-bg-strong: #fbecb8;
  --c-award-border: #e8d278;

  --c-highlight-bg: #fff8eb;
  --c-highlight-border: #e8d5a8;

  /* Topic tag palette */
  --t-causal-c:   #1a5632;  --t-causal-bg:   #e4efe7;
  --t-bayes-c:    #1f4a85;  --t-bayes-bg:    #e2e9f5;
  --t-vi-c:       #3b7ab8;  --t-vi-bg:       #e6f0fa;
  --t-rep-c:      #6a3f8a;  --t-rep-bg:      #ede4f3;
  --t-llm-c:      #9a4a15;  --t-llm-bg:      #fae4d2;
  --t-theory-c:   #4a4a4a;  --t-theory-bg:   #ececec;
  --t-fair-c:     #a63d5a;  --t-fair-bg:     #f7e1e8;
  --t-app-c:      #0c6e85;  --t-app-bg:      #d9ecf2;

  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: 'Instrument Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.page { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 56px 36px;
  border-right: 1px solid var(--c-border);
  background: var(--c-sidebar);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 24px;
  filter: grayscale(15%);
  transition: filter 0.4s;
}
.sidebar-photo:hover { filter: grayscale(0%); }

.sidebar-name {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.sidebar-aff {
  font-size: 0.9rem;
  color: var(--c-text-2);
  margin-top: 4px;
}

.sidebar-email {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c-text-3);
  text-decoration: none;
  margin-top: 4px;
  display: inline-block;
  transition: color 0.2s;
}
.sidebar-email:hover { color: var(--c-accent); }

nav { margin-top: 40px; display: flex; flex-direction: column; gap: 3px; }

nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--c-text-2);
  padding: 9px 14px;
  border-radius: 7px;
  transition: background 0.2s, color 0.2s;
}
nav a:hover { background: var(--c-hover); color: var(--c-text); }
nav a.active {
  color: var(--c-accent);
  background: var(--c-accent-bg);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 28px;
  font-size: 0.76rem;
  color: var(--c-text-3);
  line-height: 1.7;
}

/* ── MAIN ── */
.main {
  flex: 1;
  min-width: 0;
  max-width: 820px;
  padding: 56px 64px 96px;
}

.main-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 40px;
}

.main-subtitle {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--c-text-2);
  margin-top: -28px;
  margin-bottom: 32px;
  font-style: italic;
  font-weight: 400;
}

/* ═══ BIO / HOME PAGE ═══ */
.bio {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--c-text);
  animation: fadeIn 0.5s ease both;
  max-width: 640px;
}
.bio p { margin-bottom: 16px; }
.bio a {
  text-decoration-line: underline;
  text-decoration-color: var(--c-accent-bg);
  text-underline-offset: 2px;
  text-decoration-thickness: 2px;
  transition: text-decoration-color 0.2s;
}
.bio a:hover { text-decoration-color: var(--c-accent); }

.section-heading {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--c-text);
}

.interest-group {
  margin-bottom: 10px;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid var(--c-border-light);
  background: var(--c-sidebar);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.interest-group:hover {
  background: #fff;
  border-color: var(--c-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.interest-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--c-text);
  margin-bottom: 3px;
}

.interest-desc {
  font-size: 0.85rem;
  color: var(--c-text-2);
  line-height: 1.6;
}
.interest-desc a {
  text-decoration-line: underline;
  text-decoration-color: var(--c-accent-bg);
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
}
.interest-desc a:hover { text-decoration-color: var(--c-accent); }

.callout {
  margin-top: 32px;
  padding: 16px 20px;
  border-radius: 8px;
  background: var(--c-highlight-bg);
  border: 1px solid var(--c-highlight-border);
  font-size: 0.9rem;
  line-height: 1.6;
  animation: fadeIn 0.5s ease 0.15s both;
  max-width: 640px;
}
.callout strong { font-weight: 600; }
.callout a { text-decoration-line: underline; text-underline-offset: 2px; }

.info-line {
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--c-text-2);
  animation: fadeIn 0.5s ease 0.2s both;
  max-width: 640px;
}
.info-line a {
  text-decoration-line: underline;
  text-decoration-color: var(--c-accent-bg);
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
}
.info-line a:hover { text-decoration-color: var(--c-accent); }


.office-hours-callout {
  margin-top: 26px;
  padding: 16px 20px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f5faf6 0%, #eef6f0 100%);
  border: 1px solid #d6e7db;
  color: var(--c-text);
  font-size: 0.9rem;
  line-height: 1.65;
  max-width: 640px;
}
.office-hours-callout strong {
  color: var(--c-accent);
  margin-right: 6px;
}
.office-hours-callout a {
  font-weight: 600;
  text-decoration-color: #cfe3d6;
}
.office-hours-callout a:hover {
  text-decoration-color: var(--c-accent);
}

/* ═══ PAPERS PAGE ═══ */
.year-section {
  margin-bottom: 44px;
  animation: slideUp 0.45s ease both;
}

.year-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--c-bg);
  padding: 10px 0;
}

.year-num {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--c-accent);
  letter-spacing: -0.02em;
}

.year-rule { flex: 1; height: 1px; background: var(--c-border); }

/* ── PAPER CARD ── */
.paper {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.25s;
  border: 1px solid transparent;
  position: relative;
}
.paper:hover {
  background: var(--c-sidebar);
  border-color: var(--c-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.paper-authors {
  font-size: 0.82rem;
  color: var(--c-text-2);
  line-height: 1.5;
}

.paper-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.45;
  margin: 3px 0 5px;
  letter-spacing: -0.01em;
}

.paper-venue {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--c-text-3);
}

/* ── TOPIC TAGS (right after venue, spaced away from links) ── */
.paper-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  margin-bottom: 4px;
}

.topic {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
}

.topic-causal         { color: var(--t-causal-c);  background: var(--t-causal-bg); }
.topic-bayesian       { color: var(--t-bayes-c);   background: var(--t-bayes-bg); }
.topic-variational    { color: var(--t-vi-c);      background: var(--t-vi-bg); }
.topic-representation { color: var(--t-rep-c); background: var(--t-rep-bg); }
.topic-llm            { color: var(--t-llm-c);     background: var(--t-llm-bg); }
.topic-theory         { color: var(--t-theory-c);  background: var(--t-theory-bg); }
.topic-fairness       { color: var(--t-fair-c);    background: var(--t-fair-bg); }
.topic-application    { color: var(--t-app-c);     background: var(--t-app-bg); }

/* ── AWARD BADGE ── */
.paper-awards {
  margin: 12px 0 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.award {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-award);
  background: linear-gradient(135deg, var(--c-award-bg) 0%, var(--c-award-bg-strong) 100%);
  padding: 4px 11px;
  border-radius: 5px;
  border: 1px solid var(--c-award-border);
  letter-spacing: 0.005em;
  box-shadow: 0 1px 2px rgba(138, 105, 20, 0.08);
}
.award::before {
  content: '★';
  color: var(--c-award-strong);
  font-size: 0.82rem;
  line-height: 1;
}

/* ── PAPER LINKS (clearly separated from topics) ── */
.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 14px;
}
.paper-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--c-accent);
  padding: 2px 9px;
  border-radius: 4px;
  background: var(--c-accent-bg);
  transition: background 0.2s, color 0.2s;
}
.paper-links a:hover { background: var(--c-accent); color: #fff; }

/* ── TOPIC LEGEND ── */
.topic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 32px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--c-sidebar);
  border: 1px solid var(--c-border-light);
  font-size: 0.75rem;
  color: var(--c-text-3);
  align-items: center;
}
.topic-legend .legend-label {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.66rem;
  margin-right: 4px;
}

/* ═══ TEACHING PAGE ═══ */
.course {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.25s;
  animation: slideUp 0.45s ease both;
}
.course:hover {
  background: var(--c-sidebar);
  border-color: var(--c-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.course-term {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--c-text-3);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
  width: 100px;
}

.course-body { flex: 1; min-width: 0; }

.course-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--c-accent);
  background: var(--c-accent-bg);
  padding: 1px 7px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 4px;
}

.course-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.course-title a {
  color: var(--c-text);
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 0.2s;
}
.course-title a:hover { text-decoration-color: var(--c-accent); }

/* ═══ COURSE PAGE (long-form content) ═══ */
.prose {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--c-text);
  max-width: 720px;
}
.prose h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 44px;
  margin-bottom: 14px;
  scroll-margin-top: 20px;
}
.prose h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 28px;
  margin-bottom: 10px;
}
.prose p { margin-bottom: 14px; }
.prose ul { margin: 10px 0 18px 22px; }
.prose ul li { margin-bottom: 6px; }
.prose a {
  text-decoration-line: underline;
  text-decoration-color: var(--c-accent-bg);
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
}
.prose a:hover { text-decoration-color: var(--c-accent); }
.prose code,
.prose .mono {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--c-sidebar);
  padding: 1px 6px;
  border-radius: 3px;
}
.prose strong { font-weight: 600; }

/* ── Page-local nav (Overview / Schedule / etc) ── */
.local-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--c-sidebar);
  border: 1px solid var(--c-border-light);
  margin-bottom: 32px;
  font-size: 0.78rem;
}
.local-nav a {
  font-family: var(--font-mono);
  text-decoration: none;
  color: var(--c-text-2);
  padding: 2px 10px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
.local-nav a:hover { background: var(--c-accent-bg); color: var(--c-accent); }

/* ── Lecture schedule table ── */
.schedule {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.schedule th,
.schedule td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--c-border-light);
  vertical-align: top;
}
.schedule th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-3);
  font-weight: 600;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-sidebar);
}
.schedule tr:hover td { background: var(--c-hover); }
.schedule .lec-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--c-text-3);
  white-space: nowrap;
  width: 80px;
}
.schedule .lec-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
  width: 80px;
  color: var(--c-text-2);
}
.schedule .lec-topic { font-weight: 500; }
.schedule .lec-break td {
  background: var(--c-sidebar);
  color: var(--c-text-3);
  font-style: italic;
  font-family: var(--font-serif);
}
.schedule .readings {
  font-size: 0.8rem;
  color: var(--c-text-2);
  line-height: 1.55;
}
.schedule .readings .book-key {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--c-accent);
  font-size: 0.72rem;
}

.book-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 6px 16px;
  padding: 14px 18px;
  border-radius: 8px;
  background: var(--c-sidebar);
  border: 1px solid var(--c-border-light);
  margin: 14px 0 20px;
  font-size: 0.82rem;
}
.book-legend > div { line-height: 1.5; }
.book-legend .book-key {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--c-accent);
  font-size: 0.72rem;
  margin-right: 6px;
}

/* ═══ ANIMATIONS ═══ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 960px) {
  .page { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
  }
  .sidebar-photo { width: 64px; height: 64px; margin-bottom: 0; }
  .sidebar-info { flex: 1; min-width: 140px; }
  nav { flex-direction: row; gap: 4px; margin-top: 0; width: 100%; flex-wrap: wrap; }
  .sidebar-footer { display: none; }
  .main { padding: 28px 20px 64px; }
  .year-dots { display: none; }
  .course { flex-direction: column; gap: 6px; align-items: flex-start; }
  .course-term { width: auto; }
  .schedule { font-size: 0.8rem; }
  .schedule th, .schedule td { padding: 8px 6px; }
  .schedule .lec-num { display: none; }
}



/* ═══ 2026 OVERRIDES: papers filter chips + wider course pages ═══ */
:root {
  --t-causal-c:        #5b4b8a;  --t-causal-bg:        #f0ebfb;
  --t-prob-c:          #155e75;  --t-prob-bg:          #e6f7fb;
  --t-rep-c:           #7c3aed;  --t-rep-bg:           #f1eafe;
  --t-ml-c:            #b45309;  --t-ml-bg:            #fff2e8;
  --t-impact-c:        #9d174d;  --t-impact-bg:        #fde7f3;
  --t-app-c:           #0369a1;  --t-app-bg:           #e0f2fe;
}

.topic {
  border: 1px solid rgba(27, 27, 27, 0.08);
  text-transform: none;
  letter-spacing: 0.01em;
  padding: 3px 9px;
  border-radius: 999px;
}

.topic-causal        { color: var(--t-causal-c); background: var(--t-causal-bg); }
.topic-probabilistic { color: var(--t-prob-c);   background: var(--t-prob-bg); }
.topic-representation { color: var(--t-rep-c); background: var(--t-rep-bg); }
.topic-ml            { color: var(--t-ml-c);     background: var(--t-ml-bg); }
.topic-impact        { color: var(--t-impact-c); background: var(--t-impact-bg); }
.topic-application   { color: var(--t-app-c);    background: var(--t-app-bg); }

.paper-topics {
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.paper-topic-chip {
  font-size: 0.68rem;
  line-height: 1.3;
  padding: 2px 8px;
}

.paper-links {
  gap: 6px;
  margin-top: 0;
  padding-top: 8px;
}

.topic-filter {
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s, opacity 0.18s;
}

button.topic-filter,
button.topic-filter-clear {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}

.topic-filter:hover,
.topic-filter-clear:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.08);
}

.topic-filter.is-active {
  border-color: currentColor;
  box-shadow: 0 0 0 2px rgba(27, 27, 27, 0.06);
}

.topic-legend {
  gap: 8px;
  padding: 14px 16px;
}

.topic-legend .legend-label {
  margin-right: 8px;
}

.filter-summary {
  margin-top: -20px;
  margin-bottom: 26px;
  font-size: 0.82rem;
  color: var(--c-text-2);
}

.filter-empty {
  margin-top: -10px;
  margin-bottom: 26px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px dashed var(--c-border);
  background: var(--c-sidebar);
  color: var(--c-text-2);
  font-size: 0.85rem;
}

.topic-filter-clear {
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-text-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.18s, box-shadow 0.18s;
}

.topic-filter-clear.is-active {
  background: var(--c-accent-bg);
  color: var(--c-accent);
  border-color: rgba(26, 86, 50, 0.18);
}

.paper.is-hidden,
.year-section.is-hidden,
.year-dot.is-hidden {
  display: none !important;
}

.course-page .page {
  display: block;
  min-height: auto;
}

.course-page .main {
  max-width: 1360px;
  width: min(1360px, calc(100vw - 72px));
  margin: 0 auto;
  padding: 40px 36px 96px;
}

.course-page .prose {
  max-width: none;
}

@media (max-width: 960px) {
  .filter-summary,
  .filter-empty {
    margin-top: 0;
  }
}


/* Strategic + expanded research-area colors for papers page */
:root {
  --t-llm-c:         #9a3412;  --t-llm-bg:         #ffeadb;
  --t-gen-c:         #0f766e;  --t-gen-bg:         #def7f3;
  --t-robust-c:      #92400e;  --t-robust-bg:      #fff3e0;
  --t-strategic-c:   #7c2d12;  --t-strategic-bg:   #feecdc;
  --t-rep-c:         #4338ca;  --t-rep-bg:         #e8e7ff;
}

.topic-language-models { color: var(--t-llm-c);       background: var(--t-llm-bg); }
.topic-generative-models { color: var(--t-gen-c);     background: var(--t-gen-bg); }
.topic-robustness { color: var(--t-robust-c);         background: var(--t-robust-bg); }
.topic-strategic { color: var(--t-strategic-c);       background: var(--t-strategic-bg); }
.topic-representation { color: var(--t-rep-c); background: var(--t-rep-bg); }









/* Papers page layout with right-side sticky year rail */
.papers-main {
  position: relative;
  max-width: 940px;
  padding-right: 86px;
}

.year-nav-rail {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 0;
  pointer-events: none;
}

.year-dots {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 20;
  pointer-events: auto;
}

.year-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--c-text-3);
  font-size: 0.68rem;
  font-weight: 500;
  font-family: var(--font-mono);
  transition: color 0.2s;
}

.year-dot:hover {
  color: var(--c-accent);
}

.year-dot .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-border);
  transition: background 0.2s, transform 0.2s;
}

.year-dot:hover .dot,
.year-dot.active .dot {
  background: var(--c-accent);
  transform: scale(1.4);
}

.year-dot .dot-label {
  opacity: 0;
  transition: opacity 0.2s;
}

.year-dot:hover .dot-label,
.year-dot.active .dot-label {
  opacity: 1;
}

@media (max-width: 1180px) {
  .papers-main {
    padding-right: 74px;
  }
}

/* Keep year dots on the right on phones */
@media (max-width: 960px) {
  .papers-main {
    padding-right: 30px;
  }

  .year-nav-rail {
    position: fixed;
    right: max(8px, env(safe-area-inset-right));
    top: 50%;
    bottom: auto;
    width: 12px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 30;
  }

  .year-dots {
    position: static;
    transform: none;
    right: auto;
    top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
  }

  .year-dot {
    width: 10px;
    height: 10px;
    font-size: 0;
    line-height: 0;
    gap: 0;
  }

  .year-dot .dot {
    width: 6px;
    height: 6px;
    margin: 2px;
  }

  .year-dot .dot-label {
    display: none !important;
    opacity: 0 !important;
  }
}

/* Top research-area chips */
.topic-legend .topic,
.topic-filter-clear {
  font-size: 0.70rem;
  line-height: 1.2;
}

/* Paper-level chips: match the top research-area tag style */
.paper-topics {
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.paper-topic-chip {
  font-size: 0.70rem !important;
  line-height: 1.2 !important;
  padding: 3px 9px !important;
  letter-spacing: 0.01em;
  border-radius: 999px;
}

.paper-links a {
  font-size: 0.70rem;
  line-height: 1.15;
}

@media (max-width: 1180px) {
  .papers-main {
    padding-right: 104px;
  }

  .year-nav-rail {
    right: 10px;
    width: 66px;
  }

  .year-dot {
    font-size: 0.66rem;
    padding: 5px 8px;
  }
}

@media (max-width: 960px) {
  .papers-main {
    padding-right: 84px;
  }

  .year-nav-rail {
    right: 2px;
    width: 58px;
  }

  .year-dots {
    top: 88px;
  }

  .year-dot .dot-label {
    display: none;
  }
}
