:root {
  --bg: #F5F0FC;
  --surface: #FFFFFF;
  --primary: #8B5CF6;
  --accent: #F472B6;
  --text: #1E1B2E;
  --muted: #7C6F8A;
  --radius: 8px;
  --line: rgba(139, 92, 246, 0.18);
  --font-heading: 'Noto Serif JP', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  --font-body: 'Noto Sans JP', 'Hiragino Kaku Gothic Pro', 'Yu Gothic', sans-serif;
  --shadow: 0 4px 18px rgba(139, 92, 246, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  background-image:
    repeating-linear-gradient(0deg, rgba(139, 92, 246, 0.035) 0, rgba(139, 92, 246, 0.035) 1px, transparent 1px, transparent 3px);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; margin: 0; padding: 0; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 62px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: skewX(-6deg);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--muted);
  border-radius: var(--radius);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover {
  color: var(--primary);
  background: rgba(139, 92, 246, 0.08);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.search-box input {
  border: 0;
  outline: 0;
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--font-body);
  width: 150px;
  background: transparent;
  color: var(--text);
}
.search-box button {
  border: 0;
  padding: 8px 14px;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-body);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  margin: 22px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #2a1a4a, #4c2a6b 60%, #7a3f8c);
  box-shadow: var(--shadow);
}

.hero-slide {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
}
.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.hero-info {
  position: relative;
  z-index: 2;
  padding: 32px 28px;
  max-width: 640px;
  color: #fff;
}
.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 30px;
  margin: 0 0 10px;
  line-height: 1.3;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.hero-info p {
  margin: 0 0 18px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-block;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--primary), var(--accent));
  color: #fff;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(244, 114, 182, 0.45);
}

/* ===== Section ===== */
.sec { margin: 34px 0; }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.sec-title {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 700;
  margin: 0;
  position: relative;
  padding-left: 14px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) skewX(-12deg);
  width: 5px;
  height: 20px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
}

.sec-more {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.sec-more:hover { color: var(--accent); }

/* ===== Grid & Card ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #e9def9, #fbe3ef);
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}
.card:hover .card-cover img { transform: scale(1.05); }

.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  transform: skewX(-8deg);
}

.card-info { padding: 9px 10px 11px; }

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.card-meta span { white-space: nowrap; }

/* ===== Category list ===== */
.cat-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s;
}
.cat-item:hover {
  border-color: var(--accent);
  color: var(--primary);
}

.cat-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  background: rgba(139, 92, 246, 0.08);
  padding: 1px 8px;
  border-radius: 999px;
}

/* ===== Rank list ===== */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.rank-item:hover { border-color: var(--accent); }

.rank-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  transform: skewX(-8deg);
}

.rank-title {
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ===== Detail ===== */
.detail { margin: 26px 0; }

.detail-head {
  display: flex;
  gap: 24px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-cover {
  flex-shrink: 0;
  width: 220px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #e9def9, #fbe3ef);
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-meta {
  flex: 1;
  min-width: 0;
}
.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  margin: 0 0 12px;
  line-height: 1.35;
}
.detail-meta p {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--muted);
}
.detail-meta p strong { color: var(--text); font-weight: 600; }

.detail-score {
  display: inline-block;
  margin: 10px 0 14px;
  padding: 4px 14px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  transform: skewX(-8deg);
}

.detail-body {
  margin-top: 20px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14.5px;
  line-height: 1.85;
}

/* ===== Tags ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.tag {
  display: inline-block;
  padding: 3px 12px;
  font-size: 12.5px;
  color: var(--primary);
  background: rgba(139, 92, 246, 0.09);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.tag:hover {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
}

/* ===== Pager ===== */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 30px 0;
}

.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}
.pg:hover { border-color: var(--accent); color: var(--primary); }

.pg.current {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.pg.disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ===== Links ===== */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.link-item {
  font-size: 13px;
  color: var(--muted);
}
.link-item:hover { color: var(--accent); }

/* ===== Footer ===== */
.footer {
  margin-top: 40px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.footer a { color: var(--primary); }
.footer a:hover { color: var(--accent); }

/* ===== Crumbs ===== */
.crumbs {
  padding: 14px 0;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }

/* ===== Highlight ===== */
.hl {
  color: var(--accent);
  background: rgba(244, 114, 182, 0.14);
  border-radius: 3px;
  padding: 0 2px;
  font-style: normal;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .cat-list { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  body { font-size: 14px; }

  .header .wrap {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 10px;
  }

  .logo { font-size: 18px; }

  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .search-box { margin-left: auto; }
  .search-box input { width: 110px; }

  .hero-slide { min-height: 240px; }
  .hero-info { padding: 20px 18px; }
  .hero-info h2 { font-size: 21px; }

  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-list { grid-template-columns: repeat(2, 1fr); }
  .rank-list { grid-template-columns: 1fr; }

  .sec-title { font-size: 18px; }

  .detail-head {
    flex-direction: column;
    padding: 16px;
  }
  .detail-cover { width: 100%; max-width: 240px; margin: 0 auto; }
  .detail-meta h1 { font-size: 20px; }

  .detail-body { padding: 16px; }
  .pg { min-width: 32px; height: 32px; font-size: 13px; }
}