:root {
  --bg: #0a0a0f;
  --card: rgba(18, 18, 26, 0.92);
  --surface: rgba(30, 30, 46, 0.92);
  --border: #2a1a4a;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-glow: rgba(124, 58, 237, 0.35);
  --muted: #8888aa;
  --text: #f0e8ff;
  --text-dim: #c4b8e0;
  --green: #22c55e;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

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

html,
body {
  min-height: 100vh;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Barlow", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  overflow-x: hidden;
}

.background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 58, 237, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 90% 100%, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 44px 0 80px;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

header .shell {
  padding: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

header h1 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.search-bar {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-bar input {
  flex: 1;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid rgba(124, 58, 237, 0.18);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

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

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.status-text {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.btn-refresh {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(124, 58, 237, 0.26);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.18), rgba(76, 29, 149, 0.14));
  color: var(--text);
  font: 600 0.8rem/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}

.btn-refresh:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.18);
}

/* Banner */
.banner {
  padding: 12px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(124, 58, 237, 0.12));
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--text-dim);
}

/* Entries */
.entry {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.entry:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.entry-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.entry h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

.permalink {
  margin-left: auto;
  text-decoration: none;
  border: 1px solid rgba(124, 58, 237, 0.26);
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 0.85rem;
  transition: border-color 0.15s, color 0.15s;
}

.permalink:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.entry details {
  padding: 0 20px 16px;
}

.entry summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-weight: 600;
  color: var(--accent);
  margin: 14px 0;
  font-size: 0.9rem;
}

.entry summary::-webkit-details-marker {
  display: none;
}

.entry .meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

hr.sep {
  border: 0;
  border-top: 1px dashed rgba(124, 58, 237, 0.2);
  margin: 10px 0;
}

.entry-content {
  line-height: 1.65;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.entry-content h3 {
  color: var(--accent);
  margin: 20px 0 10px;
  font-weight: 600;
  font-size: 1rem;
}

.entry-content p {
  margin-bottom: 12px;
}

.entry-content ul {
  margin: 12px 0;
  padding-left: 22px;
}

.entry-content li {
  margin-bottom: 6px;
}

.entry-content a {
  color: var(--accent);
  text-decoration: none;
}

.entry-content a:hover {
  text-decoration: underline;
}

.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 10px 0;
}

.highlight {
  border-color: var(--accent) !important;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.25);
}

/* Loading / Error */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--muted);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.no-results {
  text-align: center;
  padding: 48px;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 32px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 18px, 1100px);
    padding-top: 20px;
  }

  header .shell {
    flex-direction: column;
    align-items: stretch;
  }

  header h1 {
    text-align: center;
  }

  .entry-head {
    flex-wrap: wrap;
  }

  .permalink {
    order: 2;
    width: auto;
  }
}
