:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --ink: #18201c;
  --muted: #687168;
  --line: #ddd6c9;
  --panel: #fffdf8;
  --panel-strong: #ede4d5;
  --accent: #0f766e;
  --accent-ink: #073f3b;
  --gold: #aa7a18;
  --danger: #a23b3b;
  --shadow: 0 18px 50px rgba(38, 34, 25, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.08), transparent 32%),
    linear-gradient(260deg, rgba(170, 122, 24, 0.1), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 30px clamp(18px, 5vw, 56px) 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.98;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.search input,
.toolbar select,
.comment-form input,
.comment-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  color: var(--ink);
  outline: none;
}

.search input,
.toolbar select {
  min-height: 40px;
  padding: 0 12px;
}

.search input {
  width: min(320px, 56vw);
}

.layout {
  display: grid;
  grid-template-columns: minmax(190px, 260px) 1fr;
  gap: 24px;
  padding: 24px clamp(18px, 5vw, 56px) 46px;
}

.year-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.76);
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.year-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: calc(100vh - 92px);
  overflow: auto;
  padding: 12px;
}

.year-btn {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.year-btn:hover,
.year-btn.active {
  border-color: rgba(15, 118, 110, 0.32);
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-ink);
  font-weight: 800;
}

.content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.year-hero,
.section,
.word-detail,
.paper-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: var(--shadow);
}

.year-hero {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(22px, 4vw, 38px);
}

.year-hero h2 {
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 8vw, 6.4rem);
  line-height: 0.9;
}

.year-hero p {
  max-width: 860px;
  color: var(--muted);
  line-height: 1.8;
}

.year-stats {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 146px;
}

.year-stats span {
  display: block;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--accent-ink);
}

.year-stats strong {
  font-size: 1.4rem;
}

.section,
.word-detail,
.paper-list {
  padding: 20px;
}

.section-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h3 {
  margin-bottom: 0;
  font-size: 1.18rem;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.keyword-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.keyword-card {
  min-height: 96px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.keyword-card:hover,
.keyword-card.active {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.42);
  background: #edf7f4;
}

.keyword-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.keyword-card span {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(170, 122, 24, 0.12);
  color: #76510c;
  font-size: 0.78rem;
}

.world-word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.world-word {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: #f4fbf8;
  color: var(--accent-ink);
  font-weight: 700;
  line-height: 1.35;
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
  gap: 18px;
}

.question-list {
  display: grid;
  gap: 10px;
}

.question-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf6ee;
  line-height: 1.6;
}

.copy-btn,
.small-btn {
  min-height: 34px;
  border: 1px solid rgba(15, 118, 110, 0.32);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-ink);
  font-weight: 700;
}

.copy-btn {
  padding: 0 10px;
}

.paper-list ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 22px;
}

.paper-list li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  line-height: 1.55;
}

.paper-item {
  display: grid;
  gap: 8px;
  position: relative;
}

.paper-title {
  color: var(--accent-ink);
  font-weight: 800;
  text-decoration: none;
}

.paper-title:hover,
.paper-doi:hover,
.paper-authors a:hover,
.paper-verify:hover {
  text-decoration: underline;
}

.paper-meta,
.paper-authors {
  color: var(--muted);
  font-size: 0.9rem;
}

.paper-doi,
.paper-authors a,
.paper-verify {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.paper-verify {
  width: max-content;
  font-size: 0.88rem;
  font-weight: 700;
}

.paper-tooltip {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 42px;
  z-index: 20;
  display: grid;
  gap: 10px;
  max-width: 720px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 18px 42px rgba(24, 32, 28, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.paper-title:hover ~ .paper-tooltip,
.paper-title:focus ~ .paper-tooltip,
.paper-tooltip:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.paper-tooltip strong {
  color: var(--accent-ink);
  font-size: 1rem;
  line-height: 1.45;
}

.paper-tooltip p {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
}

.paper-tooltip dl {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 7px 10px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.paper-tooltip dt {
  color: var(--gold);
  font-weight: 800;
}

.paper-tooltip dd {
  margin: 0;
}

.tooltip-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.comment-form {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 10px;
  align-items: stretch;
}

.comment-form input,
.comment-form textarea {
  min-height: 44px;
  padding: 10px 12px;
}

.comment-form textarea {
  min-height: 44px;
  resize: vertical;
}

.comment-form button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.form-message {
  min-height: 22px;
  margin-top: 10px;
  color: var(--muted);
}

.comment-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.comment-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.comment-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.small-btn.report {
  border-color: rgba(162, 59, 59, 0.28);
  background: rgba(162, 59, 59, 0.08);
  color: var(--danger);
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .topbar,
  .year-hero,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .layout,
  .detail-shell {
    grid-template-columns: 1fr;
  }

  .year-panel {
    position: relative;
    top: auto;
    max-height: none;
  }

  .year-list {
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    max-height: 210px;
  }

  .comment-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .topbar,
  .layout {
    padding-left: 14px;
    padding-right: 14px;
  }

  .question-item {
    grid-template-columns: 1fr;
  }
}
