/* ============ PreprintHub styles ============ */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --border: #e3e8f2;
  --border-strong: #d3dbec;
  --ink: #182033;
  --ink-2: #3c465c;
  --muted: #68738a;
  --navy: #1b3a6b;
  --navy-2: #2b53a0;
  --navy-soft: #e9effb;
  --gold: #c9a227;
  --gold-soft: #fbf3dc;
  --danger: #c53030;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(23, 36, 66, .05), 0 6px 22px -8px rgba(23, 36, 66, .10);
  --shadow-hover: 0 2px 4px rgba(23, 36, 66, .07), 0 14px 34px -10px rgba(23, 36, 66, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code { background: #eef1f8; border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-size: .9em; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--ink); letter-spacing: .2px; }
.brand-mark { display: inline-flex; }
.brand-mark svg { display: block; }
.brand-name { color: var(--navy); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--ink-2); font-weight: 500; font-size: 14.5px; padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav-links a:hover { color: var(--navy); }
.nav-links a.active { color: var(--navy); border-bottom-color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 10px 18px; cursor: pointer; transition: all .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 4px 12px -4px rgba(27, 58, 107, .45); }
.btn-primary:hover { background: var(--navy-2); color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border-color: transparent; }
.btn-ghost:hover { background: var(--navy-soft); }
.btn-danger { background: #fdecec; color: var(--danger); border-color: #f5c6c6; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { font-size: 13.5px; padding: 7px 13px; border-radius: 8px; }
.btn-lg { font-size: 16px; padding: 13px 26px; border-radius: 12px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 30px;
  padding: 64px 0 48px;
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(circle at 1px 1px, #cdd8ef 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 20% 20%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 90% 80% at 20% 20%, #000 20%, transparent 75%);
}
.hero-body { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 2.5px; color: var(--navy-2);
}
.dot-gold { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.hero-title { margin: 14px 0 6px; font-size: 46px; line-height: 1.15; letter-spacing: -.5px; color: var(--navy); font-weight: 800; }
.hero-sub { margin: 0 0 26px; font-size: 17px; color: var(--muted); max-width: 480px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-art { position: relative; display: flex; justify-content: center; }

/* ---------- Stats strip ---------- */
.stats-strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--navy); border-radius: var(--radius);
  color: #fff; overflow: hidden; box-shadow: var(--shadow);
  margin-bottom: 40px;
}
.stat { padding: 18px 10px; text-align: center; position: relative; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: rgba(255, 255, 255, .18); }
.stat strong { display: block; font-size: 26px; font-weight: 800; color: var(--gold); }
.stat span { font-size: 13px; color: rgba(255, 255, 255, .75); }

/* ---------- Sections ---------- */
.section { margin-bottom: 46px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 16px; }
.section-head h2 { margin: 0; font-size: 21px; color: var(--ink); font-weight: 800; }
.link-more { font-size: 14px; font-weight: 600; }
.page-head { margin: 36px 0 20px; }
.page-head h1 { margin: 0 0 4px; font-size: 28px; color: var(--navy); font-weight: 800; }

/* ---------- Cards grid ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.paper-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 18px 14px;
  box-shadow: var(--shadow); transition: all .18s ease; color: inherit;
}
.paper-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: #c7d3ea; }
.paper-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.paper-card-title { margin: 12px 0 4px; font-size: 16.5px; line-height: 1.45; color: var(--navy); font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.paper-card-authors { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-card-abs { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.paper-card-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--muted); }

/* ---------- Badge / chips ---------- */
.badge {
  display: inline-flex; align-items: center; padding: 3px 11px;
  border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: color-mix(in srgb, var(--c, #64748b) 12%, #fff);
  color: var(--c, #64748b);
  border: 1px solid color-mix(in srgb, var(--c, #64748b) 35%, #fff);
}
.chip { display: inline-block; background: var(--navy-soft); color: var(--navy); border-radius: 6px; padding: 2px 9px; font-size: 13px; margin: 0 6px 6px 0; }
.chip-link {
  display: inline-block; padding: 4px 12px; margin: 3px 6px 3px 0;
  border-radius: 999px; font-size: 13px; color: var(--ink-2);
  background: #fff; border: 1px solid var(--border); font-weight: 500;
}
.chip-link:hover { border-color: var(--navy-2); color: var(--navy); }
.chip-link.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.doi-chip { color: #0d9488; font-weight: 700; }

/* ---------- Toolbar / search ---------- */
.toolbar { padding: 14px; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); }
.search-box input {
  width: 100%; padding: 9px 12px 9px 34px; border-radius: 9px;
  border: 1px solid var(--border-strong); font-size: 14.5px; font-family: inherit;
  background: #fff; outline: none; transition: border .15s;
}
.search-box input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(43, 83, 160, .13); }
.cat-chips { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }

/* ---------- Card generic ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty { text-align: center; padding: 64px 20px; }
.empty.msg { max-width: 520px; margin: 60px auto; }
.empty h2 { margin: 10px 0 6px; color: var(--navy); }
.empty p { margin: 0 0 18px; }
.msg-icon { font-size: 34px; opacity: .5; }

/* ---------- Paper detail ---------- */
.paper-hero { padding: 30px 32px; margin-bottom: 20px; }
.paper-head { display: flex; align-items: center; justify-content: space-between; }
.paper-title { margin: 14px 0 10px; font-size: 27px; line-height: 1.4; color: var(--navy); font-weight: 800; word-break: break-word; }
.paper-authors { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--ink-2); }
.abstract { background: #fafbfe; border-left: 3px solid var(--gold); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 18px 0; }
.abstract h2 { margin: 0 0 6px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); }
.abstract p { margin: 0; font-size: 15px; }
.kw-row { margin: 6px 0 12px; }
.meta-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; margin: 16px 0 18px; }
.meta-list div { background: #f6f8fd; border-radius: 9px; padding: 8px 12px; }
.meta-list dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.meta-list dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; word-break: break-all; }
.paper-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Share card ---------- */
.share-card { padding: 18px 20px; margin-bottom: 24px; border-left: 4px solid var(--gold); }
.share-label { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: var(--gold); text-transform: uppercase; margin-bottom: 8px; }
.share-row { display: flex; gap: 10px; }
.share-input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: 10px; font-size: 14px; font-family: inherit; color: var(--ink);
  background: #f8fafd; outline: none;
}
.share-input:focus { border-color: var(--navy-2); }
.share-card .muted { margin: 8px 0 0; }
#copyTip { font-size: 13px; }

/* ---------- PDF preview ---------- */
.preview { margin-bottom: 40px; }
.preview-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff; padding: 9px 16px;
  border-radius: var(--radius) var(--radius) 0 0; font-size: 13.5px; font-weight: 600;
}
.preview-bar a { color: rgba(255, 255, 255, .8); }
.preview-bar span { display: inline-flex; align-items: center; gap: 7px; }
.pdf-wrap {
  background: #dfe3ee; border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius); padding: 10px;
  box-shadow: var(--shadow);
}
.pdf-embed { display: block; width: 100%; height: 76vh; min-height: 420px; border: none; background: #fff; border-radius: 8px; }

/* ---------- Upload form ---------- */
.form { padding: 26px 28px; margin-bottom: 40px; }
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: #fafbfe; padding: 30px 16px; text-align: center; cursor: pointer;
  transition: all .15s; margin-bottom: 22px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--navy-2); background: var(--navy-soft); }
.dropzone svg { display: inline-block; margin-bottom: 6px; }
.dropzone p { margin: 4px 0; }
.dropzone.has-file { border-style: solid; border-color: #2f9e6e; background: #eefaf4; }
.dz-file-name { font-weight: 700; color: var(--navy); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field em { color: var(--danger); font-style: normal; }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 14.5px; color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 9px; padding: 9px 12px;
  background: #fff; outline: none; transition: border .15s, box-shadow .15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(43, 83, 160, .13);
}
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.inline-form { display: inline-flex; }
.alert { border-radius: 11px; padding: 12px 16px; margin-bottom: 18px; font-size: 14.5px; }
.alert-error { background: #fdecec; color: var(--danger); border: 1px solid #f5c6c6; }
.alert-admin {
  background: var(--navy-soft); border: 1px solid #c9d8f2; color: var(--navy);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.form .alert { margin-top: 0; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; position: relative; box-shadow: var(--shadow);
}
.step-num {
  position: absolute; top: -12px; left: 20px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--gold); color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.step h3 { margin: 8px 0 6px; font-size: 16px; color: var(--navy); }
.step p { margin: 0; font-size: 13.8px; color: var(--muted); }

/* ---------- Pager ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 26px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: #fff; margin-top: 30px; }
.footer-in { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 24px 22px; flex-wrap: wrap; }
.footer-in strong { color: var(--navy); }
.footer-in p { margin: 4px 0 0; max-width: 460px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { font-size: 14px; color: var(--muted); }
.footer-links a:hover { color: var(--navy); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 40px 0 30px; }
  .hero-art { display: none; }
  .hero-title { font-size: 34px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .steps { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: repeat(3, 1fr); }
  .paper-hero { padding: 22px; }
  .pdf-embed { height: 60vh; }
}
