:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-soft: #faf9f5;
  --ink: #1d2422;
  --ink-soft: #3b4440;
  --muted: #68716c;
  --muted-light: #929a94;
  --line: #e5e2d9;
  --line-strong: #d4d0c5;
  --accent: #b44c30;
  --accent-deep: #8c3722;
  --teal: #276b54;
  --sans: "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Noto Serif SC", "Songti SC", Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --topbar-h: 64px;
  --search-h: 92px;
  --max: 1240px;
}

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

[hidden] {
  display: none !important;
}

main {
  flex: 1 0 auto;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + var(--search-h) + 16px);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 60;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  border-bottom: 1px solid rgba(212, 208, 197, 0.7);
  background: rgba(247, 246, 242, 0.92);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  width: min(var(--max), calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.brand-mark,
.hero-mark {
  display: inline-grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--serif);
  line-height: 1;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 17px;
}

.brand-name {
  font-size: 16px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-btn,
.icon-text-btn,
.icon-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.status-btn,
.icon-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
}

.status-btn:hover,
.icon-text-btn:hover,
.icon-btn:hover {
  background: rgba(29, 36, 34, 0.05);
  color: var(--ink);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-light);
}

.status-dot.is-ready {
  background: var(--teal);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: var(--muted);
}

/* Home */

.intro {
  width: min(680px, calc(100% - 40px));
  margin: 54px auto 18px;
  text-align: center;
}

.hero-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 15px;
  font-size: 30px;
}

.intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.intro p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

body.has-results .intro {
  display: none;
}

body:not(.has-results) .topbar .brand {
  visibility: hidden;
  pointer-events: none;
}

body:not(.has-results) .workspace {
  display: block;
  width: min(700px, calc(100% - 40px));
  margin-top: 10px;
}

body:not(.has-results) .results-column {
  padding: 0;
}

body:not(.has-results) .results-head {
  display: none;
}

body:not(.has-results) .examples {
  margin: 0 auto;
}

/* Search */

.search-sticky {
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
}

.search-sticky-inner {
  width: min(700px, calc(100% - 40px));
  margin: 0 auto;
  padding: 10px 0;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 7px 8px 7px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(37, 41, 38, 0.06);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search-form:focus-within {
  border-color: var(--ink-soft);
  box-shadow: 0 10px 32px rgba(37, 41, 38, 0.1);
}

.search-icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--muted);
  stroke-width: 1.8;
}

.search-form input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-form input::placeholder {
  color: var(--muted-light);
}

.search-form input::-webkit-search-cancel-button,
.search-form input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.clear-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.clear-btn:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.search-submit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}

.search-submit:hover {
  background: var(--accent);
}

.search-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.search-submit .icon {
  width: 14px;
  height: 14px;
}

.search-sticky.is-stuck .search-sticky-inner {
  padding-top: 8px;
  padding-bottom: 8px;
}

body.search-stuck .search-form {
  box-shadow: 0 7px 22px rgba(37, 41, 38, 0.08);
}

/* Layout */

.workspace {
  width: min(var(--max), calc(100% - 48px));
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(480px, 570px);
  gap: 38px;
  align-items: start;
  padding-bottom: 72px;
}

.results-column {
  min-width: 0;
  padding-top: 12px;
}

.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.results-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.result-count {
  color: var(--muted);
  font-size: 12px;
}

/* WoS / filters */

.import-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 8px;
  padding: 11px 14px;
  border: 1px solid #e7ddc8;
  border-radius: 10px;
  background: #fbf6ea;
  color: #6b5a36;
  font-size: 12px;
}

.import-banner > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.import-banner b {
  font-weight: 600;
}

#importMeta {
  overflow: hidden;
  color: #8b7b5d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-action {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.text-action:hover {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--line);
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
}

.filter-tab {
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.filter-tab:hover {
  color: var(--ink);
}

.filter-tab.is-active {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sort-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

.sort-control select {
  max-width: 92px;
  padding: 3px 17px 3px 0;
  border: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: inherit;
  font-size: 12px;
  cursor: pointer;
}

.sort-control .icon {
  position: absolute;
  right: 0;
  width: 11px;
  height: 11px;
  transform: rotate(90deg);
  pointer-events: none;
}

/* Results */

.result-list {
  display: flex;
  flex-direction: column;
}

.result-item {
  display: block;
  width: 100%;
  padding: 20px 16px 20px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.result-item:hover {
  padding-left: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.result-item.is-selected {
  padding-left: 16px;
  background: var(--surface);
  box-shadow: inset 3px 0 var(--accent);
}

.result-title {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.005em;
}

.result-title mark {
  background: #f5e4dc;
  color: inherit;
}

.result-authors {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-authors .corr {
  color: var(--accent-deep);
  font-weight: 600;
}

.corr-mark {
  margin-left: 2px;
  font-size: 10px;
  vertical-align: 1px;
}

.result-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
  color: var(--muted-light);
  font-size: 11px;
}

.badge-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 10px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}

.badge-oa,
.badge-doaj {
  border-color: #cfe2d8;
  background: #edf6f1;
  color: var(--teal);
}

.badge-sjr {
  border-color: #eadcbc;
  background: #faf2df;
  color: #6c4d12;
}

.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.date-badge .icon {
  width: 11px;
  height: 11px;
}

.result-journal {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-cited {
  white-space: nowrap;
}

.result-note {
  margin: 14px 0 0;
  color: var(--muted-light);
  font-size: 11px;
}

.skeleton {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.skeleton span {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, #eeece5, #f7f5ef, #eeece5);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

.skeleton span:nth-child(1) { width: 72%; height: 17px; }
.skeleton span:nth-child(2) { width: 46%; }
.skeleton span:nth-child(3) { width: 28%; }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.empty-block {
  padding: 40px 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-block p {
  margin: 0 0 12px;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 4px 0 12px;
}

.example-item {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.example-item:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

/* Detail */

.detail-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 14px 40px rgba(37, 41, 38, 0.05);
}

.detail-panel {
  overflow: hidden;
  border-radius: inherit;
}

.mobile-detail-head {
  display: none;
}

.paper-head {
  padding: 30px 30px 24px;
}

.paper-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.005em;
}

.paper-title mark {
  background: #f5e4dc;
  color: inherit;
}

.paper-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.pub {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pub-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-label {
  color: var(--muted-light);
  font-size: 11px;
}

.pub-date {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.pub-date.is-missing {
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
}

.pub-kind,
.pub-precision {
  color: var(--muted);
  font-size: 11px;
}

.pub-side {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
  font-size: 10.5px;
  text-align: right;
}

.pub-side em {
  margin-right: 5px;
  color: var(--muted-light);
  font-style: normal;
}

.paper-section {
  padding: 24px 30px;
  border-top: 1px solid var(--line);
}

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

.section-head h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-link {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.section-link:hover {
  color: var(--accent);
}

.journal-name {
  margin: 0;
  font-size: 16px;
  font-weight: 550;
  line-height: 1.5;
}

.journal-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

/* Metrics */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.metric span {
  display: block;
  overflow: hidden;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.metric-row:first-of-type {
  padding-top: 0;
}

.quiet-action {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
}

.quiet-action:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.metric-loading {
  margin: 0;
  padding: 9px 0;
  color: var(--muted-light);
  font-size: 12px;
}

.metric-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.metric-subhead a {
  color: var(--muted-light);
  font-size: 10px;
}

.metric-subhead a:hover {
  color: var(--accent);
}

.metric-more {
  margin-top: 12px;
}

.metric-more summary {
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.metric-more .metric-grid {
  margin-top: 9px;
}

.metric-caption {
  margin: 10px 0 0;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.6;
}

.source-line {
  display: flex;
  gap: 14px;
  margin: 16px 0 0;
  color: var(--muted-light);
  font-size: 9px;
}

.source-line a:hover {
  color: var(--accent);
}

/* Links */

.link-row {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.link-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.link-label {
  color: var(--muted-light);
  font-size: 11px;
}

.link-values {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
}

.link-values a {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
}

.link-values a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-text {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.link-meta {
  color: var(--muted-light);
  font-size: 10.5px;
}

/* Authors */

.corresponding {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.corresponding .icon {
  width: 13px;
  height: 13px;
}

.corresponding a {
  color: var(--accent);
}

.author-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}

.author {
  min-width: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.author-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.author-num {
  flex: none;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 9px;
}

.author-name {
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.author-tags {
  display: inline-flex;
  gap: 3px;
}

.author-tag {
  padding: 0 4px;
  border-radius: 3px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
}

.author-tag.is-corr {
  background: #fbede7;
  color: var(--accent-deep);
}

.author-aff {
  margin: 3px 0 0 17px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-links {
  display: flex;
  gap: 8px;
  margin: 3px 0 0 17px;
  font-size: 9px;
}

.author-links a {
  color: var(--accent);
}

.more-button {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
}

.more {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.more summary {
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.address-list {
  margin: 8px 0 0;
  padding-left: 15px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

/* Abstract, keywords, facts */

.abstract {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.abstract.is-clamped {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
}

.chip-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.chip-line > span:first-child {
  flex: none;
  min-width: 44px;
  color: var(--muted-light);
  font-size: 10px;
}

.chip {
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 22px;
  margin: 0;
}

.facts div {
  min-width: 0;
}

.facts dt {
  color: var(--muted-light);
  font-size: 10px;
}

.facts dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.55;
}

.facts a {
  color: var(--accent);
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.action:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.action .icon {
  width: 12px;
  height: 12px;
}

/* Modals */

.modal {
  width: min(500px, calc(100vw - 28px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(20, 24, 22, 0.2);
}

.modal::backdrop {
  background: rgba(27, 32, 29, 0.32);
  backdrop-filter: blur(3px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 0;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.modal-body {
  padding: 18px 22px 22px;
}

.modal-note {
  margin: 14px 0 0;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.65;
}

.modal-note a {
  color: var(--accent);
}

.prose p {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.75;
}

.prose p:last-child {
  margin-bottom: 0;
}

.about-links {
  display: flex;
  gap: 8px;
  margin-top: 16px !important;
  color: var(--muted-light);
  font-size: 11px !important;
}

.about-links a {
  color: var(--accent);
}

.settings-intro {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.key-row {
  display: flex;
  gap: 8px;
}

.key-row input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}

.key-row input:focus {
  outline: 2px solid rgba(180, 76, 48, 0.28);
  outline-offset: 1px;
}

.key-save {
  flex: none;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  cursor: pointer;
}

.key-save:hover {
  background: var(--accent);
}

.key-save:disabled {
  opacity: 0.55;
  cursor: wait;
}

.key-status {
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.6;
}

.key-status.is-ok {
  background: #edf6f1;
  color: var(--teal);
}

.key-status.is-error {
  background: #fbede7;
  color: var(--accent-deep);
}

.key-status.is-warn,
.key-status.is-working {
  background: #fbf4e5;
  color: #725a25;
}

.key-actions {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}

.drop-zone {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-height: 160px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
  text-align: center;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background: #fdf7f3;
}

.drop-zone .icon {
  width: 24px;
  height: 24px;
  margin-bottom: 5px;
  color: var(--muted);
}

.drop-zone strong {
  font-size: 13px;
  font-weight: 550;
}

.drop-zone span {
  color: var(--muted-light);
  font-size: 11px;
}

.drop-zone.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.import-status {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
}

.import-status.is-error {
  background: #fbede7;
  color: var(--accent-deep);
}

.import-status.is-working {
  background: #fbf4e5;
  color: #725a25;
}

/* Footer and utility */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.footer-inner {
  width: min(var(--max), calc(100% - 48px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand {
  font-weight: 600;
  font-size: 12px;
}

.footer-copy {
  color: var(--muted-light);
  font-size: 10px;
}

.footer-link {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.footer-link:hover {
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  position: fixed;
  inset: auto 0 0;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(420px, 500px);
    gap: 28px;
  }

  .paper-title {
    font-size: 25px;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-h: 58px;
    --search-h: 84px;
  }

  .topbar-inner,
  .workspace,
  .footer-inner {
    width: calc(100% - 32px);
  }

  .status-btn span:last-child {
    display: none;
  }

  .intro {
    margin-top: 38px;
  }

  .hero-mark {
    width: 48px;
    height: 48px;
    font-size: 27px;
  }

  .intro h1 {
    font-size: 30px;
  }

  .search-sticky-inner {
    width: calc(100% - 32px);
  }

  .search-form {
    min-height: 54px;
    padding-left: 15px;
  }

  .search-form input {
    font-size: 15px;
  }

  .workspace {
    display: block;
    margin-top: 8px;
  }

  .results-column {
    padding-top: 8px;
  }

  .detail-column {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    background: var(--bg);
    box-shadow: none;
  }

  body.detail-open .detail-column {
    display: block;
  }

  .mobile-detail-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    min-height: 54px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(247, 246, 242, 0.95);
    backdrop-filter: blur(12px);
  }

  .mobile-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
  }

  .mobile-detail-back .icon {
    width: 17px;
    height: 17px;
    transform: rotate(180deg);
  }

  .detail-panel {
    background: var(--surface);
  }

  body.detail-open {
    overflow: hidden;
  }

  .paper-head {
    padding: 24px 18px 20px;
  }

  .paper-title {
    font-size: 24px;
  }

  .paper-section {
    padding: 20px 18px;
  }

  .filter-bar {
    align-items: flex-start;
  }

  .filter-tools {
    width: 100%;
    gap: 18px;
  }

  .sort-control select {
    max-width: 100px;
  }

  .footer-inner {
    min-height: 58px;
  }
}

@media (max-width: 520px) {
  .brand-name {
    display: none;
  }

  .top-actions {
    gap: 2px;
  }

  .status-btn,
  .icon-text-btn {
    padding: 0 7px;
  }

  .search-submit {
    padding: 0 12px;
  }

  .search-submit span {
    display: none;
  }

  .search-submit .icon {
    width: 17px;
    height: 17px;
  }

  .pub {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .pub-side {
    align-items: flex-start;
    padding-left: 0;
    text-align: left;
  }

  .pub-date {
    font-size: 22px;
  }

  .metric-grid,
  .facts {
    grid-template-columns: 1fr;
  }

  .author-grid {
    grid-template-columns: 1fr;
  }

  .link-row {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .action {
    padding: 0 9px;
  }

  .modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .modal-head {
    padding: 17px 17px 0;
  }

  .modal-body {
    padding: 15px 17px 18px;
  }

  .key-row {
    flex-wrap: wrap;
  }

  .key-row input {
    flex-basis: 100%;
  }

  .key-save {
    width: 100%;
  }
}

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