/* Bookshelf homepage — mobile-first dark theme matching NovelSpark brand */
:root {
  --bg-primary: #0F0E17;
  --bg-secondary: #1A1826;
  --bg-card: #1E1C2E;
  --bg-card-hover: #252338;
  --fg-primary: #FFFFFE;
  --fg-secondary: #A7A9BE;
  --fg-muted: #6B6D80;
  --accent: #FF8906;
  --accent-dim: rgba(255, 137, 6, 0.12);
  --accent-glow: rgba(255, 137, 6, 0.06);
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(255, 137, 6, 0.2);
  --nav-height: 60px;
  --header-height: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg-primary);
  color: var(--fg-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-height) + 16px);
}
a { color: inherit; text-decoration: none; }

/* ===== HEADER / SEARCH ===== */
.bs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 14, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}
.bs-header-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 100%;
}
.bs-logo {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.bs-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 14px;
  transition: border-color 0.2s;
}
.bs-search:focus-within {
  border-color: var(--border-accent);
}
.bs-search-icon {
  width: 16px;
  height: 16px;
  color: var(--fg-muted);
  flex-shrink: 0;
}
.bs-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--fg-primary);
  font-size: 0.875rem;
  font-family: inherit;
}
.bs-search-input::placeholder { color: var(--fg-muted); }

/* ===== MAIN ===== */
.bs-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== BANNER CAROUSEL ===== */
.bs-banner {
  margin: 16px 0;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}
.bs-banner-track {
  display: flex;
  transition: transform 0.4s ease;
}
.bs-banner-slide {
  min-width: 100%;
  flex-shrink: 0;
}
.bs-banner-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  min-height: 140px;
}
.bs-banner-cover {
  width: 110px;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bs-banner-cover-icon { font-size: 2.5rem; }
.bs-banner-info {
  flex: 1;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}
.bs-banner-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
  letter-spacing: 0.03em;
}
.bs-banner-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}
.bs-banner-desc {
  font-size: 0.8rem;
  color: var(--fg-secondary);
  line-height: 1.4;
}
.bs-banner-meta {
  font-size: 0.7rem;
  color: var(--fg-muted);
}
.bs-banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 4px;
}
.bs-banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-muted);
  opacity: 0.4;
  transition: all 0.3s;
}
.bs-banner-dot.active {
  background: var(--accent);
  opacity: 1;
  width: 18px;
  border-radius: 3px;
}

/* ===== CATEGORY TAGS ===== */
.bs-categories {
  margin: 12px 0 20px;
  overflow: hidden;
}
.bs-cat-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0;
}
.bs-cat-scroll::-webkit-scrollbar { display: none; }
.bs-cat-tag {
  flex-shrink: 0;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--fg-secondary);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.bs-cat-tag:active,
.bs-cat-tag.active {
  background: var(--accent-dim);
  border-color: var(--border-accent);
  color: var(--accent);
}

/* ===== SECTION HEADERS ===== */
.bs-section {
  margin-bottom: 28px;
}
.bs-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.bs-section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.05rem;
  font-weight: 700;
}
.bs-section-more {
  font-size: 0.8rem;
  color: var(--fg-muted);
  transition: color 0.2s;
}
.bs-section-more:hover { color: var(--accent); }

/* ===== NOVEL GRID (hot recommendations) ===== */
.bs-novel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.bs-novel-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform 0.2s;
}
.bs-novel-card:active { transform: scale(0.97); }
.bs-novel-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.bs-cover-text {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.bs-cover-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 137, 6, 0.85);
  color: #fff;
}
.bs-novel-info {
  padding: 8px 2px 0;
}
.bs-novel-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bs-novel-author {
  font-size: 0.7rem;
  color: var(--fg-muted);
  margin-top: 2px;
}
.bs-novel-desc {
  font-size: 0.7rem;
  color: var(--fg-secondary);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.bs-novel-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.65rem;
  color: var(--fg-muted);
}

/* ===== NOVEL LIST (latest updates) ===== */
.bs-novel-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.bs-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  transition: background 0.2s;
}
.bs-list-item:active { background: var(--bg-card-hover); }
.bs-list-cover {
  width: 48px;
  height: 62px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bs-list-cover-text {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
}
.bs-list-info {
  flex: 1;
  min-width: 0;
}
.bs-list-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bs-list-desc {
  font-size: 0.75rem;
  color: var(--fg-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bs-list-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--fg-muted);
}
.bs-list-status {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.bs-list-status.ongoing {
  color: var(--accent);
  background: var(--accent-dim);
}
.bs-list-status.completed {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

/* ===== RANKING CARDS ===== */
.bs-ranking-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.bs-ranking-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.bs-ranking-card:active {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}
.bs-ranking-icon { font-size: 1.6rem; margin-bottom: 8px; }
.bs-ranking-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.bs-ranking-card p {
  font-size: 0.7rem;
  color: var(--fg-muted);
}

/* ===== RANKING PANEL ===== */
.bs-ranking-panel { margin-top: 8px; }

/* ===== BOTTOM NAV ===== */
.bs-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-height);
  background: rgba(26, 24, 38, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.bs-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--fg-muted);
  font-size: 0.65rem;
  padding: 6px 16px;
  transition: color 0.2s;
}
.bs-nav-item svg {
  width: 22px;
  height: 22px;
}
.bs-nav-item.active {
  color: var(--accent);
}

/* ===== SEARCH RESULTS OVERLAY ===== */
.bs-search-results {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  background: var(--bg-primary);
  overflow-y: auto;
  padding: 16px;
}
.bs-search-results.visible { display: block; }
.bs-search-results .bs-novel-list {
  max-width: 640px;
  margin: 0 auto;
}
.bs-search-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
  .bs-novel-grid { gap: 18px; }
  .bs-banner-card { min-height: 160px; }
  .bs-banner-cover { width: 130px; }
}
@media (min-width: 768px) {
  .bs-main { padding: 0 24px; }
  .bs-novel-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
