: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;
  min-height: 58px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}
.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: 46px;
  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;
}
.result-count {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
  font-size: 13px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.z-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 318px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}
.z-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.z-card-compact { min-height: 250px; }
.thumb {
  display: block;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(184,255,240,.72), rgba(231,228,255,.92)),
    var(--surface-2);
}
.thumb-placeholder span {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 28px;
}
.card-body {
  padding: 14px 14px 4px;
}
.card-body h3 {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.45;
}
.card-desc {
  margin-bottom: 12px;
  color: var(--body);
  font-size: 13px;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 14px;
}
.scope {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--pill-text);
  font-size: 12px;
  font-weight: 700;
}
.heart,
.bookmark {
  color: var(--muted);
  font-size: 16px;
}
.shelves {
  padding: 22px 0 48px;
}
.shelf-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.shelf-chip {
  display: grid;
  gap: 4px;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.shelf-chip strong { font-size: 15px; }
.shelf-chip span {
  color: var(--body);
  font-size: 13px;
}
.shelf-chip em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.empty,
.load-error {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}
.footer {
  padding: 26px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer h2 {
  margin-bottom: 8px;
  color: var(--body);
  font-size: 14px;
}
.footer a {
  display: inline-block;
  margin-right: 14px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .rail-list,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 28px, 1060px); }
  .hero-row,
  .search-area,
  .section-row,
  .filter-wrap {
    display: grid;
    grid-template-columns: 1fr;
  }
  h1 { font-size: 34px; }
  .rail-list,
  .card-grid,
  .shelf-summary {
    grid-template-columns: 1fr;
  }
}
