/* =========================================================
   LumenNav — Demo-aligned styles
   Author: Dylan Li
   ========================================================= */

:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #1a1d29;
  --muted: #6b7280;
  --border: #eceef3;
  --accent: #5b6cff;
  --accent-soft: #eef0ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 14px;
}
[data-theme="dark"] {
  --bg: #0f1115;
  --panel: #171922;
  --text: #e6e8ef;
  --muted: #9aa0ae;
  --border: #232636;
  --accent: #8b95ff;
  --accent-soft: #1e2140;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg) !important;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
html { scroll-behavior: smooth; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background-color: #c8ccd6; border-radius: 3px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background-color: #3b3f52; }

/* ============ Sidebar ============ */
.ln-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 240px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  z-index: 100;
}
.ln-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 8px 22px;
  color: var(--text);
}
.ln-logo, .ln-logo-img {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #5b6cff, #8b95ff);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 20px;
  box-shadow: 0 6px 16px rgba(91, 108, 255, .35);
  flex-shrink: 0;
  object-fit: cover;
}
.ln-brand-text { display: flex; flex-direction: column; min-width: 0; }
.ln-brand-name { font-weight: 700; font-size: 16px; }
.ln-brand-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ln-nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
.ln-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  transition: .15s;
  cursor: pointer;
}
.ln-nav-item:hover { background: var(--accent-soft); color: var(--accent); }
.ln-nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ln-nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; flex-shrink: 0; }
.ln-nav-item .count {
  margin-left: auto;
  font-size: 11px;
  opacity: .6;
}

.ln-side-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.ln-theme-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px; height: 32px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}
.ln-theme-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ============ Main ============ */
.ln-main {
  margin-left: 240px;
  padding: 24px 40px 60px;
  /*max-width: 1400px;*/
  min-height: 100vh;
}

.ln-alert {
  display: flex; gap: 10px; align-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
}

/* Sticky search */
.ln-topbar {
  position: sticky; top: 0;
  z-index: 5;
  padding: 8px 0 16px;
  background: var(--bg);
}
.ln-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  color: var(--muted);
}
.ln-search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 15px;
}
.ln-engines { display: flex; gap: 4px; flex-wrap: wrap; }
.ln-engine {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 10px; border-radius: 8px; font-size: 12px; cursor: pointer;
}
.ln-engine.active, .ln-engine:hover { background: var(--accent-soft); color: var(--accent); }

/* Hero */
.ln-hero { padding: 28px 4px 22px; }
.ln-hero h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; color: var(--text); font-weight: 700; }
.ln-hero p { margin: 0; color: var(--muted); font-size: 14px; }

/* Clock */
.ln-clock-wrap { display: flex; justify-content: center; padding: 8px 0 20px; }
.ln-clock { display: flex; align-items: baseline; color: var(--text); font-weight: 300; letter-spacing: -.02em; }
.ln-clock span { font-size: 56px; }
.ln-clock b { font-weight: 300; padding: 0 10px; font-size: 48px; color: var(--muted); }
.ln-clock i { font-style: normal; font-size: 28px; color: var(--muted); margin-left: 8px; }

/* Section */
.ln-section { margin-top: 8px; }
.ln-section-head {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 4px 12px;
}
.ln-section-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.ln-count {
  font-size: 12px; color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}
.ln-bar { flex: 1; height: 1px; background: var(--border); }
.ln-section-more { color: var(--muted); font-size: 12px; }
.ln-section-more:hover { color: var(--accent); }

/* Card grid */
.ln-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.ln-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.ln-card::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(91, 108, 255, .08), transparent 60%);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.ln-card:hover { transform: translateY(-2px); border-color: transparent; box-shadow: var(--shadow); }
.ln-card:hover::after { opacity: 1; }

.ln-card-body {
  display: flex; gap: 12px; flex: 1; min-width: 0;
  color: var(--text);
}
.ln-favicon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-soft); padding: 4px;
  color: var(--accent); display: block;
  flex-shrink: 0; object-fit: contain;
}
.ln-info { min-width: 0; flex: 1; }
.ln-title {
  font-size: 14px; font-weight: 600; margin: 0 0 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.ln-desc {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ln-stat {
  display: flex; gap: 12px; margin-top: 6px;
  font-size: 11px; color: var(--muted);
}
.ln-stat-item { display: inline-flex; align-items: center; gap: 3px; }
.ln-stat .iconfont { font-size: 12px; }
.ln-stat .set-likes:hover { color: #dc3545; cursor: pointer; }

.ln-fav-wrap {
  position: absolute; top: 8px; right: 8px;
  z-index: 2;
}
.ln-fav {
  color: var(--muted);
  font-size: 14px;
  opacity: 0;
  transition: .18s;
  cursor: pointer;
}
.ln-card:hover .ln-fav { opacity: 1; }
.ln-fav-wrap.collected .ln-fav,
.ln-fav:hover { color: #f5b301; opacity: 1; }

.ln-jump {
  position: absolute; bottom: 10px; right: 10px;
  color: var(--accent);
  opacity: 0;
  transition: opacity .18s;
  font-size: 14px;
}
.ln-card:hover .ln-jump { opacity: 1; }

.ln-card.ln-hidden { display: none; }
.ln-card.ln-appear {
  animation: ln-fade-up .35s ease both;
}
@keyframes ln-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.ln-load-sentinel {
  height: 40px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}
.ln-load-sentinel::before {
  content: "";
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ln-spin .8s linear infinite;
  margin-right: 8px;
}
.ln-load-sentinel.done { display: none; }
@keyframes ln-spin { to { transform: rotate(360deg); } }

.ln-empty { color: var(--muted); padding: 40px 4px; text-align: center; }
.ln-ad {
  margin: 24px 0 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}

.ln-foot { margin-top: 60px; text-align: center; color: var(--muted); font-size: 12px; padding-bottom: 20px; }
.ln-foot a { color: var(--muted); }
.ln-foot a:hover { color: var(--accent); }

/* Loader */
#loader {
  position: fixed; inset: 0;
  display: flex; place-content: center; place-items: center;
  background: var(--bg);
  transition: opacity .3s, visibility .3s;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: .1rem;
  z-index: 2000;
}
#loader span { animation: ln-loader .85s ease-in-out infinite alternate; }
@keyframes ln-loader { from { opacity: .25 } to { opacity: 1 } }
.hidden { opacity: 0; visibility: hidden; }

/* Local shortcuts side panel (recently / favorite) */
#sidebar {
  position: fixed; top: 20%;
  width: 308px; z-index: 999;
  right: 0;
}
#sidebar > div {
  position: absolute; right: -308px;
  width: 100%; min-height: 6rem;
  background: var(--panel); border: 1px solid var(--border); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  box-shadow: var(--shadow);
  transition: right .35s ease-in-out;
}
#sidebar > div:last-of-type { top: 4.5rem; }
#sidebar > div:hover { right: 0; z-index: 1000; }
#sidebar .title {
  position: absolute; height: 4rem; width: 2rem;
  line-height: 2rem; text-align: center;
  right: 308px; top: 1rem;
  writing-mode: vertical-rl; cursor: pointer;
  background: var(--accent); color: #fff;
  border-radius: 10px 0 0 10px;
  font-size: 12px; padding: .4rem 0;
}
#sidebar .body {
  display: flex; flex-wrap: wrap; place-content: start;
  height: 400px; padding: 12px; overflow-y: auto;
}
#sidebar .body a {
  display: flex; place-content: center; place-items: center;
  width: 64px; height: 64px; text-decoration: none;
  border-radius: 12px; transition: background .15s;
}
#sidebar .body a:hover { background: var(--accent-soft); }
#sidebar .body a img { width: 40px; height: 40px; border-radius: 10px; transition: transform .2s; }
#sidebar .body a:hover img { transform: translateY(-2px); }
.ln-empty-side { color: var(--muted); font-size: 13px; text-align: center; width: 100%; margin: auto; }

/* Pagination */
.page-navigator {
  list-style: none; margin: 1rem 0 0; padding: 0;
  display: flex; gap: .4rem; justify-content: flex-end;
}
.page-navigator li a {
  display: block; text-decoration: none;
  width: 34px; height: 34px; line-height: 34px;
  color: var(--muted); border-radius: 10px;
  background-color: var(--panel);
  border: 1px solid var(--border);
  text-align: center; transition: .15s;
}
.page-navigator li.current a,
.page-navigator li a:hover {
  background-color: var(--accent); color: #fff; border-color: var(--accent);
}

/* Single post / links pages retain style */
.article-content img { display: block; max-width: 100%; margin: 0 auto; border-radius: 8px; }
.links ul { list-style: none; padding: 0; margin: 0; gap: 14px; display: flex; flex-wrap: wrap; }
.links ul li {
  display: flex; gap: 12px; place-items: center;
  padding: 12px 14px; border-radius: var(--radius); width: 240px;
  background: var(--panel); border: 1px solid var(--border);
  transition: .18s;
}
.links ul li:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: transparent; cursor: pointer; }
.links img { width: 40px; height: 40px; border-radius: 10px; }
.links a { color: var(--text); font-size: 14px; font-weight: 600; }
.links a:hover { color: var(--accent); }

.site-info {
  display: flex; gap: 2rem; margin: 1rem 0 2rem;
  padding: 1.25rem; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.site-info .site-ico { position: relative; border-radius: var(--radius); background: var(--accent-soft); overflow: hidden; }
.site-info .site-ico .bg { height: 200px; width: 200px; opacity: .3; z-index: 0; filter: blur(10px); }
.site-info .site-ico .icon { width: 64px; height: 64px; position: absolute; inset: 0; margin: auto; z-index: 1; }
.site-info .site-ico .stat { display: flex; place-content: center space-evenly; position: absolute; left: 0; right: 0; bottom: 1rem; gap: 2rem; z-index: 1; }
.site-info .site-desc { display: flex; flex-direction: column; place-content: space-evenly; }
.site-info .site-desc h2 { font-size: 1.5rem; font-weight: 700; }
.site-info .site-desc .btn, .site-info .site-desc a {
  text-decoration: none; font-size: 14px; font-weight: 500;
  color: var(--muted); background-color: var(--accent-soft);
  padding: .35rem .7rem; border-radius: 8px; border: 0; transition: .15s;
}
.site-info .site-desc .btn:hover, .site-info .site-desc a:hover { color: #fff; background-color: var(--accent); }
.site-info .site-desc .ln-qr-btn:hover { color: var(--muted); background-color: var(--accent-soft); }

/* QR code popover — click to toggle */
.ln-qr-btn { position: relative; cursor: pointer; user-select: none; }
.ln-qr-btn .qrcode {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.ln-qr-btn .qrcode img,
.ln-qr-btn .qrcode canvas { display: block; width: 144px !important; height: 144px !important; border-radius: 6px; }
.ln-qr-btn.open .qrcode {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.ln-qr-btn.open { color: #fff !important; background-color: var(--accent) !important; }

/* ============ Responsive ============ */
@media (max-width: 820px) {
  .ln-sidebar {
    transform: translateX(-100%);
    transition: transform .2s;
  }
  .ln-sidebar.open { transform: none; }
  .ln-main { margin-left: 0; padding: 16px; }
  #sidebar { display: none; }
}
