:root {
  --novel-shell: 1120px;
  --novel-bg: #f5f7fb;
  --novel-ink: #152033;
  --novel-muted: #667085;
  --novel-soft: #eef3f8;
  --novel-line: rgba(21, 32, 51, 0.1);
  --novel-surface: #ffffff;
  --novel-accent: #1e9eff;
  --novel-accent-2: #11a986;
  --novel-warm: #f0a23a;
  --novel-danger: #dd4b4b;
}

body.tibiu-novel-page {
  min-height: 100vh;
  margin: 0;
  color: var(--novel-ink);
  background: var(--novel-bg);
}

.tibiu-novel-page * {
  box-sizing: border-box;
}

.tibiu-novel-page a {
  color: inherit;
  text-decoration: none;
}

.tibiu-novel-page img {
  display: block;
  max-width: 100%;
}

.tibiu-novel-page button,
.tibiu-novel-page input,
.tibiu-novel-page textarea {
  font: inherit;
}

.tibiu-novel-page .tibiu-site-topbar {
  background: rgba(245, 247, 251, 0.96);
  border-bottom-color: rgba(21, 32, 51, 0.08);
}

.novel-shell {
  width: min(var(--novel-shell), calc(100% - 30px));
  margin: 0 auto;
}

.novel-main {
  padding: 8px 0 30px;
}

.novel-top-band {
  position: relative;
  overflow: hidden;
  padding: 14px 0 16px;
  background: #e9f2f7;
}

.novel-top-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(14, 35, 54, 0.76), rgba(14, 35, 54, 0.4), rgba(233, 242, 247, 0.86)),
    var(--novel-hero-cover, none);
  background-position: center;
  background-size: cover;
  opacity: 0.96;
}

.novel-hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.48fr);
  gap: 18px;
  align-items: end;
  min-height: 170px;
  color: #fff;
}

.novel-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.novel-hero-title {
  margin: 12px 0 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  font-weight: 900;
}

.novel-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.novel-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 800;
}

.novel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--novel-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.novel-btn--ghost {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.novel-btn--light {
  border-color: var(--novel-line);
  background: #fff;
  color: var(--novel-ink);
}

.novel-btn--danger {
  background: var(--novel-danger);
  color: #fff;
}

.novel-hero-book {
  justify-self: end;
  width: min(100%, 280px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  padding: 12px;
}

.novel-hero-book-link {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.novel-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #dce4ec;
}

.novel-cover--shadow {
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.novel-hero-book-title {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 900;
}

.novel-hero-book-author,
.novel-hero-book-desc {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.55;
}

.novel-hero-book-desc {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.novel-search-panel {
  margin-top: 10px;
  position: relative;
  z-index: 3;
}

.novel-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--novel-line);
  background: #fff;
  box-shadow: 0 8px 18px rgba(21, 32, 51, 0.05);
}

.novel-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  background: #f3f6fa;
  color: var(--novel-muted);
}

.novel-search-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
  color: var(--novel-ink);
  font-size: 14px;
}

.novel-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.novel-quick-link,
.novel-book-card,
.novel-list-item,
.novel-rank-item,
.novel-panel,
.novel-empty {
  border: 1px solid var(--novel-line);
  border-radius: 8px;
  background: var(--novel-surface);
}

.novel-quick-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 9px 10px;
}

.novel-quick-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  background: #eaf5ff;
  color: var(--novel-accent);
}

.novel-quick-title {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.novel-section {
  padding: 18px 0 0;
}

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

.novel-section-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 950;
}

.novel-section-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--novel-accent);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.novel-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.novel-chip-row::-webkit-scrollbar {
  display: none;
}

.novel-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--novel-line);
  border-radius: 8px;
  background: #fff;
  color: var(--novel-ink);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.novel-chip.is-active {
  border-color: rgba(30, 158, 255, 0.28);
  background: #eaf5ff;
  color: var(--novel-accent);
}

.novel-book-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.novel-book-card {
  display: block;
  min-width: 0;
  overflow: hidden;
}

.novel-book-card .novel-cover {
  border-bottom: 1px solid var(--novel-line);
}

.novel-book-card-body {
  padding: 10px;
}

.novel-book-title {
  margin: 0;
  color: var(--novel-ink);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 900;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.novel-book-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 6px;
  color: var(--novel-muted);
  font-size: 12px;
}

.novel-book-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.novel-book-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.novel-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 22px;
  padding: 0 7px;
  background: #f2f6fa;
  color: #536174;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.novel-tag--finish {
  background: #edf8f4;
  color: var(--novel-accent-2);
}

.novel-tag--paid {
  background: #fff4e4;
  color: #b66a00;
}

.novel-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.novel-list-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  min-height: 118px;
  padding: 10px;
}

.novel-list-item .novel-cover {
  height: 100%;
}

.novel-list-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 950;
}

.novel-list-desc {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--novel-muted);
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.novel-rank-list {
  display: grid;
  gap: 8px;
}

.novel-rank-item {
  display: grid;
  grid-template-columns: 38px 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
}

.novel-rank-no {
  color: var(--novel-warm);
  font-size: 18px;
  font-weight: 950;
  text-align: center;
}

.novel-rank-title {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.novel-rank-meta {
  margin: 3px 0 0;
  color: var(--novel-muted);
  font-size: 12px;
}

.novel-rank-badge {
  color: var(--novel-accent);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.novel-empty {
  padding: 24px 16px;
  color: var(--novel-muted);
  text-align: center;
  font-size: 14px;
}

.novel-loading {
  min-height: 110px;
  display: grid;
  place-items: center;
  color: var(--novel-muted);
  font-size: 13px;
}

.novel-skeleton-item,
.novel-skeleton-card {
  pointer-events: none;
}

.novel-skeleton-line,
.novel-skeleton-cover,
.novel-skeleton-chip,
.novel-skeleton-tag,
.novel-skeleton-rank-no,
.novel-skeleton-badge {
  position: relative;
  display: block;
  overflow: hidden;
  background: #e6edf5;
}

.novel-skeleton-line::after,
.novel-skeleton-cover::after,
.novel-skeleton-chip::after,
.novel-skeleton-tag::after,
.novel-skeleton-rank-no::after,
.novel-skeleton-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
  animation: novelSkeletonShimmer 1.25s ease-in-out infinite;
}

.novel-skeleton-line {
  width: min(var(--w, 100%), 100%);
  height: 12px;
  margin-top: 8px;
  border-radius: 999px;
}

.novel-skeleton-line:first-child {
  margin-top: 0;
}

.novel-skeleton-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
}

.novel-list-item .novel-skeleton-cover {
  height: 100%;
}

.novel-skeleton-card .novel-skeleton-cover {
  border-bottom: 1px solid var(--novel-line);
}

.novel-skeleton-chip {
  width: 76px;
  min-height: 34px;
  border-color: transparent;
}

.novel-skeleton-tag {
  width: 52px;
  min-height: 22px;
}

.novel-skeleton-rank-no {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  justify-self: center;
}

.novel-skeleton-badge {
  width: 44px;
  height: 18px;
  border-radius: 999px;
}

.novel-reader-skeleton {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.novel-reader .novel-skeleton-line {
  background: color-mix(in srgb, var(--reader-ink, #27231e) 13%, transparent);
}

@keyframes novelSkeletonShimmer {
  to {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .novel-skeleton-line::after,
  .novel-skeleton-cover::after,
  .novel-skeleton-chip::after,
  .novel-skeleton-tag::after,
  .novel-skeleton-rank-no::after,
  .novel-skeleton-badge::after {
    animation: none;
  }
}

.novel-detail-hero {
  position: relative;
  overflow: hidden;
  padding: 14px 0 18px;
  color: #fff;
  background: #172233;
}

.novel-detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 25, 39, 0.9), rgba(16, 25, 39, 0.58), rgba(16, 25, 39, 0.74)),
    var(--novel-detail-cover, none);
  background-position: center;
  background-size: cover;
  filter: saturate(0.96);
}

.novel-page-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.novel-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.novel-detail-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.novel-text-action {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 900;
}

.novel-vertical-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.novel-page-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 950;
}

.novel-detail-summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.novel-detail-summary .novel-cover {
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.novel-detail-title {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.12;
  font-weight: 950;
}

.novel-detail-author {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.novel-detail-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.novel-detail-content {
  display: block;
  max-width: 860px;
  padding: 12px 0 78px;
}

.novel-detail-mobile-metrics,
.novel-author-strip {
  display: none;
  border: 1px solid var(--novel-line);
  border-radius: 8px;
  background: var(--novel-surface);
}

.novel-detail-mobile-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.novel-detail-mobile-metrics div {
  min-width: 0;
}

.novel-detail-mobile-metrics strong {
  display: block;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 950;
}

.novel-detail-mobile-metrics span {
  display: block;
  margin-top: 5px;
  color: var(--novel-muted);
  font-size: 12px;
}

.novel-author-strip {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 12px;
}

.novel-author-avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
  background: #f3eef2;
  color: #8d7283;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.novel-author-avatar:empty::before {
  content: "";
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.8), transparent 22%),
    linear-gradient(145deg, #f28c64, #5d2b4b 58%, #1f2436);
}

.novel-author-strip strong,
.novel-author-strip span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.novel-author-strip strong {
  font-size: 15px;
  font-weight: 950;
}

.novel-author-strip span {
  margin-top: 3px;
  color: var(--novel-muted);
  font-size: 12px;
}

.novel-author-strip button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #f7f8fa;
  color: #ef7d46;
  font-size: 14px;
  font-weight: 950;
}

.novel-panel {
  padding: 14px;
}

.novel-panel + .novel-panel {
  margin-top: 12px;
}

.novel-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.novel-panel-title {
  margin: 0;
  font-size: 17px;
  font-weight: 950;
}

.novel-intro-text {
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.novel-original-list,
.novel-chapter-list {
  display: grid;
  gap: 8px;
}

.novel-original-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--novel-line);
  background: #f8fafc;
  color: #314156;
  font-size: 13px;
  font-weight: 850;
}

.novel-chapter-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--novel-line);
  background: #fff;
}

.novel-chapter-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 850;
}

.novel-chapter-meta {
  color: var(--novel-muted);
  font-size: 12px;
  white-space: nowrap;
}

.novel-catalog-row,
.novel-catalog-shade,
.novel-catalog-sheet-head,
.novel-catalog-status {
  display: none;
}

.novel-catalog-sheet {
  display: block;
}

.novel-detail-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  border-top: 1px solid var(--novel-line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}

.novel-detail-cta-inner {
  width: min(420px, calc(100% - 20px));
  margin: 0 auto;
  display: grid;
  padding: 10px 0;
}

.novel-detail-cta .novel-btn {
  width: 100%;
}

.novel-detail-cta .novel-btn.is-disabled {
  pointer-events: none;
  background: #d7dee8;
  color: #667085;
}

.novel-correction-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  place-items: end center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.38);
}

.novel-correction-modal.is-open {
  display: grid;
}

.novel-correction-panel {
  width: min(560px, 100%);
  max-height: min(82vh, 720px);
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  background: #fff;
}

.novel-correction-panel .novel-icon-btn {
  border-color: var(--novel-line);
  background: #f8fafc;
  color: var(--novel-ink);
}

.novel-correction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.novel-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.novel-field label {
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.novel-field input,
.novel-field textarea {
  width: 100%;
  border: 1px solid var(--novel-line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--novel-ink);
  padding: 10px;
  outline: 0;
}

.novel-field textarea {
  min-height: 96px;
  resize: vertical;
}

.novel-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.novel-link-row-fields {
  display: grid;
  gap: 8px;
}

.novel-reader {
  min-height: 100vh;
  background: var(--reader-bg, #f4efe3);
  color: var(--reader-ink, #27231e);
}

.novel-reader[data-theme="night"] {
  --reader-bg: #14171d;
  --reader-ink: #d7d7d1;
}

.novel-reader[data-theme="green"] {
  --reader-bg: #edf5ed;
  --reader-ink: #1d2d25;
}

.novel-reader[data-theme="white"] {
  --reader-bg: #f8fafc;
  --reader-ink: #1f2937;
}

.novel-reader-shell {
  width: min(820px, calc(100% - 30px));
  margin: 0 auto;
  padding: 18px 0 110px;
}

.novel-reader-book-link,
.novel-reader-comment-pill {
  display: none;
}

.novel-reader-title {
  margin: 32px 0 10px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 950;
}

.novel-reader-meta {
  color: color-mix(in srgb, var(--reader-ink) 62%, transparent);
  font-size: 13px;
}

.novel-reader-content {
  margin-top: 22px;
  font-size: var(--reader-font-size, 18px);
  line-height: 2.05;
}

.novel-reader-content p {
  margin: 0 0 1.1em;
}

.novel-reader-fallback {
  display: contents;
}

.novel-reader-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.novel-reader-switch a,
.novel-reader-switch span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--reader-ink) 16%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--reader-bg) 88%, #fff);
  color: var(--reader-ink);
  font-size: 14px;
  font-weight: 900;
}

.novel-reader-switch .is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.novel-reader-topbar,
.novel-reader-toolbar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--reader-bg) 88%, #fff);
  color: var(--reader-ink);
  border-color: color-mix(in srgb, var(--reader-ink) 14%, transparent);
  transition: transform 0.2s ease;
}

.novel-reader-topbar {
  top: 0;
  border-bottom: 1px solid;
}

.novel-reader-toolbar {
  bottom: 0;
  border-top: 1px solid;
}

.novel-reader.is-tools-hidden .novel-reader-topbar {
  transform: translateY(-100%);
}

.novel-reader.is-tools-hidden .novel-reader-toolbar {
  transform: translateY(100%);
}

.novel-reader-topbar-inner,
.novel-reader-toolbar-inner {
  width: min(820px, calc(100% - 20px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
}

.novel-reader-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.novel-reader-text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 900;
}

.novel-reader-progress-row,
.novel-reader-drawer-panel > .novel-panel-head:first-child {
  display: none;
}

.novel-reader-toolbar-inner {
  justify-content: space-around;
}

.novel-reader-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 42px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 850;
}

.novel-reader-action ti-icon {
  color: inherit;
}

.novel-reader-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.novel-reader-drawer.is-open {
  display: block;
}

.novel-reader-drawer-shade {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.novel-reader-drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(330px, 86vw);
  overflow: auto;
  padding: 16px;
  background: #fff;
  color: var(--novel-ink);
}

.novel-reader-setting {
  position: fixed;
  left: 50%;
  bottom: 66px;
  z-index: 100;
  width: min(520px, calc(100% - 20px));
  transform: translateX(-50%);
  display: none;
  padding: 14px;
  border: 1px solid var(--novel-line);
  border-radius: 8px;
  background: #fff;
  color: var(--novel-ink);
  box-shadow: 0 18px 42px rgba(21, 32, 51, 0.16);
}

.novel-reader-setting.is-open {
  display: block;
}

.novel-setting-row {
  display: grid;
  gap: 8px;
}

.novel-setting-row + .novel-setting-row {
  margin-top: 12px;
}

.novel-setting-title {
  color: var(--novel-muted);
  font-size: 12px;
  font-weight: 900;
}

.novel-theme-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.novel-theme-button {
  min-height: 34px;
  border: 1px solid var(--novel-line);
  border-radius: 8px;
  background: #fff;
  color: var(--novel-ink);
  font-size: 12px;
  font-weight: 900;
}

.novel-theme-button.is-active {
  border-color: var(--novel-accent);
  color: var(--novel-accent);
}

.novel-font-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.novel-font-row input {
  width: 100%;
}

.novel-access-panel {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--reader-ink) 16%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--reader-bg) 82%, #fff);
}

.novel-access-panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.novel-reader-content .novel-access-panel {
  line-height: 1.75;
}

.novel-reader-content .novel-access-panel p {
  margin: 0;
  text-indent: 0;
}

@supports not (color: color-mix(in srgb, #fff, #000)) {
  .novel-reader-meta {
    color: #6b6256;
  }

  .novel-reader-topbar,
  .novel-reader-toolbar,
  .novel-reader-switch a,
  .novel-reader-switch span,
  .novel-access-panel {
    background: rgba(255, 255, 255, 0.78);
  }
}

@media (max-width: 960px) {
  .novel-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .novel-hero-book {
    display: none;
  }

  .novel-book-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .novel-main {
    padding-top: 0;
  }

  body.novel-modal-open {
    overflow: hidden;
  }

  .novel-detail-page {
    background: #fff;
  }

  .novel-detail-page .tibiu-site-topbar {
    display: none;
  }

  .novel-top-band {
    padding: 12px 0 14px;
  }

  .novel-hero-title {
    font-size: 30px;
  }

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

  .novel-book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .novel-list-grid {
    grid-template-columns: 1fr;
  }

  .novel-rank-item {
    grid-template-columns: 30px 48px minmax(0, 1fr);
  }

  .novel-rank-badge {
    display: none;
  }

  .novel-detail-summary {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px;
  }

  .novel-detail-title {
    font-size: 26px;
  }

  .novel-detail-hero {
    padding: calc(env(safe-area-inset-top, 0px) + 18px) 0 28px;
    background: #fff2f8;
    color: #3a2634;
  }

  .novel-detail-hero::before {
    background:
      radial-gradient(ellipse at 18% 0%, rgba(248, 197, 220, 0.72), transparent 54%),
      linear-gradient(160deg, #ffe5f1 0%, #fff5fb 58%, #fff 58%);
    filter: none;
  }

  .novel-detail-hero::after {
    content: "";
    position: absolute;
    left: -8%;
    right: -8%;
    bottom: -42px;
    height: 92px;
    border-radius: 0 0 50% 50%;
    background: #fff;
    transform: rotate(3deg);
  }

  .novel-detail-hero .novel-shell {
    width: calc(100% - 30px);
    position: relative;
    z-index: 1;
  }

  .novel-page-head {
    margin-bottom: 50px;
  }

  .novel-page-head .novel-icon-btn,
  .novel-catalog-close,
  .novel-reader-drawer-close {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    color: currentColor;
  }

  .novel-text-action {
    font-size: 16px;
    color: #4a3342;
  }

  .novel-detail-summary {
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
  }

  .novel-detail-summary .novel-cover {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 12px 22px rgba(73, 44, 60, 0.22);
  }

  .novel-cover--shadow {
    box-shadow: 0 12px 22px rgba(73, 44, 60, 0.22);
  }

  .novel-detail-summary .novel-eyebrow {
    display: none;
  }

  .novel-detail-title {
    display: -webkit-box;
    overflow: hidden;
    color: #3a2634;
    font-size: 25px;
    line-height: 1.28;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .novel-detail-author {
    margin-top: 10px;
    color: #8d7885;
    font-size: 15px;
  }

  .novel-detail-stat-row {
    gap: 7px;
    margin-top: 12px;
  }

  .novel-detail-stat-row .novel-meta-pill {
    min-height: 30px;
    border: 0;
    border-radius: 6px;
    background: rgba(78, 48, 66, 0.08);
    color: #826b78;
    font-size: 13px;
  }

  .novel-detail-summary .novel-book-tags {
    margin-top: 10px;
  }

  .novel-detail-content {
    width: calc(100% - 30px);
    max-width: none;
    padding: 18px 0 104px;
  }

  .novel-author-strip {
    display: grid;
    margin: 8px 0 18px;
    border: 0;
    background: transparent;
    padding: 0;
  }

  .novel-author-avatar {
    width: 46px;
    height: 46px;
    background: #f2edf0;
  }

  .novel-author-strip strong {
    font-size: 17px;
  }

  .novel-author-strip span {
    font-size: 14px;
  }

  .novel-author-strip button {
    min-height: 44px;
    padding: 0 18px;
    background: #f7f7f7;
    font-size: 16px;
  }

  .novel-detail-mobile-metrics {
    display: grid;
    padding: 18px 0 22px;
    margin-bottom: 10px;
    border: 0;
    border-bottom: 1px solid #ececec;
    border-radius: 0;
    background: transparent;
  }

  .novel-detail-mobile-metrics strong {
    color: #000;
    font-size: 32px;
    letter-spacing: 0;
  }

  .novel-detail-mobile-metrics span {
    color: #9b9b9b;
    font-size: 14px;
  }

  .novel-panel {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 20px 0;
  }

  .novel-panel + .novel-panel {
    margin-top: 0;
    border-top: 1px solid #eeeeee;
  }

  .novel-panel-title {
    color: #111;
    font-size: 22px;
  }

  .novel-section-link {
    color: #9b9b9b;
  }

  .novel-intro-text {
    display: -webkit-box;
    overflow: hidden;
    color: #1f1f1f;
    font-size: 18px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .novel-tag {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 6px;
    background: #f5f5f5;
    color: #686868;
    font-size: 15px;
  }

  .novel-catalog-panel {
    padding: 0;
  }

  .novel-catalog-desktop-head {
    display: none;
  }

  .novel-catalog-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 72px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #111;
    text-align: left;
  }

  .novel-catalog-row > span:first-child {
    font-size: 23px;
    font-weight: 950;
  }

  .novel-catalog-row > span:last-child {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: #a4a4a4;
    font-size: 15px;
    white-space: nowrap;
  }

  .novel-catalog-shade {
    position: fixed;
    inset: 0;
    z-index: 1180;
    background: rgba(19, 12, 18, 0.46);
  }

  .novel-catalog-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1190;
    display: none;
    max-height: 78vh;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
    background: #fff;
    color: #111;
  }

  .novel-catalog-panel.is-open .novel-catalog-shade,
  .novel-catalog-panel.is-open .novel-catalog-sheet {
    display: block;
  }

  .novel-catalog-sheet-head {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 64px;
    align-items: center;
    min-height: 66px;
    border-bottom: 1px solid #eeeeee;
    padding: 0 12px;
  }

  .novel-catalog-sheet-head .novel-panel-title {
    text-align: center;
  }

  .novel-catalog-sort {
    border: 0;
    background: transparent;
    color: #111;
    font-size: 18px;
    font-weight: 850;
  }

  .novel-catalog-status {
    display: block;
    margin: 0;
    padding: 22px 22px 8px;
    color: #a0a0a0;
    font-size: 17px;
  }

  .novel-catalog-sheet #novelChapterList {
    max-height: calc(78vh - 132px);
    overflow: auto;
    padding: 0 22px 22px;
  }

  .novel-catalog-sheet .novel-chapter-list {
    gap: 0;
  }

  .novel-catalog-sheet .novel-chapter-item {
    min-height: 70px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .novel-catalog-sheet .novel-chapter-title {
    font-size: 19px;
    font-weight: 850;
  }

  .novel-catalog-sheet .novel-chapter-meta {
    display: none;
  }

  .novel-original-link,
  .novel-chapter-item {
    border-radius: 0;
  }

  .novel-detail-cta-inner {
    width: calc(100% - 28px);
    max-width: 420px;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .novel-detail-cta {
    border-top-color: rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.96);
  }

  .novel-detail-cta .novel-btn {
    min-height: 54px;
    border-radius: 999px;
    background: #f3824b;
    font-size: 18px;
  }

  .novel-reader {
    --reader-bg: #ece8d4;
    --reader-ink: #121006;
    background: var(--reader-bg);
  }

  .novel-reader[data-theme="white"] {
    --reader-bg: #f6f3e4;
    --reader-ink: #16140b;
  }

  .novel-reader[data-theme="green"] {
    --reader-bg: #e9f2df;
  }

  .novel-reader-topbar {
    top: 0;
    padding-top: env(safe-area-inset-top, 0px);
    border: 0;
    background: color-mix(in srgb, var(--reader-bg) 94%, transparent);
    backdrop-filter: blur(10px) saturate(110%);
    -webkit-backdrop-filter: blur(10px) saturate(110%);
  }

  .novel-reader-topbar-inner {
    width: calc(100% - 28px);
    min-height: 60px;
    gap: 8px;
  }

  .novel-reader-top-actions {
    flex: 1;
    justify-content: flex-end;
    gap: 6px;
  }

  .novel-reader-topbar .novel-reader-action {
    min-width: 38px;
    min-height: 40px;
    padding: 0 4px;
    font-size: 0;
  }

  .novel-reader-text-action {
    min-height: 40px;
    padding: 0 4px;
    font-size: 16px;
  }

  .novel-reader-shell {
    width: calc(100% - 40px);
    padding: calc(env(safe-area-inset-top, 0px) + 82px) 0 150px;
  }

  .novel-reader-book-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    margin-bottom: 18px;
    color: color-mix(in srgb, var(--reader-ink) 45%, transparent);
  }

  .novel-reader-book-link a {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: inherit;
    font-size: 15px;
    font-weight: 850;
  }

  .novel-reader-book-link a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .novel-reader-title {
    margin: 0 0 16px;
    color: var(--reader-ink);
    font-size: clamp(34px, 9vw, 48px);
    line-height: 1.24;
    font-weight: 950;
  }

  .novel-reader-meta {
    display: none;
  }

  .novel-reader-comment-pill {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    margin: 0 0 34px;
    padding: 0 13px;
    border: 0;
    border-radius: 6px;
    background: color-mix(in srgb, var(--reader-ink) 7%, transparent);
    color: color-mix(in srgb, var(--reader-ink) 46%, transparent);
    font-size: 16px;
    font-weight: 850;
  }

  .novel-reader-content {
    margin-top: 0;
    font-size: max(var(--reader-font-size, 28px), 26px);
    line-height: 2.2;
  }

  .novel-reader-content p {
    margin: 0 0 1.25em;
    text-indent: 2em;
  }

  .novel-reader-content .novel-access-panel {
    margin-top: 18px;
    padding: 22px;
    font-size: 17px;
    line-height: 1.75;
  }

  .novel-reader-content .novel-access-panel strong {
    font-size: 22px;
  }

  .novel-reader-switch {
    display: none;
  }

  .novel-reader-toolbar {
    border-top-color: color-mix(in srgb, var(--reader-ink) 12%, transparent);
    background: color-mix(in srgb, var(--reader-bg) 92%, transparent);
    backdrop-filter: blur(12px) saturate(110%);
    -webkit-backdrop-filter: blur(12px) saturate(110%);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .novel-reader-progress-row {
    width: calc(100% - 30px);
    margin: 12px auto 2px;
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) 66px;
    gap: 12px;
    align-items: center;
  }

  .novel-reader-progress-row a {
    color: var(--reader-ink);
    font-size: 16px;
    font-weight: 900;
    text-align: center;
  }

  .novel-reader-progress-row .is-disabled {
    opacity: 0.4;
    pointer-events: none;
  }

  .novel-reader-progress-row input {
    width: 100%;
    accent-color: #f6f0d9;
  }

  .novel-reader-toolbar-inner {
    width: calc(100% - 40px);
    min-height: 74px;
  }

  .novel-reader-toolbar .novel-reader-action {
    flex-direction: column;
    min-width: 58px;
    min-height: 58px;
    gap: 5px;
    font-size: 14px;
  }

  .novel-reader-drawer-panel {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 86vh;
    padding: 0;
    border-radius: 14px 14px 0 0;
    background: #fff;
  }

  .novel-reader-drawer-panel > .novel-panel-head:first-child {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 64px;
    align-items: center;
    min-height: 66px;
    padding: 0 12px;
    border-bottom: 1px solid #eeeeee;
  }

  .novel-reader-drawer-panel > .novel-panel-head:first-child .novel-panel-title {
    text-align: center;
  }

  .novel-reader-drawer-desktop-head {
    display: none;
  }

  .novel-reader-drawer-panel .novel-catalog-status {
    display: block;
    padding: 22px 22px 8px;
  }

  #novelReaderChapterList {
    max-height: calc(86vh - 132px);
    overflow: auto;
    padding: 0 22px 24px;
  }

  #novelReaderChapterList.novel-chapter-list {
    gap: 0;
  }

  #novelReaderChapterList .novel-chapter-item {
    min-height: 70px;
    padding: 0;
    border: 0;
  }

  #novelReaderChapterList .novel-chapter-title {
    font-size: 19px;
    font-weight: 850;
  }

  #novelReaderChapterList .novel-chapter-meta {
    display: none;
  }

  .novel-reader-setting {
    bottom: calc(154px + env(safe-area-inset-bottom, 0px));
  }

}

@media (max-width: 420px) {
  .novel-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .novel-hero-book-link {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .novel-search-form {
    grid-template-columns: 1fr;
  }

  .novel-search-form .novel-btn {
    width: 100%;
  }
}

.novel-text-action.is-active,
.novel-reader-text-action.is-active {
  background: rgba(239, 125, 52, 0.12);
  color: #ef7d34;
}

.novel-text-action--light {
  background: rgba(21, 32, 51, 0.06);
  color: var(--novel-ink);
}

.novel-comment-panel-copy {
  margin: 0;
  color: var(--novel-muted);
  font-size: 14px;
  line-height: 1.8;
}

.novel-comment-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.novel-comment-drawer.is-open {
  display: block;
}

.novel-comment-shade {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 22, 0.42);
}

.novel-comment-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(82vh, 760px);
  border-radius: 16px 16px 0 0;
  background: #fff;
  box-shadow: 0 -20px 48px rgba(10, 14, 22, 0.18);
  overflow: hidden;
}

.novel-comment-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 70px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--novel-line);
}

.novel-comment-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

.novel-comment-head p {
  margin: 3px 0 0;
  color: var(--novel-muted);
  font-size: 12px;
}

.novel-comment-list {
  min-height: 180px;
  overflow: auto;
  padding: 10px 16px 18px;
}

.novel-comment-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(21, 32, 51, 0.08);
}

.novel-comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef3f8;
}

.novel-comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--novel-muted);
  font-size: 12px;
}

.novel-comment-meta strong {
  min-width: 0;
  color: var(--novel-ink);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.novel-comment-body p {
  margin: 7px 0 0;
  color: var(--novel-ink);
  font-size: 15px;
  line-height: 1.75;
}

.novel-comment-actions,
.novel-comment-reply {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.novel-comment-actions button,
.novel-comment-reply button {
  border: 0;
  background: transparent;
  color: var(--novel-muted);
  font-size: 12px;
  cursor: pointer;
}

.novel-comment-replies {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f7f9fc;
}

.novel-comment-reply {
  justify-content: flex-start;
  margin-top: 0;
  color: var(--novel-muted);
  font-size: 12px;
}

.novel-comment-reply span {
  min-width: 0;
  color: var(--novel-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.novel-comment-empty {
  padding: 34px 12px;
  color: var(--novel-muted);
  text-align: center;
  font-size: 14px;
}

.novel-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--novel-line);
  background: #fff;
}

.novel-comment-form textarea {
  width: 100%;
  min-height: 46px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--novel-line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--novel-ink);
  background: #f8fafc;
  outline: none;
}

.novel-comment-form .novel-btn {
  align-self: end;
  min-width: 78px;
}

@media (max-width: 640px) {
  .novel-comment-sheet {
    max-height: 86vh;
  }

  .novel-comment-form {
    grid-template-columns: 1fr;
  }
}
