:root {
  --bg: #050505;
  --panel: #0b0b0b;
  --ink: #eeeeee;
  --muted: #a8a8a8;
  --line: #242424;
  --accent: #ff4f8a;
  --accent-2: #ffbf3f;
  --dark: #151515;
  --soft: #111111;
  --card: #151515;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  font-size: 15px;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  height: 8px;
  background: var(--accent);
  box-shadow: 0 1px 12px rgba(255, 79, 138, .45);
}

a {
  color: inherit;
  text-decoration: none;
}

.top-actions {
  position: fixed;
  top: 8px;
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  height: 48px;
  padding: 0 max(12px, calc((100vw - 1120px) / 2));
  background: #090909;
  border-bottom: 1px solid #242424;
}

.top-logo {
  justify-self: center;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.top-logo span {
  color: var(--accent);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
}

.icon-button span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 3px 0;
  background: currentColor;
}

.search-icon::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translate(-2px, -2px);
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 2px;
  background: currentColor;
  transform: translate(10px, 10px) rotate(45deg);
}

.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: rgba(0, 0, 0, .58);
}

.slide-panel {
  position: fixed;
  top: 56px;
  z-index: 40;
  width: min(320px, 86vw);
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding: 18px;
  border: 1px solid #2a2a2a;
  background: #0d0d0d;
  color: #fff;
  box-shadow: 0 20px 44px rgba(0,0,0,.6);
  transition: transform .18s ease;
}

.main-panel {
  left: 0;
  transform: translateX(-105%);
}

.search-panel {
  right: 0;
  transform: translateX(105%);
}

.slide-panel h2 {
  margin: 0 0 12px;
  padding: 7px 9px;
  border-left: 4px solid var(--accent);
  background: #171717;
  font-size: 15px;
}

.slide-panel nav {
  display: grid;
  gap: 2px;
  margin-bottom: 20px;
}

.slide-panel nav a {
  padding: 10px;
  border-radius: 4px;
  color: #e5e5e5;
}

.slide-panel nav a:hover {
  background: #1c1c1c;
  color: var(--accent);
}

body[data-open-panel="main"] .panel-backdrop,
body[data-open-panel="search"] .panel-backdrop {
  display: block;
}

body[data-open-panel="main"] .main-panel,
body[data-open-panel="search"] .search-panel {
  transform: translateX(0);
}

img,
svg {
  display: block;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  width: min(1120px, 100%);
  margin: 56px auto 0;
  background: var(--panel);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid #262626;
  background: #070707;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 24px;
  color: #fff;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: 0;
}

.logo b {
  color: var(--accent);
}

.side-section {
  margin: 0 0 25px;
}

.side-section h2 {
  margin: 0 0 12px;
  padding: 7px 9px;
  border-bottom: 0;
  border-left: 4px solid var(--accent);
  background: #171717;
  color: #f5f5f5;
  font-size: 15px;
  font-weight: 800;
}

.side-nav,
.tag-nav {
  display: grid;
  gap: 2px;
}

.side-nav a,
.tag-nav a,
.external-link {
  display: block;
  padding: 8px 9px;
  border-radius: 4px;
  color: #d8d8d8;
  font-size: 14px;
}

.side-nav a:hover,
.tag-nav a:hover,
.external-link:hover {
  background: #1c1c1c;
  color: var(--accent);
}

.search {
  display: grid;
  gap: 8px;
}

.search input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #303030;
  border-radius: 4px;
  background: #101010;
  color: #fff;
  outline: none;
}

.search input:focus {
  border-color: var(--accent);
}

.search button {
  height: 38px;
  border: 0;
  border-radius: 4px;
  background: #2b2b2b;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.main {
  min-width: 0;
  padding: 24px clamp(16px, 4vw, 34px) 42px;
}

.hero {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 17px;
  border-bottom: 1px solid #2a2a2a;
}

.compact-hero {
  align-items: stretch;
}

.hero-card {
  display: grid;
  align-content: space-between;
  min-height: 112px;
  padding: 14px;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,0)),
    linear-gradient(145deg, #202020, #e85f7a 58%, #f7c948);
  color: #fff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .12);
}

.hero-mark {
  justify-self: start;
  padding: 3px 8px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.hero-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.hero p,
.notice {
  color: #cfcfcf;
  line-height: 1.8;
}

.hero p {
  margin: 0;
  padding: 10px 0;
}

.notice {
  margin: 0 0 24px;
  padding: 10px 12px;
  border: 1px solid #3a1b28;
  border-radius: 5px;
  background: #160b10;
  font-size: 14px;
}

.archive-section {
  margin: 0 0 31px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 12px;
  border-bottom: 1px solid #2f2f2f;
}

.section-title-row p {
  margin: 0 0 5px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: lowercase;
}

.section-title-row h2 {
  margin: 0 0 7px;
  font-size: 26px;
  line-height: 1;
}

.more-link {
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.comic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px;
  border: 1px solid #2d2d2d;
  border-radius: 4px;
  background: #101010;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.comic-card {
  min-width: 0;
  border: 1px solid #252525;
  border-radius: 3px;
  background: var(--card);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

.comic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .45);
}

.cover {
  display: block;
  position: relative;
  height: 238px;
  padding: 0;
  overflow: hidden;
  color: #fff;
  background: #0f0f0f;
}

.jacket {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.comic-body {
  display: grid;
  gap: 7px;
  padding: 10px 10px 12px;
}

.comic-body h3 {
  margin: 0;
  color: #f3f3f3;
  font-size: 14px;
  line-height: 1.45;
}

.comic-body h3 a:hover {
  color: var(--accent);
}

.date {
  color: var(--muted);
  font-size: 12px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  border: 1px solid #242424;
  border-radius: 5px;
  background: var(--soft);
}

.tag-cloud a,
.tag-cloud button {
  padding: 7px 10px;
  border: 1px solid #303030;
  border-radius: 999px;
  background: #171717;
  color: #dedede;
  font-size: 13px;
  font-weight: 700;
}

.tag-cloud a:hover,
.tag-cloud button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.count-line {
  margin: -4px 0 14px;
  color: #d2d2d2;
  font-weight: 700;
}

.breadcrumb {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.list-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 18px;
  color: #cfcfcf;
  font-size: 13px;
}

.pager button,
.pager a {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 30px;
  border: 1px solid #303030;
  border-radius: 3px;
  background: #151515;
  color: #e5e5e5;
}

.pager button.active,
.pager a.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.tag-index-page .tag-cloud,
.tag-cloud.expanded {
  align-items: flex-start;
}

@media (max-width: 980px) {
  .page {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav,
  .tag-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .comic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .main {
    padding: 22px 14px 34px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-card {
    min-height: 118px;
  }

  .side-nav,
  .tag-nav,
  .comic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .sidebar {
    padding: 22px 14px;
  }

  .logo {
    font-size: 30px;
  }

  .comic-grid {
    gap: 10px;
  }

  .cover {
    height: 200px;
  }

  .jacket {
    height: 100%;
  }

  .section-title-row h2 {
    font-size: 24px;
  }
}
