:root {
  --bg: #0b1020;
  --bg-card: #121a2f;
  --bg-card-hover: #172038;
  --text: #e8eefc;
  --muted: #9aa8c7;
  --accent: #6ea8ff;
  --accent-2: #8b5cf6;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font: "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(110, 168, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(139, 92, 246, 0.16), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.inner {
  width: min(960px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  padding: 2.5rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
}
.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: 0.02em;
}
.lede {
  margin: 0.6rem 0 0;
  color: var(--muted);
  max-width: 36rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
#q {
  width: min(100%, 280px);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  outline: none;
}
#q:focus {
  border-color: rgba(110, 168, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(110, 168, 255, 0.15);
}

.card-list {
  display: grid;
  gap: 0.9rem;
  padding-bottom: 2.5rem;
}
.card {
  display: grid;
  gap: 0.55rem;
  padding: 1.1rem 1.15rem;
  background: linear-gradient(180deg, var(--bg-card-hover), var(--bg-card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(110, 168, 255, 0.35);
}
.card h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.summary {
  margin: 0;
  color: #c9d4ef;
  font-size: 0.95rem;
}
.actions { margin-top: 0.2rem; }
.actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.actions a:hover { text-decoration: underline; }

.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.site-footer {
  padding: 0 0 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.84em;
  color: #c7d7ff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 560px) {
  .toolbar { align-items: stretch; }
  #q { width: 100%; }
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 0.5rem 0 2rem;
}
.pager-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  font: inherit;
}
.pager-btn:hover:not(:disabled) {
  border-color: rgba(110, 168, 255, 0.45);
}
.pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-label {
  margin: 0;
  color: var(--muted);
  min-width: 4.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}


.thumb {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: top center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0a0f1c;
}


.thumb-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  border-radius: 12px;
}
.thumb-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 8, 18, 0.88);
  backdrop-filter: blur(4px);
}
.lightbox[hidden] { display: none; }
.lightbox-img {
  max-width: min(960px, 100%);
  max-height: min(92vh, 100%);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  background: #111;
}
.lightbox-close {
  position: fixed;
  top: 0.75rem;
  right: 0.9rem;
  z-index: 1001;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 26, 47, 0.9);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover {
  border-color: rgba(110, 168, 255, 0.5);
}


.card-body {
  display: grid;
  gap: 0.55rem;
}
.footnotes {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
}
.footnotes-label {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.footnotes ol {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.28rem;
}
.footnotes li {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  word-break: break-all;
}
.footnotes a {
  color: #9eb7e8;
  text-decoration: none;
}
.footnotes a:hover {
  text-decoration: underline;
  color: var(--accent);
}
