:root {
  --bg: #0d1117;
  --bg2: #151b24;
  --line: #2a3444;
  --text: #e8eef6;
  --muted: #8b9bb0;
  --accent: #d4a017;
  --accent-dim: #a67c00;
  --ok: #3db88a;
  --danger: #d35f5f;
  --osd-bg: #05070a;
  --radius: 6px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100%;
}
body {
  background:
    radial-gradient(1200px 500px at 10% -10%, #1a2433 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #1c1810 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 0;
  width: 100%;
  flex: 1;
}
.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.brand a.site-name {
  color: var(--text);
  text-decoration: none;
}
.brand a.site-name:hover { color: var(--accent); }
.brand .logo {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.brand .ver {
  color: var(--muted);
  font-size: 0.85rem;
  font-family: "IBM Plex Mono", monospace;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--line);
}
.nav a, .nav .drop > span {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  padding: 10px 14px;
  margin-bottom: -1px;
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
}
.nav a:hover, .nav .drop:hover > span { color: var(--text); text-decoration: none; }
.nav a.active, .nav .drop.active > span {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.nav .drop {
  position: relative;
}
.nav .drop-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 0;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.nav .drop:hover .drop-menu,
.nav .drop:focus-within .drop-menu {
  display: block;
}
.nav .drop-menu a {
  display: block;
  border: none;
  margin: 0;
  padding: 8px 14px;
  color: var(--text);
}
.nav .drop-menu a:hover {
  background: #1e2836;
  color: var(--accent);
}
main { padding-bottom: 40px; }
h1.page { margin: 0 0 12px; font-size: 1.6rem; font-weight: 600; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 42em; }
.prose p, .prose li { max-width: 42em; }
.prose ul { padding-left: 1.2em; }
.section-label {
  margin: 28px 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  min-height: 100%;
}
.card:hover {
  border-color: #3a4a60;
  text-decoration: none;
}
.card-img {
  aspect-ratio: 16/10;
  background: var(--osd-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card-body { padding: 12px 14px 16px; }
.card-body h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card-body p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.card-img-code {
  padding: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: #b8f0c8;
  text-align: center;
  line-height: 1.4;
}
.covers {
  color: var(--accent);
  font-size: 0.82rem;
  font-family: "IBM Plex Mono", monospace;
  margin: 0 0 8px;
}
.placeholder {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  padding: 24px;
  text-align: center;
}
.placeholder.large {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg2);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.hero {
  margin: 0 0 16px;
}
.hero img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 72vh;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--osd-bg);
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.gallery-pick {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: var(--osd-bg);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.gallery-pick:hover,
.gallery-pick.is-active {
  border-color: var(--accent);
}
.gallery-pick img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: contain;
}
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #1e2836; border-color: #3a4a60; text-decoration: none; color: var(--text); }
.btn-primary {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #1a1400;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent); color: #1a1400; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.crumb { color: var(--muted); font-size: 0.88rem; }
.hint { color: var(--muted); font-size: 0.88rem; }
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.list .meta {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}
.wiki-body { max-width: 42em; }
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 18px 16px 28px;
  color: var(--muted);
  font-size: 0.88rem;
}
.site-footer .inner { max-width: 960px; margin: 0 auto; }
.site-footer a { color: var(--accent); }
.note {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  color: #b8f0c8;
}
@media (max-width: 640px) {
  .nav a, .nav .drop > span { padding: 10px 10px; }
}
