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

:root {
  --navy:   #0a1628;
  --blue:   #2563eb;
  --blue2:  #1d4ed8;
  --cyan:   #38bdf8;
  --bg:     #f0f4f8;
  --card:   #ffffff;
  --border: #e2e8f0;
  --text:   #0f172a;
  --muted:  #64748b;
  --ok:     #15803d;
  --err:    #dc2626;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Buttons ─────────────────────────────── */
.btn-primary {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 1px 4px rgba(37,99,235,.35);
}
.btn-primary:hover    { background: var(--blue2); box-shadow: 0 4px 14px rgba(37,99,235,.4); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary.full     { width: 100%; padding: 11px; margin-top: 8px; font-size: 15px; }

.btn-secondary {
  background: #fff;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: #eff6ff; }

/* ── Hero / Login ────────────────────────── */
.hero-wrap {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.hero-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 72px;
  background: linear-gradient(150deg, #0a1628 0%, #1e3a8a 55%, #1d4ed8 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* decorative circle accents */
.hero-left::before,
.hero-left::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero-left::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(56,189,248,.14) 0%, transparent 70%);
  top: -120px; right: -120px;
}
.hero-left::after {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(99,102,241,.12) 0%, transparent 70%);
  bottom: -80px; left: -80px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 28px;
  width: fit-content;
  position: relative;
}

.hero-title {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.12;
  margin-bottom: 20px;
  position: relative;
}
.hero-title span { color: var(--cyan); }

.hero-desc {
  font-size: 17px;
  line-height: 1.7;
  opacity: 0.82;
  max-width: 400px;
  margin-bottom: 44px;
  position: relative;
}

.hero-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.hero-features li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.feat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.feat-text strong { display: block; font-size: 14px; margin-bottom: 2px; }
.feat-text span   { font-size: 12px; opacity: .72; }

.hero-right {
  width: 420px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--bg);
}

/* ── Auth card ───────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 340px;
}
.auth-card h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.auth-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}
.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-top: 18px;
  margin-bottom: 5px;
}
.auth-card input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-card input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.switch { font-size: 13px; color: var(--muted); margin-top: 22px; text-align: center; }
.hint   { font-size: 11px; color: var(--muted); font-weight: 400; }

.alert { border-radius: 8px; padding: 11px 14px; font-size: 13px; margin-bottom: 18px; }
.alert-ok  { background: #f0fdf4; color: var(--ok);  border: 1px solid #bbf7d0; }
.alert-err { background: #fef2f2; color: var(--err); border: 1px solid #fecaca; }

/* ── Nav ─────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 56px;
}
.nav-logo { font-weight: 700; font-size: 17px; color: #fff; letter-spacing: -.3px; }
.nav-logo span { color: var(--cyan); }
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-email {
  color: rgba(255,255,255,.55);
  font-size: 13px;
  background: rgba(255,255,255,.07);
  border-radius: 20px;
  padding: 4px 12px;
}
.nav-right a { color: rgba(255,255,255,.75); font-size: 13px; }
.nav-right a:hover { color: #fff; text-decoration: none; }

/* ── Dashboard ───────────────────────────── */
.container { max-width: 860px; margin: 0 auto; padding: 32px 24px 80px; }

.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  overflow: hidden;
}
.settings-card summary {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 22px;
  font-weight: 600; font-size: 14px;
  cursor: pointer; user-select: none; list-style: none;
}
.settings-card summary::-webkit-details-marker { display: none; }
.sum-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: #eff6ff; color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.sum-arrow { margin-left: auto; font-size: 11px; color: var(--muted); transition: transform .2s; }
.settings-card[open] .sum-arrow { transform: rotate(180deg); }

.settings-form { padding: 4px 22px 22px; border-top: 1px solid var(--border); }

.field { margin-top: 18px; }
.field > label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px;
}
.field input[type="url"],
.field input[type="number"],
.field textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 9px 13px; font-size: 13px; font-family: inherit;
  outline: none; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.field textarea { resize: vertical; min-height: 64px; }
.field.inline { display: flex; align-items: center; gap: 10px; }
.field.inline label { margin: 0; white-space: nowrap; }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 5px; }

.or-div {
  text-align: center; color: #cbd5e1; font-size: 12px;
  margin: 16px 0 2px; position: relative;
}
.or-div::before, .or-div::after {
  content: ''; position: absolute; top: 50%;
  height: 1px; background: var(--border); width: 38%;
}
.or-div::before { left: 0; } .or-div::after { right: 0; }

.papers-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.papers-header h2 { font-size: 18px; font-weight: 700; }
.cache-age { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }

.status { border-radius: 8px; padding: 10px 16px; font-size: 13px; margin-bottom: 14px; }
.status.info  { background: #eff6ff; color: var(--blue);  border: 1px solid #bfdbfe; }
.status.ok    { background: #f0fdf4; color: var(--ok);    border: 1px solid #bbf7d0; }
.status.error { background: #fef2f2; color: var(--err);   border: 1px solid #fecaca; }
.hidden { display: none !important; }

.paper-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  display: flex;
  gap: 16px;
  transition: box-shadow .2s;
}
.paper-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); }

.paper-num {
  width: 26px; height: 26px; border-radius: 7px;
  background: #eff6ff; color: var(--blue);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.paper-body { flex: 1; min-width: 0; }

.paper-title a {
  font-size: 14px; font-weight: 600; color: var(--text);
  line-height: 1.45; display: block;
  transition: color .15s;
}
.paper-title a:hover { color: var(--blue); text-decoration: none; }

.paper-meta {
  font-size: 12px; color: var(--muted);
  margin-top: 5px; margin-bottom: 8px;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.paper-date {
  background: #f1f5f9; border-radius: 4px;
  padding: 1px 7px; font-size: 11px; font-weight: 500; color: var(--text);
}
.paper-abstract {
  font-size: 13px; color: #475569; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

.empty { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ── Responsive ──────────────────────────── */
@media (max-width: 800px) {
  .hero-wrap      { flex-direction: column; }
  .hero-left      { padding: 48px 28px 44px; }
  .hero-title     { font-size: 34px; }
  .hero-desc      { font-size: 15px; }
  .hero-right     { width: 100%; padding: 36px 24px 48px; }
  .auth-card      { max-width: 100%; }
}
