* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #eef4fb;
  color: #0f172a;
}

.page {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 16px;
}

.hero {
  background: linear-gradient(135deg, #0f766e, #1d4ed8);
  color: #fff;
  padding: 34px;
  border-radius: 28px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  margin-bottom: 22px;
}

.badge {
  display: inline-block;
  padding: 8px 14px;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  margin-bottom: 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
}

.hero p {
  margin: 12px 0 0;
  opacity: .9;
  font-size: 17px;
}

.toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.toolbar input {
  flex: 1;
  border: 0;
  outline: none;
  padding: 17px 20px;
  border-radius: 18px;
  font-size: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.total {
  background: #0f172a;
  color: #fff;
  padding: 15px 22px;
  border-radius: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.book-card {
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 22px;
  padding: 14px;
  border: 1px solid #dbe7f3;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
  transition: .2s;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, .13);
}

.cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: #e2e8f0;
  margin-bottom: 14px;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.no-cover {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f766e, #1d4ed8);
  color: #fff;
}

.no-cover span {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: #ef4444;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.book-info h2 {
  margin: 0;
  color: #0f766e;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

.book-info p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 14px;
}

.empty {
  display: none;
  margin-top: 20px;
  background: #fff;
  padding: 24px;
  border-radius: 20px;
  text-align: center;
  color: #64748b;
}

.viewer-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #eaf1f8;
}

.viewer-top {
  background: #ffffff;
  padding: 14px 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid #dbe7f3;
}

.viewer-top h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  color: #0f172a;
}

.back-btn {
  text-decoration: none;
  background: #0f172a;
  color: #ffffff;
  padding: 11px 16px;
  border-radius: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.pdf-frame {
  width: 100%;
  flex: 1;
  border: 0;
  background: #ffffff;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.home-btn {
  text-decoration: none;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  backdrop-filter: blur(8px);
  transition: 0.2s;
  white-space: nowrap;
}

.home-btn:hover {
  background: #ffffff;
  color: #0f766e;
}
@media (max-width: 600px) {
  .hero-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-btn {
    width: 100%;
    text-align: center;
  }
}


@media (max-width: 600px) {
  .page {
    padding: 18px 12px;
  }

  .hero {
    padding: 24px;
    border-radius: 22px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .total {
    text-align: center;
  }

  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .book-card {
    padding: 10px;
    border-radius: 18px;
  }

  .cover {
    border-radius: 14px;
  }

  .book-info h2 {
    font-size: 13.5px;
  }

  .viewer-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .viewer-top h1 {
    font-size: 16px;
  }
}