:root {
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --ink: #171713;
  --muted: #6f7069;
  --line: #cbc9c1;
  --line-dark: #9d9d95;
  --accent: #e13d2f;
  --accent-soft: #f6dad4;
  --rail: 112px;
  --shadow: 0 18px 50px rgba(34, 30, 20, 0.16);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.back-home {
  position: fixed;
  z-index: 70;
  top: 16px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--ink);
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
  box-shadow: 5px 5px 0 rgba(23, 23, 19, 0.14);
  backdrop-filter: blur(10px);
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease;
}

.back-home:hover,
.back-home:focus-visible {
  background: var(--ink);
  color: var(--surface);
  box-shadow: 3px 3px 0 var(--accent);
  outline: none;
  transform: translate(-2px, -2px);
}

.masthead {
  border-bottom: 1px solid var(--ink);
  background: var(--surface);
}

.masthead__inner,
main,
footer {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
}

.masthead__inner { padding: 34px 0 24px; }

.eyebrow {
  margin-bottom: 20px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
}

h1 {
  margin: 0;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(44px, 6vw, 84px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.88;
}

h1 span { color: var(--accent); }

.lede {
  max-width: 660px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.summary div {
  min-width: 108px;
  padding: 16px 18px;
  background: var(--surface);
}

.summary dt {
  font-family: Georgia, serif;
  font-size: 29px;
  line-height: 1;
}

.summary dd {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.control-panel {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.search-field {
  display: grid;
  gap: 6px;
  min-width: 245px;
}

.search-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.search-field input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-dark);
  border-radius: 0;
  outline: none;
  background: transparent;
}

.search-field input:focus { border-color: var(--accent); }

.filter-set {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill,
.text-button,
.empty-state button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-dark);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
}

.filter-pill:hover,
.filter-pill:focus-visible,
.text-button:hover,
.text-button:focus-visible,
.empty-state button:hover { border-color: var(--ink); }

.filter-pill[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.text-button { margin-left: auto; }

main { padding: 20px 0 72px; }

.result-line {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 14px var(--rail);
  color: var(--muted);
  font-size: 11px;
}

.interaction-hint { color: var(--accent); }

.timeline {
  position: relative;
  isolation: isolate;
}

.timeline::before {
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 88px;
  width: 2px;
  background: var(--ink);
  content: "";
}

.year-block { --year-color: var(--accent); }
.year-block[data-year="2025"] { --year-color: #7658d7; }
.year-block[data-year="2024"] { --year-color: #2772c9; }

.year-heading {
  position: sticky;
  z-index: 6;
  top: 0;
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  align-items: center;
  min-height: 54px;
  border-top: 1px solid var(--ink);
  background: rgba(244, 241, 233, 0.96);
}

.year-block:first-child .year-heading { border-top: 0; }

.year-heading h2 {
  margin: 0;
  color: var(--year-color);
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.year-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.month-row {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 138px;
}

.month-label {
  position: relative;
  padding: 19px 28px 0 0;
  color: var(--year-color);
  text-align: right;
  font-size: 12px;
  font-weight: 800;
}

.month-label::after {
  position: absolute;
  top: 23px;
  right: 19px;
  width: 12px;
  height: 3px;
  background: var(--year-color);
  content: "";
}

.month-label small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.paper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  align-content: start;
  gap: 0;
  border-top: 2px dashed var(--line);
}

.paper-card {
  position: relative;
  min-height: 138px;
  padding: 17px 12px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.paper-card__button {
  display: grid;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.paper-card__button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.logo-frame {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.logo-frame img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.paper-card__name {
  display: -webkit-box;
  overflow: hidden;
  min-height: 32px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.paper-card__org {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paper-card__family {
  position: absolute;
  top: 15px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--family-color, var(--ink));
}

.paper-card[data-family="omni"] { --family-color: #e13d2f; }
.paper-card[data-family="unified"] { --family-color: #7658d7; }
.paper-card[data-family="native"] { --family-color: #147b64; }
.paper-card[data-family="tokenizer"] { --family-color: #c38116; }
.paper-card[data-family="vlm"] { --family-color: #2772c9; }
.paper-card[data-family="research"] { --family-color: #77766e; }

.paper-card:hover { background: var(--surface); }
.paper-card:hover .logo-frame { border-color: var(--ink); }

.tooltip {
  position: fixed;
  z-index: 50;
  display: grid;
  gap: 7px;
  width: min(350px, calc(100vw - 24px));
  padding: 13px 15px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.tooltip[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

.tooltip strong { color: #f0b14a; font-size: 11px; }
.tooltip span { font-size: 12px; line-height: 1.55; }

.modal-shell {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-shell[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 17, 14, 0.72);
}

.paper-modal {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 25px 28px 28px;
  border-top: 6px solid var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.paper-modal__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.modal-close {
  padding: 7px 10px;
  border: 1px solid var(--line-dark);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.paper-modal__identity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.paper-modal__logo {
  display: grid;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid var(--line);
}

.paper-modal__logo img { width: 48px; height: 48px; object-fit: contain; }
.paper-modal__identity p { margin: 0 0 5px; color: var(--muted); font-size: 12px; }

.paper-modal h2 {
  margin: 0;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(30px, 5vw, 50px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.paper-modal__title {
  margin: 28px 0 0;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 19px;
  line-height: 1.5;
}

.paper-modal__category {
  display: inline-block;
  margin-top: 19px;
  padding: 6px 9px;
  border: 1px solid var(--line-dark);
  color: var(--muted);
  font-size: 11px;
}

.paper-modal__contribution {
  margin: 18px 0 0;
  font-size: 15px;
  line-height: 1.8;
}

.paper-link {
  display: inline-flex;
  margin-top: 24px;
  padding: 12px 15px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  text-decoration: none;
  font-size: 12px;
}

.paper-link:hover, .paper-link:focus-visible { background: var(--accent); border-color: var(--accent); }

.empty-state {
  margin-left: var(--rail);
  padding: 80px 20px;
  border-top: 1px solid var(--line);
  text-align: center;
}

footer {
  padding: 18px 0 30px;
  border-top: 1px solid var(--line-dark);
  color: var(--muted);
  font-size: 10px;
}

body.modal-open { overflow: hidden; }

@media (max-width: 980px) {
  :root { --rail: 88px; }
  .title-row { align-items: start; flex-direction: column; }
  .summary { width: 100%; }
  .summary div { min-width: 0; }
  .control-panel { align-items: stretch; flex-direction: column; }
  .text-button { align-self: start; margin-left: 0; }
  .timeline::before { left: 68px; }
  .paper-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
}

@media (max-width: 600px) {
  :root { --rail: 58px; }
  .masthead__inner, main, footer { width: min(100% - 24px, 1480px); }
  .masthead__inner { padding-top: 22px; }
  h1 { font-size: 44px; }
  .summary div { padding: 12px 10px; }
  .summary dt { font-size: 24px; }
  .timeline::before { left: 43px; }
  .result-line { padding-left: 0; }
  .interaction-hint { display: none; }
  .year-heading h2 { font-size: 22px; }
  .year-heading p { font-size: 8px; }
  .month-label { padding-right: 17px; font-size: 10px; }
  .month-label::after { right: 8px; width: 8px; }
  .paper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paper-card { min-height: 132px; }
  .paper-modal { padding: 18px; }
  .paper-modal__identity { align-items: start; }
  .paper-modal__logo { flex-basis: 58px; width: 58px; height: 58px; }
  .paper-modal__logo img { width: 38px; height: 38px; }
  .back-home { top: 10px; right: 12px; }
  .back-home span:last-child { display: none; }
  .back-home span:first-child { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
