* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0d1117; --bg2: #161b22; --bg3: #1c2330;
  --border: #262d3a; --text: #e6edf3; --muted: #8b949e;
  --accent: #58a6ff; --accent2: #1f6feb;
}
body { background: var(--bg); color: var(--text); font-family: "Noto Sans JP", "Segoe UI", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: rgba(13,17,23,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
header .logo { font-weight: 700; font-size: 18px; color: var(--accent); }
header nav a { color: var(--muted); margin-left: 14px; font-size: 14px; }
header nav a:hover, header nav a.active { color: var(--text); }
.search {
  flex: 1; max-width: 380px; margin-left: auto;
  display: flex; gap: 8px; align-items: center;
}
.search input {
  width: 100%; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg2); color: var(--text); font-size: 14px; outline: none;
}
.search input:focus { border-color: var(--accent2); }
.search button {
  padding: 8px 16px; border: none; border-radius: 999px; cursor: pointer;
  background: var(--accent2); color: #fff; font-size: 14px;
}
main { max-width: 1200px; margin: 0 auto; padding: 20px; }
h1.title { font-size: 20px; margin: 8px 0 16px; color: var(--text); }
h1.title span { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 8px; }

/* manga grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); border-color: var(--accent2); }
.card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: var(--bg3); }
.card .info { padding: 8px 10px 10px; }
.card .name { font-size: 13px; font-weight: 600; line-height: 1.35; height: 2.7em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card .meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.card .status { font-size: 10px; color: var(--accent); }

/* chapter list */
.chapters { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.chapters .row { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.chapters .row:hover { background: var(--bg3); }
.chapters .row:last-child { border-bottom: none; }
.chapters .date { color: var(--muted); font-size: 12px; }

/* buttons */
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--accent2); color: #fff; font-size: 14px; font-weight: 600;
}
.btn.secondary { background: var(--bg3); color: var(--text); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.pager { display: flex; justify-content: center; gap: 10px; margin: 24px 0; }

/* manga detail */
.detail { display: flex; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.detail img.cover { width: 200px; border-radius: 10px; border: 1px solid var(--border); }
.detail .body { flex: 1; min-width: 260px; }
.detail .body h1 { font-size: 22px; margin-bottom: 10px; }
.detail .badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--bg3); font-size: 12px; color: var(--accent); margin-bottom: 12px; }
.detail .actions { display: flex; gap: 10px; margin-top: 12px; }
.chapter-search { width: 100%; max-width: 300px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); margin-bottom: 12px; outline: none; }

/* reader */
.reader-top { text-align: center; margin-bottom: 16px; }
.reader-top h1 { font-size: 18px; }
.reader-top a { color: var(--muted); font-size: 13px; }
.reader-top a:hover { color: var(--accent); }
.reader { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.reader img { max-width: 100%; border-radius: 4px; background: var(--bg3); min-height: 200px; }
.reader-nav { display: flex; justify-content: center; gap: 12px; margin: 24px 0 40px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.loading { text-align: center; color: var(--muted); padding: 40px; }
@media (max-width: 640px) {
  .detail img.cover { width: 130px; }
  .search { max-width: none; }
}
