:root {
  color-scheme: light;
  --ink: #17231f;
  --muted: #5d6862;
  --paper: #f7f1e4;
  --panel: #fffaf0;
  --page: #fff8e9;
  --page-deep: #efe0c4;
  --cover: #254438;
  --line: #d8cbb6;
  --leaf: #2f6a4f;
  --leaf-dark: #1d3b32;
  --amber: #d98a2b;
  --blue: #315f7c;
  --pink: #cf6d69;
  --shadow: 0 24px 60px rgba(34, 43, 36, .14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", sans-serif;
  background:
    linear-gradient(90deg, rgba(47, 106, 79, .06) 1px, transparent 1px),
    linear-gradient(rgba(47, 106, 79, .05) 1px, transparent 1px),
    radial-gradient(circle at 82% 6%, rgba(217, 138, 43, .2), transparent 26rem),
    var(--paper);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 18px 12px;
  background: #192820;
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff4d7;
}

.brand-mark svg {
  width: 36px;
  height: 36px;
}

.rail-button {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  color: #f8e9c8;
  background: transparent;
  font-size: 24px;
}

.rail-button.is-active,
.rail-button:hover {
  color: #17231f;
  background: #f0b24a;
}

.workspace {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 34px clamp(18px, 4vw, 52px) 48px;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 26px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-family: "Klee One", cursive;
  font-size: clamp(42px, 7vw, 84px);
  line-height: .95;
  letter-spacing: 0;
}

.lead {
  max-width: 560px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.field-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.field-stats div {
  min-width: 118px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, .84);
}

.field-stats strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.field-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 420px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.search-box {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(35, 45, 37, .08);
}

.search-box span {
  color: var(--leaf);
  font-size: 22px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-chip {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--leaf-dark);
  background: rgba(255, 250, 240, .74);
  font-weight: 800;
}

.filter-chip.is-selected {
  color: #fffaf0;
  border-color: var(--leaf-dark);
  background: var(--leaf-dark);
}

.book-stage {
  perspective: 1800px;
}

.book-shell {
  position: relative;
  padding: 18px 18px 24px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .05), transparent 18%, transparent 82%, rgba(0, 0, 0, .14)),
    var(--cover);
  box-shadow:
    0 26px 70px rgba(21, 32, 27, .28),
    inset 0 0 0 1px rgba(255, 255, 255, .08);
  transform-style: preserve-3d;
}

.book-shell::before,
.book-shell::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  height: 10px;
  border-radius: 0 0 8px 8px;
  background: repeating-linear-gradient(
    90deg,
    #f3e3c4 0 8px,
    #dfcda9 8px 9px
  );
  opacity: .95;
}

.book-shell::before {
  top: 8px;
}

.book-shell::after {
  bottom: 8px;
  transform: rotate(180deg);
}

.book-cover {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 250, 240, .16);
  border-radius: 8px;
  pointer-events: none;
}

.book-spread {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(320px, .8fr);
  align-items: stretch;
  min-height: 640px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--page-deep);
}

.book-page {
  position: relative;
  min-width: 0;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(120, 84, 45, .08), transparent 18%),
    linear-gradient(rgba(47, 106, 79, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 106, 79, .04) 1px, transparent 1px),
    var(--page);
  background-size: auto, 30px 30px, 30px 30px, auto;
}

.book-page-left {
  box-shadow: inset -26px 0 38px rgba(75, 50, 25, .12);
}

.book-page-right {
  box-shadow: inset 26px 0 38px rgba(75, 50, 25, .12);
}

.book-gutter {
  position: relative;
  background:
    linear-gradient(90deg, rgba(50, 28, 12, .24), rgba(255, 248, 233, .72) 48%, rgba(50, 28, 12, .2));
}

.book-gutter::before {
  content: "";
  position: absolute;
  inset: 0 11px;
  background: rgba(101, 68, 35, .18);
  box-shadow: 0 0 22px rgba(40, 26, 11, .22);
}

.page-label {
  margin-bottom: 10px;
  color: rgba(29, 59, 50, .58);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.page-turn {
  position: absolute;
  z-index: 4;
  top: 18px;
  bottom: 24px;
  left: calc(50% + 2px);
  width: calc(50% - 20px);
  border-radius: 0 8px 8px 0;
  pointer-events: none;
  transform-origin: left center;
  transform: rotateY(0deg);
  opacity: 0;
  background:
    linear-gradient(90deg, rgba(81, 54, 27, .2), rgba(255, 248, 233, .96) 22%, #fff8e9 72%, rgba(211, 187, 146, .84)),
    repeating-linear-gradient(0deg, rgba(47, 106, 79, .045) 0 1px, transparent 1px 30px);
  box-shadow: -18px 0 28px rgba(62, 38, 17, .18);
}

.book-shell.is-flipping .page-turn {
  animation: pageFlip .72s cubic-bezier(.2, .65, .22, 1);
}

@keyframes pageFlip {
  0% {
    opacity: 0;
    transform: rotateY(0deg);
  }

  12% {
    opacity: 1;
  }

  58% {
    opacity: 1;
    transform: rotateY(-118deg);
  }

  100% {
    opacity: 0;
    transform: rotateY(-178deg);
  }
}

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

h2 {
  margin: 0;
  font-size: 22px;
}

select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.zukan-card {
  position: relative;
  min-height: 270px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .45), transparent 34%),
    var(--panel);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(38, 48, 41, .1);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.zukan-card:hover,
.zukan-card.is-selected {
  transform: translateY(-3px);
  border-color: rgba(29, 59, 50, .45);
  box-shadow: var(--shadow);
}

.card-main {
  width: 100%;
  min-height: 270px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px;
  border: 0;
  text-align: left;
  color: inherit;
  background: transparent;
}

.specimen-art {
  height: 126px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(47, 106, 79, .14), rgba(217, 138, 43, .15));
}

.specimen-art svg {
  width: 112px;
  height: 112px;
}

.card-meta {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 6px;
  color: #fffaf0;
  background: var(--leaf);
  font-size: 12px;
  font-weight: 800;
}

.card-name {
  font-size: 20px;
}

.card-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.favorite-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(23, 35, 31, .18);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 250, 240, .9);
  font-size: 22px;
}

.favorite-button.is-on {
  color: #fffaf0;
  border-color: var(--amber);
  background: var(--amber);
}

.detail-panel {
  color: var(--ink);
  overflow: hidden;
}

.detail-hero {
  min-height: 190px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(29, 59, 50, .12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 70% 26%, rgba(240, 178, 74, .3), transparent 34%),
    linear-gradient(135deg, rgba(47, 106, 79, .14), rgba(217, 138, 43, .15)),
    #f7eed8;
}

.detail-hero svg {
  width: 150px;
  height: 150px;
}

.detail-body {
  padding: 20px 4px 4px;
}

.detail-kicker {
  color: var(--leaf);
  font-size: 13px;
  font-weight: 900;
}

.detail-body h3 {
  margin: 6px 0 10px;
  font-size: 28px;
}

.detail-body p {
  color: var(--muted);
  line-height: 1.8;
}

.fact-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.fact-list div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(29, 59, 50, .14);
}

.fact-list dt {
  color: var(--leaf);
  font-size: 13px;
  font-weight: 900;
}

.fact-list dd {
  margin: 0;
  color: var(--ink);
}

.note-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(47, 106, 79, .1);
  color: var(--ink);
}

.empty-state {
  margin: 28px 0;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 250, 240, .64);
}

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

  .rail {
    z-index: 10;
    position: sticky;
    top: 0;
    height: 68px;
    flex-direction: row;
    justify-content: center;
    padding: 10px;
  }

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

  .book-shell {
    padding: 12px 12px 18px;
  }

  .book-spread {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .book-page {
    padding: 22px;
  }

  .book-page-left {
    box-shadow: inset 0 -22px 28px rgba(75, 50, 25, .08);
  }

  .book-page-right {
    border-top: 1px solid rgba(87, 59, 28, .16);
    box-shadow: inset 0 22px 28px rgba(75, 50, 25, .08);
  }

  .book-gutter,
  .page-turn {
    display: none;
  }
}

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

  .intro {
    align-items: stretch;
    flex-direction: column;
  }

  .field-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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