.novel-world .work-page {
  max-width: 1300px;
  padding-top: 16px;
}
.novel-world .work-hero {
  background: linear-gradient(115deg, #5c5149, #8b7964);
  min-height: 140px;
  padding: 26px 30px;
  border-radius: 20px;
  box-shadow: 0 8px 25px #5c514912;
}
.novel-world .work-hero h2 {
  font-family: Georgia, "Noto Serif SC", serif;
  font-weight: 500;
  font-size: 28px;
  letter-spacing: 2px;
}
.novel-world .work-hero p {
  font-size: 13px;
  margin-top: 10px;
}
.novel-world .work-grid {
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 28px 22px;
}
.novel-world .novel-tile {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.novel-world .novel-open {
  padding: 0;
  text-align: left;
}
.novel-world .novel-cover {
  width: 100%;
  aspect-ratio: 3/4;
  height: auto;
  object-fit: cover;
  border-radius: 3px 9px 9px 3px;
  background: linear-gradient(140deg, #c9b9a5, #9b8975);
  box-shadow:
    inset 4px 0 0 #0002,
    4px 6px 12px #473c3223;
  display: grid;
  place-items: center;
  font:
    46px Georgia,
    serif;
  color: #fff;
  transition: transform 0.2s;
}
.novel-world .novel-open:hover .novel-cover {
  transform: translateY(-3px);
}
.novel-world .novel-open h3 {
  font-size: 15px;
  margin: 12px 0 3px;
  line-height: 1.5;
}
.novel-world .novel-open p {
  font-size: 12px;
  color: var(--page-muted);
  margin: 0;
}
.novel-world .novel-options {
  border: 1px solid var(--page-line);
  border-radius: 9px;
  background: var(--page-card);
  padding: 5px 10px;
  position: static;
  margin-top: 8px;
}
.novel-world #novelProfile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 16px 20px;
}
.novel-world #novelProfile p {
  margin: 0;
  flex: 1;
  color: var(--page-muted);
  font-size: 12px;
}
.novel-world .novel-nav {
  background: var(--page-card);
  border-color: var(--page-line);
}
.novel-create .work-page {
  padding-top: 12px;
}
.novel-create .work-card {
  box-shadow: 0 10px 36px #44372807;
  border-radius: 22px;
  padding: 28px;
}
.novel-create #stepLabel {
  letter-spacing: 1px;
  border-bottom: 1px solid var(--page-line);
  padding-bottom: 16px;
}
.novel-create input,
.novel-create textarea {
  background: transparent;
  border-radius: 9px;
  line-height: 1.8;
}
.novel-create #createForm > [data-step="0"] {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 0 26px;
}
.novel-create #createForm > [data-step="0"] > .work-field:first-child {
  grid-row: span 3;
  font-size: 12px;
}
.novel-create #cover {
  font-size: 11px;
  padding: 10px 0;
  border: 0;
}
.novel-create #coverPreview {
  width: 150px !important;
  box-shadow: 3px 8px 18px #44372820;
  border-radius: 3px 9px 9px 3px !important;
}
.novel-create .work-field {
  font-size: 13px;
  color: var(--page-muted);
}
.novel-create .work-field :is(input, textarea) {
  color: var(--page-text);
}
.novel-reader {
  height: 100dvh;
  overflow: hidden;
}
.novel-reader .novel-editor {
  height: 100%;
  max-width: 1000px;
  width: 100%;
  margin: auto;
  padding: 10px 24px max(10px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.novel-reader .work-header {
  min-height: 44px;
  gap: 8px;
  margin: 0 0 8px;
  flex: none;
}
.novel-reader .work-header h1 {
  font:
    600 16px Georgia,
    "Noto Serif SC",
    serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 1px;
}
.novel-reader .work-header :is(button, a) {
  background: transparent;
  padding: 7px 10px;
  font-size: 12px;
  border: 1px solid var(--page-line);
  border-radius: 10px;
}
.novel-reader #generate {
  background: var(--page-accent);
  color: var(--page-card);
  border: 0;
}
.novel-reader #editToolbar {
  margin: 0 0 6px;
  gap: 6px;
  flex: none;
}
.novel-reader #editToolbar button {
  font-size: 11px;
  padding: 5px 9px;
}
.novel-reader #chapterTitle {
  font:
    500 16px/1.5 Georgia,
    "Noto Serif SC",
    serif;
  text-align: center;
  margin: 2px 0 9px;
  flex: none;
}
.novel-reader #chapterSaveState {
  font-size: 10px;
  align-self: center;
}
.novel-reader #generationStatus {
  font-size: 11px;
  line-height: 1.5;
  margin: 7px 0 0;
  flex: none;
  max-height: 35px;
  overflow: auto;
}
.novel-reader .novel-editor > .work-actions:last-child {
  margin: 7px 0 0;
  gap: 8px;
  flex: none;
}
.novel-reader .novel-editor > .work-actions:last-child button {
  font-size: 11px;
  padding: 5px 10px;
}
.paper-reader {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}
.paper-stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--page-card);
  border-radius: 5px 10px 10px 5px;
  border: 1px solid var(--page-line);
  box-shadow:
    inset 4px 0 8px #8e77540b,
    0 8px 24px #55432d0c;
  position: relative;
}
.paper-stage:before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#907d5a0b 0.6px, transparent 0.6px);
  background-size: 4px 4px;
}
.paper-leaf {
  height: 100%;
  margin: 0;
  padding: 27px 36px 20px;
  font:
    17px/1.95 Georgia,
    "Noto Serif SC",
    "Songti SC",
    "SimSun",
    serif;
  letter-spacing: 0.025em;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  outline: none;
}
.paper-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  min-height: 44px;
  flex: none;
}
.paper-controls button {
  font-size: 25px;
  line-height: 1;
  background: transparent;
  border: 0;
  color: var(--page-text);
  padding: 6px 17px;
  min-width: 44px;
}
.paper-controls button:disabled {
  opacity: 0.25;
  cursor: default;
}
.paper-controls span {
  font-size: 11px;
  color: var(--page-muted);
  font-variant-numeric: tabular-nums;
}
#paperNewPages {
  position: absolute;
  right: 10px;
  bottom: 48px;
  padding: 6px 10px;
  border-radius: 20px;
  background: var(--page-card);
  border: 1px solid var(--page-line);
  color: var(--page-muted);
  font-size: 10px;
  box-shadow: 0 2px 9px #0001;
}
.novel-reader #chapterContent {
  flex: 1;
  min-height: 0;
  resize: none;
  background: var(--page-card);
  border: 1px solid var(--page-line);
  border-radius: 10px;
  font:
    16px/1.9 Georgia,
    "Noto Serif SC",
    serif;
  padding: 22px;
}
.novel-reader .work-dialog > section {
  background: var(--page-card);
  max-height: 88dvh;
  overflow: auto;
}
.novel-sidebar {
  background: var(--page-card);
  border-left: 1px solid var(--page-line);
  box-shadow: -12px 0 40px #32291716;
}
.novel-sidebar #chapterList button {
  border-bottom: 1px solid var(--page-line);
  font-size: 13px;
}
@media (min-width: 1100px) {
  .novel-world .work-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 30px;
  }
  .novel-world .work-page {
    padding-right: 42px;
  }
  .novel-reader .novel-editor {
    padding-top: 18px;
    padding-bottom: 18px;
    max-width: 900px;
  }
}
@media (max-width: 580px) {
  .novel-world .work-page {
    padding: 10px 20px 95px;
  }
  .novel-world .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px 20px;
  }
  .novel-world .work-hero {
    padding: 22px;
    min-height: 125px;
  }
  .novel-world .work-hero h2 {
    font-size: 24px;
  }
  .novel-create .work-page {
    padding: 8px 16px 80px;
  }
  .novel-create .work-header {
    gap: 8px;
    flex-wrap: wrap;
  }
  .novel-create .work-header h1 {
    font-size: 18px;
  }
  .novel-create .work-header #draftState {
    flex-basis: 100%;
    font-size: 11px;
  }
  .novel-create .work-card {
    padding: 20px;
  }
  .novel-create #createForm > [data-step="0"] {
    grid-template-columns: 1fr;
  }
  .novel-create #createForm > [data-step="0"] > .work-field:first-child {
    grid-row: auto;
  }
  .novel-reader .novel-editor {
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  }
  .novel-reader .work-header a {
    padding: 6px;
    font-size: 11px;
  }
  .paper-leaf {
    padding: 20px 22px 16px;
    font-size: 16px;
    line-height: 1.9;
  }
  .novel-reader #chapterTitle {
    font-size: 15px;
    margin-bottom: 7px;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .novel-reader .novel-editor {
    padding: 5px max(18px, env(safe-area-inset-left));
  }
  .novel-reader .work-header {
    min-height: 32px;
    margin-bottom: 2px;
  }
  .novel-reader #editToolbar {
    position: static;
    max-width: none;
    margin-bottom: 3px;
  }
  .novel-reader #chapterTitle {
    font-size: 12px;
    margin: 0 0 3px;
  }
  .paper-leaf {
    font-size: 15px;
    line-height: 1.75;
    padding: 12px 26px;
  }
  .paper-controls {
    min-height: 30px;
  }
  .novel-reader #generationStatus {
    margin-top: 2px;
    font-size: 10px;
  }
  .novel-reader .novel-editor > .work-actions:last-child {
    margin-top: 2px;
  }
}
/* Writing surfaces share the user's theme; depth comes from spacing, not blur. */
.novel-world .work-page { max-width: 1180px; }
.novel-world #novelProfile {
  padding: 26px 0 22px;
  margin-bottom: 0;
  border-bottom: 0;
  flex-wrap: nowrap;
}
.novel-world #novelProfile > img { width: 64px; height: 64px; }
.novel-create-link {
  background: var(--page-accent);
  color: #fff;
  border-color: transparent;
  border-radius: 14px;
  padding: 10px 16px;
}
.novel-shelf-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 0 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--page-line);
}
.novel-shelf-stats > div { display: grid; gap: 3px; }
.novel-shelf-stats strong { font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; }
.novel-shelf-stats span { font-size: 12px; color: var(--page-muted); }
.novel-world .novel-tile { position: relative; min-width: 0; }
.novel-world .novel-cover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--page-accent) 70%, var(--page-card)), color-mix(in srgb, var(--page-accent) 30%, var(--page-bg)));
  border-radius: 4px 10px 10px 4px;
}
.novel-world .novel-cover-placeholder {
  font: 500 22px/1.7 Georgia, "Songti SC", serif;
  padding: 18px;
  text-align: center;
  text-wrap: balance;
  overflow: hidden;
  color: var(--page-text);
  border-left: 5px solid color-mix(in srgb, var(--page-accent) 25%, transparent);
}
.novel-world .novel-copy { min-width: 0; }
.novel-world .novel-options {
  position: absolute;
  top: 5px;
  right: 5px;
  margin: 0;
  padding: 4px 8px;
  min-width: 32px;
  border-radius: 10px;
  color: var(--page-text);
  background: var(--page-card);
  box-shadow: 0 2px 8px #0001;
}
.novel-world[data-tab="square"] .novel-tile {
  padding: 18px;
  border: 1px solid var(--page-line);
  border-radius: 18px;
  background: var(--page-card);
}
.novel-world[data-tab="square"] .work-grid { gap: 18px; }
.novel-world[data-tab="square"] .novel-copy h3 { font-size: 18px; }
.novel-world .work-empty {
  grid-column: 1/-1;
  padding: 55px 24px;
  margin: 0;
  border: 1px dashed var(--page-line);
  border-radius: 18px;
  text-align: center;
  color: var(--page-muted);
}
.novel-world .novel-open:focus-visible,
.novel-cover-upload:focus-within { outline: 2px solid var(--page-accent); outline-offset: 4px; }
.novel-create .novel-cover-upload {
  grid-row: span 3;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 12px;
  margin-bottom: 18px;
  border: 1px dashed color-mix(in srgb, var(--page-accent) 40%, var(--page-line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--page-accent) 4%, var(--page-card));
  text-align: center;
}
.novel-create #cover {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  padding: 0;
}
.novel-cover-upload .cover-upload-copy { display: grid; justify-items: center; gap: 10px; }
.cover-upload-copy strong { font-size: 13px; font-weight: 600; }
.cover-upload-copy small { color: var(--page-muted); font-size: 11px; line-height: 1.8; }
.cover-upload-mark { color: var(--page-accent); font-size: 30px; line-height: 1.2; }
.novel-create #coverPreview { width: min(125px, 100%) !important; max-height: 190px; object-fit: cover; }
.novel-create .novel-cover-upload:has(#coverPreview:not([hidden])) .cover-upload-mark { display: none; }
.novel-create #createForm .work-field { min-width: 0; }
.lm-tool-field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lm-ai-field { flex: none; padding: 3px 9px !important; min-height: 27px; font-size: 11px !important; }
.novel-reader #generationVersions { width: auto; min-width: 38px; padding: 5px 8px; font-size: 11px; white-space: nowrap; }
.novel-retry-row { text-align: center; padding-top: 2px; }
.novel-retry-row button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--page-line); border-radius: 20px; background: var(--page-card); color: var(--page-muted); font-size: 11px; padding: 5px 12px; }
.novel-retry-row svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 760px) {
  .novel-world .work-page { padding-inline: 18px; }
  .novel-world #novelProfile { gap: 12px; padding: 20px 0 12px; }
  .novel-world #novelProfile > img { width: 52px; height: 52px; }
  .novel-world .novel-create-link { padding: 8px 12px; }
  .novel-shelf-stats { margin-bottom: 20px; gap: 8px; }
  .novel-shelf-stats strong { font-size: 21px; }
  .novel-world[data-tab="mine"] .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 23px 15px; }
  .novel-world .novel-cover-placeholder { font-size: 17px; padding: 10px; }
  .novel-world[data-tab="square"] .novel-tile { padding: 14px; border-radius: 16px; }
  .novel-world[data-tab="square"] .novel-open { grid-template-columns: 78px minmax(0,1fr); gap: 14px; }
  .novel-world[data-tab="square"] .novel-copy h3 { font-size: 16px; }
  .novel-world[data-tab="square"] .novel-intro-preview { font-size: 12px; margin: 8px 0; }
  .novel-create #createForm > [data-step="0"] { display: block; }
  .novel-create .novel-cover-upload { flex-direction: row; gap: 20px; min-height: 140px; padding: 18px; }
  .novel-create .novel-cover-upload .cover-upload-copy { justify-items: start; text-align: left; }
  .novel-create #coverPreview { width: 76px !important; max-height: 110px; }
  .novel-create .work-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .novel-world .novel-cover { transition: none; }
  .novel-world .novel-open:hover .novel-cover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .novel-world .novel-cover {
    transition: none;
  }
}

/* Follow the same personal palette as every other page. */
html body:is(.novel-world, .novel-detail, .novel-reader, .novel-create) {
  --page-bg: var(--lm-base, var(--lm-page-color, #fff));
  --page-card: var(--lm-panel, #f7f7fa);
  --page-text: var(--lm-ink, var(--lm-page-text, #24232a));
  --page-muted: color-mix(in srgb, var(--page-text) 62%, var(--page-bg));
  --page-line: color-mix(in srgb, var(--page-text) 14%, var(--page-bg));
  --page-accent: var(--primary, #8769db);
  background: var(--page-bg) !important;
  color: var(--page-text);
}
.novel-world .work-page {
  max-width: 1180px;
  padding: 14px 26px 108px;
}
.novel-world .novel-square-header {
  min-height: 42px;
  margin: 0 0 22px;
}
.novel-world .novel-square-header a {
  padding: 8px 0;
  background: none;
  font-size: 14px;
  color: var(--page-muted);
}
.novel-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 0 30px;
  border-bottom: 1px solid var(--page-line);
  margin-bottom: 28px;
}
.novel-identity > img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid #fff5;
}
.novel-identity > div {
  min-width: 0;
  flex: 1;
}
.novel-identity strong {
  display: block;
  font-size: 21px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.novel-identity p {
  color: var(--page-muted);
  font-size: 12px;
  line-height: 1.7;
  margin: 5px 0 0;
}
.novel-create-link {
  font-size: 12px;
  padding: 8px 12px;
  border: 1px solid var(--page-line);
  border-radius: 20px;
  white-space: nowrap;
}
.novel-shelf-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 15px;
  letter-spacing: 1px;
}
.novel-shelf-label button {
  font-size: 12px;
  background: none;
  border: 0;
  color: var(--page-muted);
  padding: 4px 0 4px 12px;
}
.novel-world .work-grid {
  gap: 28px 24px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.novel-world .novel-cover {
  border-radius: 2px 5px 5px 2px;
  box-shadow: 3px 5px 12px #49392218;
}
.novel-world .novel-open h3 {
  font:
    600 16px/1.5 Georgia,
    "Songti SC",
    "SimSun",
    serif;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0.02em;
}
.novel-world .novel-open p {
  font-size: 11px;
  color: var(--page-muted);
  line-height: 1.65;
}
.novel-world .novel-intro-preview {
  display: none;
}
.novel-world .novel-category {
  display: none;
}
.novel-world .novel-options {
  border: 0;
  border-radius: 0;
  padding: 5px 3px;
  background: none;
  margin-top: 4px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--page-muted);
}
.novel-world[data-tab="square"] .work-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 36px;
}
.novel-world[data-tab="square"] .novel-open {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  text-align: left;
}
.novel-world[data-tab="square"] .novel-copy h3 {
  margin: 2px 0 8px;
  font-size: 19px;
}
.novel-world[data-tab="square"] .novel-intro-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  margin: 12px 0;
  color: var(--page-text);
  opacity: 0.75;
}
.novel-world[data-tab="square"] .novel-category {
  display: inline-block;
  font-size: 11px;
  border: 1px solid var(--page-line);
  border-radius: 20px;
  padding: 2px 9px;
  color: var(--page-muted);
}
.novel-world .novel-nav {
  background: var(--page-bg);
  border-color: var(--page-line);
  backdrop-filter: none;
}
.novel-world .novel-nav button {
  font-size: 13px;
  font-weight: 500;
  min-height: 40px;
}
.novel-world .novel-nav button.active {
  color: var(--page-text);
  font-weight: 650;
}
.novel-world .work-grid[aria-busy="true"]:empty:before {
  content: "正在翻开书架…";
  grid-column: 1/-1;
  color: var(--page-muted);
  font-size: 13px;
  padding: 32px 0;
}
.novel-world #retry,
.novel-world #loadMore {
  display: block;
  margin: 24px auto;
  background: none;
  font-size: 13px;
}
.novel-detail-page {
  width: min(100%, 800px);
  margin: auto;
  padding: 18px 24px 110px;
}
.novel-detail-header {
  font-size: 13px;
  color: var(--page-muted);
  margin-bottom: 20px;
}
.novel-detail-header a {
  display: inline-block;
  padding: 7px 0;
}
.book-jacket {
  position: relative;
  border: 1px solid var(--page-line);
  border-radius: 20px;
  padding: 28px 30px 36px;
}
.book-jacket:before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid color-mix(in srgb, var(--page-line) 65%, transparent);
  border-radius: 14px;
  pointer-events: none;
}
.book-ornament {
  font-size: 24px;
  text-align: center;
  color: var(--page-muted);
  margin: -4px 0 22px;
}
.book-detail-cover,
.book-cover-placeholder {
  display: block;
  width: 164px;
  aspect-ratio: 3/4;
  object-fit: cover;
  margin: 0 auto;
  border-radius: 3px 6px 6px 3px;
  box-shadow: 3px 6px 13px #4939221c;
}
.book-cover-placeholder {
  display: grid;
  place-items: center;
  background: #b6a78a;
  font:
    48px Georgia,
    serif;
  color: #faf4e6;
}
.book-jacket > h1 {
  text-align: center;
  font:
    500 26px/1.65 Georgia,
    "Songti SC",
    "SimSun",
    serif;
  margin: 24px 0 14px;
  overflow-wrap: anywhere;
}
.book-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--page-muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.book-author img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}
.book-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 28px 0;
  margin-top: 20px;
  border-top: 1px solid var(--page-line);
  border-bottom: 1px solid var(--page-line);
  text-align: center;
  gap: 8px;
}
.book-facts strong {
  display: block;
  font-size: 20px;
  font-weight: 650;
}
.book-facts span {
  display: block;
  font-size: 11px;
  color: var(--page-muted);
  margin-top: 4px;
}
.book-introduction > div {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.book-introduction h2 {
  font-size: 20px;
  letter-spacing: 2px;
  margin: 0;
}
.book-introduction > div > span {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 14px;
  background: #9d8d6712;
  color: var(--page-muted);
}
.book-introduction > p {
  white-space: pre-wrap;
  font:
    17px/2.05 Georgia,
    "Songti SC",
    "SimSun",
    serif;
  margin: 14px 0 0;
  overflow-wrap: anywhere;
}
.book-detail-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 800px);
  padding: 16px 24px max(16px, env(safe-area-inset-bottom));
  background: var(--page-bg);
  z-index: 10;
}
.book-detail-actions > a,
.book-detail-actions > button {
  font-size: 14px;
  min-height: 44px;
  min-width: 110px;
  text-align: center;
  border-radius: 24px;
  display: grid;
  place-items: center;
}
.book-detail-actions .work-secondary {
  background: transparent;
}
.book-directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.book-directory-header h2 {
  margin: 0;
}
#detailChapterList a {
  display: block;
  padding: 14px 2px;
  border-bottom: 1px solid var(--page-line);
  font-size: 14px;
  color: var(--page-text);
}
#detailDirectoryPages {
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.novel-reader .novel-editor {
  max-width: 850px;
  padding: 14px 32px max(10px, env(safe-area-inset-bottom));
}
.novel-reader .work-header {
  min-height: 40px;
  margin-bottom: 10px;
  gap: 10px;
  color: var(--page-muted);
}
.novel-reader .work-header h1 {
  font:
    400 13px/1.5 system-ui,
    sans-serif;
  letter-spacing: 0;
}
.novel-reader .work-header a,
.novel-reader .work-header button {
  font-size: 12px;
  background: none;
  border: 0;
  padding: 6px 7px;
  border-radius: 20px;
}
.novel-reader #generate {
  background: #9d8d6718;
  color: var(--page-text);
  padding: 6px 14px;
}
.novel-reader #editToolbar {
  gap: 6px;
  margin: 0 0 10px;
}
.novel-reader #editToolbar button {
  background: transparent;
  border-color: var(--page-line);
  border-radius: 20px;
  font-size: 11px;
  padding: 4px 10px;
}
.novel-reader .paper-stage {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}
.novel-reader .paper-stage:before {
  display: none;
}
.novel-reader .paper-leaf {
  font:
    18px/1.95 Georgia,
    "Songti SC",
    "SimSun",
    serif;
  letter-spacing: 0.025em;
  white-space: normal;
  padding: 12px 4px 30px;
  color: var(--page-text);
}
.paper-paragraph {
  margin: 0 0 0.8em;
  white-space: pre-wrap;
  text-indent: 2em;
  text-align: justify;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.paper-paragraph.continuation {
  text-indent: 0;
}
.paper-heading {
  font:
    650 28px/1.5 Georgia,
    "Songti SC",
    "SimSun",
    serif;
  letter-spacing: 1px;
  margin: 20px 0 40px;
  text-align: left;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.novel-reader .paper-controls {
  gap: 26px;
  min-height: 34px;
  color: var(--page-muted);
}
.novel-reader .paper-controls button {
  font-size: 20px;
  color: var(--page-muted);
  padding: 5px 16px;
}
.novel-reader .paper-controls span {
  font-size: 10px;
}
.novel-reader #paperNewPages {
  background: var(--page-bg);
  border: 1px solid var(--page-line);
  box-shadow: none;
  bottom: 40px;
  font-size: 10px;
  padding: 4px 9px;
  color: var(--page-muted);
}
.novel-reader #generationStatus {
  max-height: 32px;
  font-size: 10px;
  margin: 2px 0 0;
  color: var(--page-muted);
}
.novel-reader .novel-editor > .work-actions:last-child {
  margin-top: 4px;
  justify-content: space-between;
}
.novel-reader .novel-editor > .work-actions:last-child button {
  background: none;
  font-size: 11px;
}
.novel-reader #chapterContent {
  background: transparent;
  border-color: var(--page-line);
  font-size: 18px;
  line-height: 1.95;
  padding: 16px 4px;
}
.novel-detail .work-dialog > section {
  background: var(--page-card);
}
@media (max-width: 760px) {
  .novel-world .work-page {
    padding: 14px 22px 100px;
  }
  .novel-world .work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px 18px;
  }
  .novel-world[data-tab="square"] .work-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .novel-world[data-tab="square"] .novel-open {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 18px;
  }
  .novel-world[data-tab="square"] .novel-copy h3 {
    font-size: 18px;
  }
  .novel-world .novel-open h3 {
    font-size: 14px;
  }
  .novel-identity {
    gap: 12px;
    padding: 20px 0 27px;
  }
  .novel-identity > img {
    width: 54px;
    height: 54px;
  }
  .novel-identity strong {
    font-size: 20px;
  }
  .novel-identity p {
    font-size: 11px;
  }
  .novel-create-link {
    padding: 7px 10px;
  }
  .novel-reader .novel-editor {
    padding: 10px 23px max(8px, env(safe-area-inset-bottom));
  }
  .novel-reader .paper-leaf {
    font-size: 18px;
    padding: 10px 1px 30px;
  }
  .paper-heading {
    font-size: 25px;
    margin: 20px 0 34px;
  }
  .novel-detail-page {
    padding: 12px 16px 110px;
  }
  .book-jacket {
    padding: 24px 24px 30px;
  }
  .book-jacket > h1 {
    font-size: 24px;
  }
  .book-introduction > p {
    font-size: 16px;
  }
  .book-facts strong {
    font-size: 18px;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .novel-reader .novel-editor {
    padding: 4px max(24px, env(safe-area-inset-left));
  }
  .novel-reader .work-header {
    min-height: 28px;
    margin-bottom: 2px;
  }
  .novel-reader #editToolbar {
    margin-bottom: 2px;
  }
  .novel-reader .paper-leaf {
    font-size: 16px;
    line-height: 1.8;
    padding: 4px 8px 22px;
  }
  .paper-heading {
    font-size: 18px;
    margin: 4px 0 12px;
  }
  .novel-reader .paper-controls {
    min-height: 28px;
  }
  .novel-reader #paperNewPages {
    bottom: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .novel-world .novel-open:hover .novel-cover {
    transform: none;
  }
}

/* Compact reader: the body, rather than the toolbar, owns the viewport. */
.novel-icon svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.novel-reader .novel-editor {
  max-width: 960px;
  padding: 8px max(18px, env(safe-area-inset-left))
    max(4px, env(safe-area-inset-bottom));
}
.novel-reader .work-header {
  min-height: 38px;
  margin: 0 0 4px;
  gap: 8px;
}
.novel-reader .work-header h1 {
  flex: 1;
  min-width: 0;
  font:
    500 13px/1.5 system-ui,
    sans-serif;
}
.novel-reader .work-header .novel-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 6px;
  border: 0;
  border-radius: 50%;
  color: var(--page-text);
  background: transparent;
}
.novel-reader .work-header .novel-icon:hover {
  background: color-mix(in srgb, var(--page-text) 6%, transparent);
}
.novel-reader #generate {
  background: color-mix(in srgb, var(--page-accent) 10%, transparent);
  color: var(--page-accent);
}
.novel-reader #generate.generating {
  color: #cb5454;
}
.reader-menu-anchor {
  position: relative;
  flex: none;
}
.reader-menu {
  position: absolute;
  right: 0;
  top: 42px;
  z-index: 30;
  width: 158px;
  padding: 6px;
  background: var(--page-bg);
  border: 1px solid var(--page-line);
  border-radius: 16px;
  box-shadow: 0 8px 32px #0002;
}
.reader-menu button {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--page-text);
  text-align: left;
  font-size: 13px;
}
.reader-menu button:hover {
  background: var(--page-card);
}
.novel-reader .paper-leaf {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: var(--reader-font-size, 18px);
  line-height: 1.65;
  letter-spacing: 0;
  white-space: normal;
  padding: 4px 2px 6px;
  touch-action: pan-y;
}
.novel-reader .paper-paragraph {
  margin: 0 0 0.45em;
  tab-size: 4;
}
.novel-reader .paper-paragraph:last-child {
  margin-bottom: 0;
}
.novel-reader .paper-heading {
  font-size: 1.25em;
  line-height: 1.4;
  letter-spacing: 0;
  margin: 8px 0 18px;
}
.novel-reader .paper-controls {
  min-height: 34px;
  gap: 6px;
  display: grid;
  grid-template-columns: 40px 1fr 110px;
  width: min(100%, 310px);
  margin: 0 auto;
  text-align: center;
}
.novel-reader .paper-controls button {
  width: 40px;
  min-height: 32px;
  padding: 3px;
  border-radius: 12px;
  font-size: 22px;
  color: var(--page-text);
}
.novel-reader .paper-controls span {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.novel-reader #generationStatus:empty {
  display: none;
}
.novel-reader #generationStatus {
  max-height: 28px;
  margin: 0 0 2px;
}
.novel-reader .paper-controls #paperNext {
  justify-self: end;
  grid-column: 3;
  grid-row: 1;
}
.novel-reader .paper-controls .reader-next-chapter {
  grid-column: 3;
  grid-row: 1;
  width: auto;
  justify-self: end;
  padding: 5px 8px;
  border: 1px solid var(--page-line);
  border-radius: 20px;
  color: var(--page-accent);
  background: var(--page-bg);
  font-size: 12px;
}
.novel-reader #editTitleField {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--page-muted);
}
.novel-reader #editTitleField input {
  padding: 10px;
  font-size: 16px;
  color: var(--page-text);
  border-color: var(--page-line);
  background: transparent;
}
.novel-reader #chapterContent {
  flex: 1;
  min-height: 0;
  font-size: var(--reader-font-size, 18px);
  line-height: 1.65;
  border-radius: 12px;
  padding: 12px;
  resize: none;
}
.novel-reader #editToolbar {
  margin: 0 0 6px;
}
.novel-reader .novel-sidebar {
  width: min(86vw, 350px);
  padding: 16px;
  background: var(--page-bg);
  color: var(--page-text);
}
.chapter-sidebar-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.chapter-sidebar-heading h2 {
  margin: 0;
  font-size: 17px;
}
.chapter-sidebar-heading button {
  border: 0;
  background: transparent;
  color: var(--page-muted);
  font-size: 24px;
  width: 36px;
  height: 36px;
}
.novel-reader #addChapter {
  margin: 0 0 8px;
  width: 100%;
  padding: 9px;
  border-radius: 12px;
}
.chapter-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--page-line);
}
.novel-reader #chapterList .chapter-row button {
  border: 0;
  border-radius: 8px;
  margin: 0;
  padding: 10px 8px;
  min-height: 40px;
  background: transparent;
  color: var(--page-text);
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
}
.novel-reader #chapterList .chapter-row > button:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.novel-reader #chapterList .chapter-row button.active {
  color: var(--page-accent);
  background: color-mix(in srgb, var(--page-accent) 8%, transparent);
}
.novel-reader #chapterList .chapter-delete {
  flex: 0 0 32px;
  color: var(--page-muted);
  text-align: center;
  font-size: 19px;
}
.novel-reader .work-dialog > section {
  background: var(--page-bg);
  color: var(--page-text);
  border: 1px solid var(--page-line);
  border-radius: 22px;
}
.novel-reader .work-field {
  font-size: 13px;
  gap: 7px;
}
.novel-reader .work-field :is(input, textarea, select) {
  background: var(--page-card);
  color: var(--page-text);
  border-color: var(--page-line);
  border-radius: 10px;
}
.novel-reader .work-field textarea {
  min-height: 86px;
}
.font-panel {
  max-width: 350px !important;
}
#fontSizeRange {
  width: 100%;
  accent-color: var(--page-accent);
}
#fontPreview {
  margin: 18px 0;
  line-height: 1.65;
  height: 76px;
  display: flex;
  align-items: center;
  overflow: auto;
}
.novel-world .novel-nav {
  gap: 12px;
  padding: 8px 24px max(8px, env(safe-area-inset-bottom));
}
.novel-world .novel-nav button.novel-icon {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 16px;
}
.novel-world .novel-nav button.active {
  color: var(--page-accent);
  background: color-mix(in srgb, var(--page-accent) 10%, transparent);
}
@media (orientation: landscape) and (max-height: 500px) {
  .novel-reader .novel-editor {
    padding-top: 2px;
  }
  .novel-reader .work-header {
    min-height: 30px;
    margin-bottom: 0;
  }
  .novel-reader .work-header .novel-icon {
    width: 30px;
    height: 30px;
  }
  .novel-reader .paper-leaf {
    padding-top: 2px;
  }
  .novel-reader .paper-heading {
    margin: 2px 0 8px;
  }
  .novel-reader .paper-controls {
    min-height: 28px;
  }
}
