:root {
  --canvas: #f8f6ef;
  --surface: #fffdf7;
  --surface-2: #f1ede4;
  --ink: #191917;
  --body: #45443e;
  --muted: #817d72;
  --line: #e2ddd2;
  --line-strong: #d1cabb;
  --accent: #1f2a26;
  --mint: #b8fff0;
  --pill: #e7e4ff;
  --pill-text: #5361c8;
  --shadow: 0 1px 0 rgba(25, 25, 23, 0.04), 0 10px 26px rgba(25, 25, 23, 0.05);
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--sans);
  line-height: 1.7;
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  top: 12px;
}

.shell {
  width: min(1060px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 246, 239, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 58px;
}

.site-icon-link,
.footer-icon-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-icon {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.footer-icon {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.hero {
  padding: 34px 0 28px;
  border-bottom: 1px solid var(--line);
}

.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.5vw, 48px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--body);
  font-size: 16px;
}

.page-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.7);
  color: var(--muted);
  font-size: 13px;
}

.page-pill span {
  margin-right: 2px;
  color: var(--ink);
  font-weight: 700;
}

.search-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 14px;
  max-width: 690px;
  margin-top: 20px;
}

.search-box {
  position: relative;
  display: block;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  min-height: 46px;
  padding: 0 18px 0 42px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  outline: 0;
}

.search-box input:focus,
.filter-wrap select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 42, 38, 0.08);
}

.search-area button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(31, 42, 38, 0.12);
}

.reaction-strip {
  padding: 24px 0 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.reaction-strip h2,
.latest-section h2,
.shelves h2 {
  margin: 0 0 14px;
  color: var(--body);
  font-size: 16px;
  font-weight: 700;
}

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

.latest-section {
  padding: 28px 0 38px;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.filter-wrap {
  display: flex;
  align-items: end;
  gap: 12px;
}

.filter-wrap label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.filter-wrap select {
  min-width: 180px;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  padding: 0 12px;
  color: var(--body);
  outline: 0;
}

.result-count {
  color: var(--muted);
  font-size: 13px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.z-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.z-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 1px 0 rgba(25, 25, 23, 0.04), 0 16px 34px rgba(25, 25, 23, 0.08);
}

.thumb {
  aspect-ratio: 16 / 9;
  background: #efe9db;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

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

.thumb-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(31, 42, 38, 0.05), rgba(31, 42, 38, 0.0)),
    #f3efe5;
}

.thumb-placeholder span {
  color: var(--body);
  font-family: var(--serif);
  font-size: 32px;
}

.card-body {
  padding: 15px 16px 12px;
}

.card-body h3 {
  display: -webkit-box;
  min-height: 3.2em;
  margin: 0 0 8px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 18px;
  line-height: 1.6;
}

.card-desc {
  display: -webkit-box;
  min-height: 3.2em;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--body);
  font-size: 13px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
}

.scope {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--pill-text);
  font-size: 12px;
  font-weight: 700;
}

.heart,
.bookmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
}

.bookmark {
  margin-left: 0;
}

.z-card-compact .card-desc {
  display: none;
}

.z-card-compact .card-body h3 {
  min-height: 3.1em;
  font-size: 15px;
  line-height: 1.55;
}

.z-card-compact .card-actions {
  padding-top: 10px;
}

.empty,
.load-error {
  margin: 18px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.shelves {
  padding: 8px 0 52px;
}

.latest-section,
.shelves {
  scroll-margin-top: 76px;
}

.section-flash {
  animation: section-flash 1.2s ease;
}

@keyframes section-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 54, 47, 0);
    background: transparent;
  }

  20% {
    box-shadow: 0 0 0 4px rgba(26, 54, 47, 0.12);
    background: rgba(232, 238, 229, 0.68);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(26, 54, 47, 0);
    background: transparent;
  }
}

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

.shelf-chip {
  display: grid;
  gap: 5px;
  min-height: 120px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--body);
  text-align: left;
  cursor: pointer;
}

.shelf-chip strong {
  color: var(--ink);
  font-size: 15px;
}

.shelf-chip span {
  color: var(--muted);
  font-size: 13px;
}

.shelf-chip em {
  align-self: end;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.footer {
  padding: 34px 0 38px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.72);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 28px;
}

.footer-grid-links {
  grid-template-columns: 220px;
  justify-content: end;
}

.footer-icon-link {
  margin-bottom: 10px;
}

.footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer h2 {
  margin: 0 0 8px;
  color: var(--body);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.footer a:not(.brand) {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

@media (max-width: 920px) {
  .rail-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .rail-list .z-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
  }

  .card-grid,
  .shelf-summary,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 24px, 1060px);
  }

  .topbar-inner {
    min-height: 52px;
  }

  .site-icon {
    width: 38px;
    height: 38px;
  }

  .hero {
    padding-top: 28px;
  }

  .hero-row,
  .search-area,
  .card-grid,
  .shelf-summary,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    margin-bottom: 14px;
    font-size: 32px;
  }

  .hero p {
    font-size: 15px;
  }

  .page-pill {
    width: fit-content;
  }

  .search-area button {
    display: none;
  }

  .section-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-wrap {
    width: 100%;
    align-items: stretch;
    justify-content: space-between;
  }

  .filter-wrap label {
    width: min(100%, 240px);
  }

  .card-body h3 {
    min-height: 0;
  }

  .card-desc {
    min-height: 0;
  }
}
