html,
body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
}

.book-site {
  --book-bg: #f4efe4;
  --book-ink: #201b14;
  --book-muted: #6c6252;
  --book-green: #143d33;
  --book-green-2: #286756;
  --book-gold: #b48624;
  --book-card: #fffdf8;
  --book-line: rgba(36, 48, 38, 0.14);
  background:
    linear-gradient(135deg, rgba(20, 61, 51, 0.08), transparent 38%),
    linear-gradient(0deg, rgba(180, 134, 36, 0.08), transparent 45%),
    var(--book-bg);
  color: var(--book-ink);
}

.book-rtl {
  direction: rtl;
  text-align: right;
}

.book-ltr {
  direction: ltr;
  text-align: left;
}

.book-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.book-index-hero {
  background:
    linear-gradient(135deg, rgba(20, 61, 51, 0.96), rgba(40, 103, 86, 0.9)),
    #143d33;
  color: #fffdf8;
  padding: 36px 0 32px;
  border-bottom: 5px solid var(--book-gold);
}

.book-kicker {
  color: #f2d99f;
  font-size: 14px;
  margin: 0 0 8px;
}

.book-title {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.08;
  margin: 0;
}

.book-subtitle {
  color: rgba(255, 253, 248, 0.78);
  max-width: 760px;
  margin: 12px 0 0;
  font-size: 18px;
  line-height: 1.8;
}

.book-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.book-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 24px auto;
}

.book-search {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: 1px solid var(--book-line);
  border-radius: 8px;
  padding: 0 16px;
  background: #fffdf8;
  color: var(--book-ink);
  font-size: 16px;
  outline: none;
  box-shadow: 0 12px 30px rgba(20, 61, 51, 0.08);
}

.book-search:focus {
  border-color: rgba(180, 134, 36, 0.72);
  box-shadow: 0 0 0 4px rgba(180, 134, 36, 0.15);
}

.book-count {
  color: var(--book-muted);
  white-space: nowrap;
  font-size: 14px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  padding: 0 0 36px;
}

.book-card {
  min-width: 0;
  background: var(--book-card);
  border: 1px solid var(--book-line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(20, 61, 51, 0.08);
}

.book-card a {
  color: inherit;
  text-decoration: none;
  display: grid;
  min-height: 100%;
}

.book-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #143d33, #b48624);
  object-fit: cover;
  display: block;
}

.book-card-body {
  padding: 14px;
}

.book-no {
  color: var(--book-gold);
  font-weight: 700;
  font-size: 14px;
}

.book-card-title {
  margin: 6px 0 6px;
  color: var(--book-green);
  font-size: 20px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.book-card-meta {
  color: var(--book-muted);
  font-size: 14px;
  line-height: 1.6;
}

.book-empty {
  display: none;
  padding: 26px;
  margin: 0 0 36px;
  background: #fffdf8;
  border: 1px dashed rgba(180, 134, 36, 0.55);
  border-radius: 8px;
  color: var(--book-muted);
}

.book-empty.is-visible {
  display: block;
}

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

.book-topbar-inner {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.book-brand {
  min-width: 0;
  color: var(--book-green);
  text-decoration: none;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.book-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(20, 61, 51, 0.18);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--book-green);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.book-button:hover,
.book-button:focus {
  border-color: rgba(180, 134, 36, 0.72);
  color: #6f4f11;
}

.book-button.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.book-detail {
  background: var(--book-bg);
}

.book-detail .sg-page {
  overflow-x: hidden;
}

.book-bottom-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 34px;
  background: var(--book-bg);
}

@media (max-width: 620px) {
  .book-shell {
    width: min(100% - 22px, 1180px);
  }

  .book-index-hero {
    padding: 28px 0 24px;
  }

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

  .book-count {
    white-space: normal;
  }

  .book-topbar-inner {
    align-items: flex-start;
    padding: 10px 0;
    flex-direction: column;
  }

  .book-actions {
    width: 100%;
    justify-content: stretch;
  }

  .book-button {
    flex: 1 1 auto;
  }
}
