:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: #f8fafc;
  color: #1e293b;
}

.site-nav {
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
}

.nav-logout-form {
  display: inline;
  margin: 0;
}

.nav-logout-form .nav-link {
  background: none;
  border: none;
  cursor: pointer;
}

.brand-mark { color: var(--accent); margin-right: 0.25rem; }

.btn-accent,
button.btn-accent {
  --bs-btn-color: #fff;
  --bs-btn-bg: #14b8a6;
  --bs-btn-border-color: #14b8a6;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #0d9488;
  --bs-btn-hover-border-color: #0d9488;

  background-color: #14b8a6;
  border-color: #14b8a6;
  color: #fff;
}
.btn-accent:hover,
button.btn-accent:hover {
  background-color: #0d9488;
  border-color: #0d9488;
  color: #fff;
}

.btn-orcid,
a.btn-orcid {
  --bs-btn-color: #fff;
  --bs-btn-bg: #a6ce39;
  --bs-btn-border-color: #7fb32a;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #8fb82f;
  --bs-btn-hover-border-color: #7aa328;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #7aa328;
  --bs-btn-active-border-color: #6d9224;
  --bs-btn-focus-shadow-rgb: 166, 206, 57;

  background-color: #a6ce39;
  border: 1px solid #7fb32a;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(166, 206, 57, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}
.btn-orcid:hover,
.btn-orcid:focus,
a.btn-orcid:hover,
a.btn-orcid:focus {
  background-color: #8fb82f;
  border-color: #7aa328;
  color: #fff;
  box-shadow: 0 3px 10px rgba(166, 206, 57, 0.4);
}

.btn-orcid-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  background: #fff;
  color: #7fb32a;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.auth-orcid-panel {
  background: #f8fdf2;
  border: 1px solid #c5e39a;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.auth-orcid-panel p {
  margin: 0 0 0.75rem;
  color: #4a6741;
  font-size: 0.85rem;
  line-height: 1.45;
}
.auth-orcid-badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.15rem 0.5rem;
  background: #e8f5d4;
  color: #4a6741;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
}

.auth-local-panel {
  padding-top: 0.25rem;
}

.auth-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: #64748b;
  font-size: 0.875rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #e2e8f0;
}

.col-md-5 form input[type="text"],
.col-md-5 form input[type="email"],
.col-md-5 form input[type="password"] {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
}

.hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1e3a5f 100%);
  color: var(--text);
  padding: 4rem 0;
}

.hero-label {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}

.hero-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-lead { color: var(--text-muted); font-size: 1.15rem; max-width: 36rem; }

.stats-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}
.stats-card-compact .stat-num { font-size: 2.25rem; }

.stat { display: flex; flex-direction: column; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.stat:last-child { border-bottom: none; }
.stat-num { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

.section-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
}

.topic-card {
  display: block;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.topic-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(20,184,166,0.15);
  color: inherit;
}
.topic-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.topic-card p { font-size: 0.85rem; color: #64748b; margin: 0 0 0.5rem; line-height: 1.4; }
.topic-count { font-size: 0.85rem; color: var(--accent); font-weight: 600; }

.paper-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.paper-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.paper-card-body { padding: 1.25rem; }
.paper-card h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
.paper-card h3 a { color: inherit; text-decoration: none; }
.paper-card h3 a:hover { color: var(--accent); }

.pdf-reader-embed {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
}

.pdf-viewer {
  background: #525659;
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pdf-viewer-compact {
  height: 85vh;
  min-height: 640px;
}

.pdf-viewer-fullscreen {
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100vh - 56px - 52px);
  border-radius: 0;
  border: 0;
}

.pdf-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.pdf-viewer-toolbar .btn-outline-secondary {
  color: #e2e8f0;
  border-color: #64748b;
}

.pdf-viewer-pages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  min-height: 0;
}

.pdf-viewer-page {
  display: block;
  width: 100%;
  max-width: 920px;
  height: auto !important;
  margin: 0 auto 1rem;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.pdf-viewer-error {
  color: #fff;
  padding: 2rem;
  text-align: center;
}

.pdf-viewer-error a {
  color: #5eead4;
}

body.reader-body {
  overflow: hidden;
}

body.reader-body main {
  padding: 0;
  margin: 0;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
}

.pdf-reader-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  background: #525659;
}

.pdf-reader-toolbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex: 0 0 auto;
  z-index: 2;
}

.pdf-reader-title {
  font-size: 0.9rem;
  max-width: min(70vw, 900px);
}

.paper-meta { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; font-size: 0.8rem; }
.paper-authors { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.paper-abstract { font-size: 0.9rem; color: #475569; margin-bottom: 0.75rem; }

.badge-seeded { background: #dbeafe; color: #1d4ed8; }
.badge-hosted { background: #ede9fe; color: #6d28d9; }
.badge-user { background: #d1fae5; color: #047857; }

.paper-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-decoration: none;
}
.tag-muted { background: #e2e8f0; }

.paper-detail .paper-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
}

.paper-authors-detail { font-size: 1.1rem; color: var(--text-muted); }

.abstract-block h2, .sidebar-card h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.abstract-text {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.7;
}

.sidebar-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
}

.related-list { list-style: none; padding: 0; margin: 0; }
.related-list li { padding: 0.4rem 0; border-bottom: 1px solid #f1f5f9; font-size: 0.9rem; }
.related-list li:last-child { border-bottom: none; }

.site-footer {
  background: var(--bg-dark);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.site-footer a { color: var(--accent); }

.search-bar .form-control, .search-bar .form-select,
.submit-form .form-control, .submit-form .form-select {
  border-radius: 8px;
}

.success-icon {
  width: 64px; height: 64px;
  background: #d1fae5;
  color: #047857;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
}

.status-published { background: #d1fae5; color: #047857; }
.status-pending { background: #fef3c7; color: #b45309; }
.status-draft { background: #e2e8f0; color: #475569; }
.status-rejected { background: #fee2e2; color: #b91c1c; }
