/* 基礎變數與主題切換 */
:root {
  --color-bg: #f5f5f7;
  --color-bg-elevated: #ffffff;
  --color-text: #1f1f23;
  --color-text-soft: #5c5c66;
  --color-accent: #2563eb;
  --color-accent-soft: rgba(37, 99, 235, 0.1);
  --color-border-subtle: #e2e2ea;
  --color-danger: #dc2626;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang TC", "Microsoft JhengHei", sans-serif;
}

[data-theme="dark"] {
  --color-bg: #050816;
  --color-bg-elevated: #0b1020;
  --color-text: #f9fafb;
  --color-text-soft: #9ca3af;
  --color-accent: #38bdf8;
  --color-accent-soft: rgba(56, 189, 248, 0.18);
  --color-border-subtle: #1f2933;
}

/* 章節頁配色見 global.css 末尾「reader-page-overrides」區塊 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.layout-root {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  font-size: 17px;
}

a {
  color: var(--color-text);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* 頂部區域 */
.site-header {
  position: relative;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 12px;
}

.site-brand {
  display: flex;
  align-items: center;
}

.site-brand__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  text-decoration: none;
}

.site-brand__logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #22d3ee);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.4);
}

.site-brand__text {
  display: flex;
  flex-direction: column;
}

.site-brand__title {
  font-size: 16px;
  font-weight: 700;
}

.site-brand__subtitle {
  font-size: 11px;
  color: var(--color-text-soft);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.site-nav__item {
  color: var(--color-text-soft);
  position: relative;
  padding-bottom: 2px;
}

.site-nav__item::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  transition: width 0.18s ease-out;
}

.site-nav__item:hover {
  color: var(--color-text);
}

.site-nav__item:hover::after {
  width: 100%;
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}

.header-search-form__field {
  flex: 1;
}

.header-search-form__input {
  width: 180px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  font-size: 13px;
  background-color: var(--color-bg-elevated);
  color: var(--color-text);
}

.header-search-form__input::placeholder {
  color: #a1a1aa;
}

.header-search-form__button {
  padding: 4px 10px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-theme {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-bg-elevated) 80%, transparent);
  cursor: pointer;
  color: var(--color-text-soft);
  font-size: 12px;
}

.btn-theme__icon {
  font-size: 14px;
}

[data-theme="light"] .btn-theme__icon--dark {
  display: none;
}

[data-theme="light"] .btn-theme__icon--light {
  display: inline-block;
}

[data-theme="dark"] .btn-theme__icon--dark {
  display: inline-block;
}

[data-theme="dark"] .btn-theme__icon--light {
  display: none;
}

.btn-theme__text {
  display: inline-block;
  font-weight: 600;
}

/* 首屏與搜尋 */
.section--hero {
  padding: 32px 0 16px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero__search {
  max-width: 720px;
}

.hero__title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}

.hero__subtitle {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--color-text-soft);
}

.hero-search-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
  max-width: 520px;
}

.hero-search-form__field {
  flex: 1;
}

.hero-search-form__input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  font-size: 15px;
  background-color: var(--color-bg-elevated);
  color: var(--color-text);
}

.hero-search-form__input::placeholder {
  color: #a1a1aa;
}

.hero-search-form__button {
  padding: 0 18px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.hero__meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-text-soft);
}

/* 主體佈局 */
.main {
  padding: 8px 0 20px;
}

.main__grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr);
  gap: 24px;
}

.main__primary {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.main__aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 卡片區域共用樣式 */
.card-block {
  background-color: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px 16px;
}

.card-block--links {
  margin-top: 22px;
}

.card-block__header {
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.card-block__title {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-block__title::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 999px;
  background: linear-gradient(180deg, #4f46e5, #06b6d4);
}

.card-block__subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-soft);
}

.search-result-summary {
  margin: 14px 0 14px;
  font-size: 18px;
  color: var(--color-text-soft);
}

.search-result-summary__keyword {
  font-weight: 700;
  color: var(--color-accent);
}

.search-result-summary__count {
  font-weight: 700;
}

.search-result-empty {
  margin: 18px 0 20px;
}

.search-result-empty__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.search-result-empty__tip {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--color-text-soft);
}

.search-result-empty__link {
  margin: 0;
  font-size: 20px;
}

.search-result-empty__link a {
  color: #2563eb;
  text-decoration: underline;
  font-weight: 700;
}

/* 精選書卡 */
.card-grid--featured {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card-grid--category {
  grid-template-columns: minmax(0, 1fr);
}

.card-grid--author {
  grid-template-columns: minmax(0, 1fr);
}

/* 作者頁：一行一本列表樣式 */
.author-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.author-list__item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
}

.author-list__item:last-child {
  border-bottom: none;
}

.author-list__cover-link {
  flex-shrink: 0;
}

.author-list__cover {
  width: 80px;
  height: 110px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.3);
}

.author-list__info {
  flex: 1;
  min-width: 0;
}

.author-list__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.author-list__meta {
  margin: 4px 0;
  font-size: 13px;
  color: var(--color-text-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.author-list__dot {
  opacity: 0.4;
}

.author-list__desc {
  margin: 4px 0 6px;
  font-size: 13px;
  color: var(--color-text-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.author-list__last {
  margin: 0;
  font-size: 13px;
}

@media (max-width: 768px) {
  .author-list__item {
    align-items: flex-start;
  }

  .author-list__cover {
    width: 70px;
    height: 96px;
  }
}

.card-grid--search {
  grid-template-columns: minmax(0, 1fr);
}

.book-card {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.book-card__cover-link {
  flex-shrink: 0;
}

.book-card__cover {
  width: 80px;
  height: 110px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.3);
}

.book-card__info {
  flex: 1;
  min-width: 0;
}

.book-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.book-card__title a {
  color: var(--color-text);
}

.book-card__meta {
  margin-top: 3px;
  font-size: 13px;
  color: var(--color-text-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.book-card__author {
  color: var(--color-text-soft);
}

.book-card__dot {
  opacity: 0.4;
}

.book-card__tag {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  font-size: 11px;
}

.book-card__status {
  font-size: 11px;
}

.book-card__desc {
  margin: 6px 0 8px;
  font-size: 13px;
  color: var(--color-text-soft);
  line-height: 1.5;
  max-height: 3em;
  overflow: hidden;
}

.search-hot {
  color: #dc2626;
  font-weight: 700;
}

.book-card__footer {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--color-text-soft);
}

.book-card__stat {
  white-space: nowrap;
}

/* 排行榜 */
.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rank-list__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
}

.rank-list__item--top .rank-list__content {
  width: 100%;
}

.rank-list__topwrap {
  display: flex;
  gap: 8px;
}

.rank-list__cover-link {
  flex-shrink: 0;
}

.rank-list__cover {
  width: 56px;
  height: 74px;
  border-radius: 6px;
  object-fit: cover;
}

.rank-list__body {
  flex: 1;
  min-width: 0;
}

.rank-list__item:last-child {
  border-bottom: none;
}

.rank-list__index {
  width: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-soft);
  margin-top: 2px;
}

.rank-list__index--hot {
  font-weight: 700;
  color: #f97316;
}

.rank-list__content {
  flex: 1;
  min-width: 0;
}

.rank-list__title {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 600;
}

.rank-list__title a {
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.rank-list__meta {
  font-size: 12px;
  color: var(--color-text-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.rank-list__author {
  color: var(--color-text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-list__dot {
  opacity: 0.4;
}

.rank-list__tag {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
}

.rank-list__status {
  white-space: nowrap;
}

/* 最新更新清單 */
.update-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.update-list__item {
  display: grid;
  grid-template-columns: 70px minmax(0, 210px) minmax(0, 240px) 110px;
  column-gap: 4px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
  font-size: 13px;
}

.update-list__item:last-child {
  border-bottom: none;
}

.update-list__category {
  color: var(--color-text-soft);
}

.update-list__book {
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.update-list__chapter {
  color: var(--color-text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.update-list__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  color: var(--color-text-soft);
}

.update-list__author {
  color: var(--color-text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.update-list__date {
  flex-shrink: 0;
  width: 38px;
  text-align: right;
}

/* 最新上架簡版清單 */
.simple-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.simple-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
  font-size: 14px;
}

.simple-list__item:last-child {
  border-bottom: none;
}

.simple-list__book {
  flex: 1;
  margin-right: 8px;
  color: var(--color-text);
}

.simple-list__meta {
  white-space: nowrap;
  color: var(--color-text-soft);
}

.simple-list__author {
  color: var(--color-text-soft);
}

.simple-list__date {
  margin-left: 4px;
}

/* 側欄卡片 */
.side-card {
  background-color: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-soft);
}

.side-card__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.side-card__text {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--color-text-soft);
  line-height: 1.6;
}

.tag-cloud {
  list-style: none;
  padding: 0;
  margin: 2px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-cloud__link {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 11px;
}

/* 分類頁右側：只看全本（置前）、分類列表 */
.category-aside__filter {
  margin-bottom: 4px;
}

.category-aside__filter .side-card__title,
.category-aside__filter .side-card__text {
  display: none;
}

.category-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.category-filter:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.category-filter__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.category-filter__checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}

/* 分類列表：簡潔列表樣式 */
.category-side-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-side-nav__item {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.category-side-nav__item:last-child {
  border-bottom: none;
}

.category-side-nav__link {
  display: block;
  padding: 10px 12px 10px 14px;
  color: var(--color-text-soft);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  margin-left: 0;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.category-side-nav__link:hover {
  color: var(--color-accent);
  background: rgba(148, 163, 184, 0.08);
}

.category-side-nav__link--active {
  color: var(--color-accent);
  font-weight: 600;
  border-left-color: var(--color-accent);
  background: var(--color-accent-soft);
}

/* 分類頁分頁 */
.category-pagination {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.category-pagination a,
.category-pagination strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.category-pagination a {
  background: transparent;
  color: var(--color-text);
}

.category-pagination a:hover {
  border-color: rgba(148, 163, 184, 0.55);
  color: var(--color-accent);
}

.category-pagination strong {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-color: transparent;
}

@media (max-width: 768px) {
  .category-pagination {
    margin-top: 14px;
    gap: 6px;
  }

  .category-pagination a,
  .category-pagination strong {
    height: 32px;
    min-width: 34px;
    padding: 0 10px;
    font-size: 13px;
  }
}

/* 關於/隱私/使用提示頁 */
.legal-page .card-block__subtitle {
  max-width: 56ch;
}

.legal-content h2 {
  margin: 16px 0 8px;
  font-size: 16px;
  font-weight: 800;
}

.legal-content p {
  margin: 8px 0;
  color: var(--color-text);
  line-height: 1.75;
}

.legal-content ul {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.8;
  color: var(--color-text);
}

.legal-content li + li {
  margin-top: 6px;
}

.legal-note {
  margin-top: 12px;
  color: var(--color-text-soft);
  font-size: 14px;
}

.bullet-list {
  list-style: disc;
  padding-left: 18px;
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--color-text-soft);
}

.bullet-list li + li {
  margin-top: 3px;
}

.friend-links {
  margin-top: 4px;
  font-size: 13px;
}

.friend-links a {
  margin-right: 6px;
  display: inline-block;
  margin-bottom: 4px;
}

/* 排行榜 Tab */
.rank-tabs {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  margin-bottom: 8px;
}

.rank-tabs__btn {
  border: none;
  background: transparent;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--color-text-soft);
  cursor: pointer;
}

.rank-tabs__btn--active {
  background: #fff;
  color: var(--color-accent);
}

/* 主題專欄 */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.theme-tile {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-bg-elevated) 80%, var(--color-accent-soft) 20%);
  color: var(--color-text);
}

.theme-tile__title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.theme-tile__text {
  font-size: 12px;
  color: var(--color-text-soft);
  line-height: 1.5;
}

/* =========
   信息頁佈局
   ========= */
.info-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr);
  gap: 24px;
}

.info-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-header {
  display: flex;
  gap: 20px;
  padding: 4px 0 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.info-cover__img {
  width: 160px;
  height: 220px;
  min-width: 160px;
  min-height: 220px;
  max-width: 160px;
  max-height: 220px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.22);
}

.info-meta {
  flex: 1;
  min-width: 0;
  min-height: 220px;
  display: block;
}

.info-title {
  margin: 0 0 clamp(8px, 0.9vw, 14px);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
  padding-bottom: 0;
}

.info-meta__row {
  font-size: 14px;
  color: var(--color-text-soft);
  margin-bottom: clamp(6px, 0.7vw, 12px);
  line-height: 1.65;
}

.info-meta__row a {
  color: inherit;
  font-weight: 600;
}

.info-meta__stats span + span::before {
  content: "·";
  margin: 0 4px;
  color: var(--color-text-soft);
}

.info-meta__last {
  margin-top: clamp(2px, 0.3vw, 6px);
}

@media (min-width: 769px) {
  .info-header {
    align-items: flex-start;
  }

  .info-cover {
    flex: 0 0 160px;
    width: 160px;
  }
}

.info-meta__time {
  margin-left: 6px;
  font-size: 12px;
  color: var(--color-text-soft);
}

/* =========
   章節閱讀頁
   ========= */
.reader-layout {
  max-width: 840px;
  margin: 0 auto;
}

.reader-header {
  padding: 18px 0 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.reader-header__title {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  color: var(--color-text);
  line-height: 1.35;
  word-break: break-word;
}

.reader-header__sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-text-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.reader-header__author a {
  font-weight: 600;
}

.reader-header__controls {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.reader-header__font {
  display: inline-flex;
  gap: 6px;
}

.reader-font-btn {
  min-width: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-elevated);
  font-size: 12px;
  cursor: pointer;
}

.reader-header__bg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.reader-bg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 48px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.38);
  background: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}

.reader-bg-btn__label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: #374151;
  pointer-events: none;
}

.reader-bg-btn.is-active {
  border-color: rgba(100, 116, 139, 0.55);
}

.reader-bg-btn.is-active::after {
  content: "✓";
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #059669;
}

[data-theme="dark"] .reader-bg-btn {
  border-color: rgba(148, 163, 184, 0.42);
}

[data-theme="dark"] .reader-bg-btn__label {
  color: #e2e8f0;
}

[data-theme="dark"] .reader-bg-btn.is-active {
  border-color: rgba(148, 163, 184, 0.58);
}

[data-theme="dark"] .reader-bg-btn.is-active::after {
  color: #6ee7b7;
}

.reader-bg-btn[data-bg="default"] {
  background: #ffffff;
}

.reader-bg-btn[data-bg="warm"] {
  background: #fdf8ef;
}

.reader-bg-btn[data-bg="green"] {
  background: #f2faf4;
}

[data-theme="dark"] .reader-bg-btn[data-bg="default"] {
  background: #0b1020;
}

[data-theme="dark"] .reader-bg-btn[data-bg="warm"] {
  background: #2a2620;
}

[data-theme="dark"] .reader-bg-btn[data-bg="green"] {
  background: #1a221c;
}

.reader-header__nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
}

.reader-nav-link {
  flex: 1 1 0;
  padding: 10px 0;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  font-size: 15px;
  text-align: center;
}

.reader-nav-link--disabled {
  opacity: 0.55;
  cursor: default;
}

.reader-content {
  margin-top: 18px;
  padding: 14px 0 10px;
  font-size: 18px;
  line-height: 1.8;
}

.reader-content p {
  margin: 0 0 10px;
  text-indent: 2em;
}

/* 章節頁廣告溫馨提示（檢舉下方、正文前） */
.reader-content__ad-tip {
  margin: 0 0 14px;
  padding: 0 8px 6px;
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
  text-indent: 0;
  color: var(--color-text-soft, #5c5c66);
}

.reader-footer-nav {
  margin: 4px 0 12px;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
}

.reader-recommend {
  margin-top: 10px;
}

/* 讓章節頁「猜你喜歡」更貼合正文風格：去掉卡片底色與陰影 */
.reader-layout .reader-recommend.card-block {
  background-color: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 14px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}

/* PC 章節頁結構（配色變量見文件末尾 reader-page-overrides） */
@media (min-width: 769px) {
  body.page-reader {
    --reader-pc-column-width: 960px;
    --reader-pc-radius: 10px;
  }

  body.page-reader .container.reader-layout {
    max-width: var(--reader-pc-column-width);
    margin: 12px auto 16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: var(--reader-pc-radius);
    overflow: hidden;
  }
}

/* 章節檢舉彈窗（適配日/夜模式） */
.report-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
}

.report-modal__panel {
  max-width: 480px;
  margin: 10% auto;
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border-subtle);
}

.report-modal__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text);
}

.report-modal__hint {
  font-size: 14px;
  color: var(--color-text-soft);
  margin-bottom: 10px;
}

.report-modal__label {
  display: block;
  margin: 6px 0;
  color: var(--color-text);
  cursor: pointer;
}

.report-modal__textarea {
  width: 100%;
  height: 84px;
  margin-top: 8px;
  resize: vertical;
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
  padding: 8px;
  font-size: 14px;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  box-sizing: border-box;
}

.report-modal__textarea::placeholder {
  color: var(--color-text-soft);
}

.report-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.report-modal__btn-cancel {
  padding: 8px 12px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
  background: var(--color-bg-elevated);
  color: var(--color-text);
  cursor: pointer;
}

.report-modal__btn-confirm {
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: #e60000;
  color: #fff;
  cursor: pointer;
  opacity: 0.9;
}

.report-modal__btn-confirm:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* =========
   歷史閱讀頁
   ========= */
.recent-layout {
  max-width: 980px;
  margin: 0 auto;
}

.recent-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.recent-clear-btn {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(220, 38, 38, 0.7);
  background: rgba(248, 113, 113, 0.1);
  color: #b91c1c;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

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

.recent-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.4);
}

.recent-item__cover-link {
  flex-shrink: 0;
}

.recent-item__cover {
  width: 72px;
  height: 100px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.25);
}

.recent-item__body {
  flex: 1;
  min-width: 0;
}

.recent-item__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.recent-item__title a {
  color: var(--color-text);
}

.recent-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: var(--color-text-soft);
}

.recent-item__author {
  font-weight: 600;
}

.recent-item__dot {
  opacity: 0.5;
}

.recent-item__chapter {
  margin-top: 4px;
  font-size: 13px;
}

.recent-item__chapter a {
  color: var(--color-accent);
}

.recent-item__actions {
  margin-top: 6px;
  display: flex;
  gap: 14px;
  font-size: 12px;
}

.recent-item__link {
  color: var(--color-accent);
}

.recent-item__remove {
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(220, 38, 38, 0.7);
  background: rgba(248, 113, 113, 0.1);
  color: #b91c1c;
  cursor: pointer;
}

.recent-empty {
  padding: 32px 0;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-soft);
}

@media (max-width: 768px) {
  .recent-layout {
    max-width: 100%;
  }

  .recent-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .recent-layout > .card-block {
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .recent-item {
    padding: 6px 0;
  }

  .recent-item__cover {
    width: 56px;
    height: 80px;
  }
}
@media (max-width: 768px) {
  .reader-layout {
    max-width: 100%;
  }

  .reader-header__title {
    font-size: 16px;
  }

  .reader-content {
    font-size: 15px;
  }
}

.info-actions {
  margin-top: 10px;
  padding-top: 0;
  display: flex;
  gap: 10px;
}

.info-actions__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  border: 1px solid var(--color-border-subtle);
  background-color: var(--color-bg-elevated);
  color: var(--color-text);
}

.info-actions__btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
}

.info-actions__btn--primary:hover {
  color: #fff;
  filter: brightness(1.08);
}

.info-tabs {
  list-style: none;
  padding: 0;
  margin: 18px 0 10px;
  display: flex;
  gap: 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.info-tabs li {
  padding: 0 0 10px;
  font-size: 17px;
}

.info-tabs li a {
  color: var(--color-text-soft);
  font-weight: 600;
}

.info-tabs li a:hover {
  color: var(--color-text);
}

.info-tabs li.act a {
  color: var(--color-text);
  font-weight: 700;
}

.info-tabs li.act {
  padding-left: 8px;
  padding-right: 8px;
  margin-left: -8px;
  margin-right: -8px;
  border-bottom: 3px solid var(--color-accent);
}

/* 評論樣式（沿用 modern 風格） */
.pt-comment-section {
  margin-top: 12px;
  padding-top: 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.pt-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pt-comment-title {
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pt-comment-title::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 999px;
  background: linear-gradient(180deg, #4f46e5, #06b6d4);
}

.pt-comment-link {
  font-size: 13px;
  color: var(--color-accent);
}

.pt-comment-total {
  font-size: 13px;
  color: var(--color-text-soft);
}

.pt-comment-list {
  margin-bottom: 10px;
}

.pt-comment-item {
  padding: 10px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
}

.pt-comment-item__meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-soft);
  margin-bottom: 4px;
}

.pt-comment-item__user {
  font-weight: 600;
}

.pt-comment-item__content {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.6;
}

.pt-comment-empty {
  font-size: 14px;
  color: var(--color-text-soft);
  padding: 8px 0;
}

.pt-comment-form {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.pt-comment-form__title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.pt-comment-form__title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.1em;
  margin-right: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #4f46e5, #06b6d4);
  vertical-align: middle;
}

.pt-comment-field {
  margin-bottom: 8px;
}

.pt-comment-input,
.pt-comment-textarea {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--color-border-subtle);
  font-size: 14px;
  font-family: var(--font-sans);
  box-sizing: border-box;
}

.pt-comment-textarea {
  resize: vertical;
  min-height: 70px;
}

.pt-comment-count {
  font-size: 12px;
  color: var(--color-text-soft);
  margin-top: 2px;
  text-align: right;
}

.pt-comment-actions {
  margin-top: 4px;
}

/* 評論列表頁：書籍資訊區 */
.commentlist-book {
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.commentlist-book__cover-link {
  flex-shrink: 0;
}

.commentlist-book__cover {
  width: 80px;
  height: 110px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
}

.commentlist-book__info {
  flex: 1;
  min-width: 0;
}

.commentlist-book__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
}

.commentlist-book__title a {
  color: var(--color-text);
}

.commentlist-book__meta {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--color-text-soft);
}

.commentlist-book__dot {
  opacity: 0.5;
  margin: 0 4px;
}

.commentlist-book__btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-elevated);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.commentlist-book__btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.commentlist-pagination {
  margin-top: 16px;
}

@media (max-width: 768px) {
  .commentlist-book {
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .commentlist-book__cover {
    width: 70px;
    height: 96px;
  }
}

.pt-comment-submit {
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.info-intro {
  margin-top: 22px;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  padding-top: 16px;
}

.info-section-title {
  margin: 0 0 0;
  font-size: 16px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.info-section-title::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 999px;
  background: linear-gradient(180deg, #4f46e5, #06b6d4);
}

.info-intro__content {
  font-size: 14px;
  color: var(--color-text-soft);
  line-height: 1.6;
}

.info-intro__content p {
  margin: 0 0 6px;
}

.info-intro__content p:last-child {
  margin-bottom: 0;
}

.info-intro__content--expanded {
  max-height: none !important;
}

.info-intro__toggle {
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-elevated);
  color: var(--color-text-soft);
  font-size: 13px;
  cursor: pointer;
}

.info-chapter-list {
  font-size: 15px;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  padding-top: 16px;
}

.info-chapter-list--latest {
  margin-top: 18px;
}

.info-chapter-list__inner {
  margin-top: 4px;
}

.info-chapter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
}

.info-chapter a {
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.info-chapter--volume {
  font-weight: 700;
  color: var(--color-text-soft);
  padding: 8px 0 4px;
}

.info-recommend {
  margin-top: 18px;
}

/* 目錄頁懸浮上下導航 */
.catalog-float-nav {
  position: fixed;
  right: 16px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 40;
}

.catalog-float-nav__btn {
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  background-color: color-mix(in srgb, var(--color-bg-elevated) 92%, var(--color-accent-soft) 8%);
  color: var(--color-text);
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.catalog-float-nav__btn--top {
  order: 0;
}

.catalog-float-nav__btn--bottom {
  order: 1;
}

.catalog-float-nav__icon {
  display: block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
}

.catalog-float-nav__icon--up {
  border-bottom: 9px solid var(--color-text);
}

.catalog-float-nav__icon--down {
  border-top: 9px solid var(--color-text);
}

@media (max-width: 768px) {
  .catalog-float-nav {
    right: 10px;
    bottom: 70px;
  }

  .catalog-float-nav__btn {
    min-width: 36px;
    height: 36px;
    font-size: 14px;
  }
}

.info-chapter__more {
  margin-top: 8px;
  font-size: 14px;
}

.info-chapter__more a {
  color: var(--color-accent);
}

@media (max-width: 960px) {
  .info-layout {
    grid-template-columns: minmax(0, 1.9fr) minmax(0, 1.1fr);
  }
}

@media (max-width: 768px) {
  .info-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .info-meta {
    width: 100%;
    text-align: left;
    min-height: auto;
    display: block;
  }
}

@media (max-width: 768px) {
  /* 手機端信息頁：弱化整體卡片框感，更貼背景 */
  .main {
    padding-top: 4px;
  }

  .card-block.info-page {
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
  }
}

/* 頁腳 */
.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  padding: 14px 0 20px;
  margin-top: 8px;
  background: color-mix(in srgb, var(--color-bg-elevated) 92%, transparent);
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-soft);
}

.site-footer__right a {
  margin-left: 10px;
  color: var(--color-text-soft);
}

/* 響應式處理 */
@media (max-width: 960px) {
  .main__grid {
    grid-template-columns: minmax(0, 1.9fr) minmax(0, 1.1fr);
  }

  .update-list__item {
    grid-template-columns: auto minmax(0, 2.6fr) minmax(0, 2.2fr);
  }

  .update-list__meta {
    display: none;
  }
}

@media (max-width: 768px) {
  .site-header__inner {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .site-actions {
    order: 4;
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .header-search-form {
    order: 1;
    width: 100%;
    margin: 6px 0 4px;
  }

  .header-search-form__input {
    width: 100%;
  }

  /* 手機端：日間／夜間切換固定在右上角，提示更明顯 */
  #themeToggle {
    position: absolute;
    top: 8px;
    right: 16px;
    padding-inline: 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: color-mix(in srgb, var(--color-bg-elevated) 90%, var(--color-accent-soft) 10%);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
  }

  #themeToggle .btn-theme__text {
    font-size: 13px;
    font-weight: 600;
  }

  .section--hero {
    padding-top: 18px;
  }

  .hero__title {
    font-size: 20px;
  }

  .main__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer__inner {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  /* 手機端首頁：弱化大卡片框感，更貼背景 */
  .main__primary > .card-block {
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .main__aside > .side-card {
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
  }

  /* 分類頁手機端：分類區收合，點擊「選擇分類」展開 */
  .category-page .main__grid {
    display: flex;
    flex-direction: column;
  }

  .category-page .main__aside {
    order: 1;
  }

  .category-page .main__primary {
    order: 2;
  }

  .category-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 0;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: var(--radius-md);
    background: var(--color-bg-elevated);
    color: var(--color-text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
  }

  .category-menu-toggle__icon {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 12px;
  }

  .main__aside.category-aside--open .category-menu-toggle__icon {
    transform: rotate(180deg);
  }

  .category-aside__panel {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
  }

  .main__aside.category-aside--open .category-aside__panel {
    max-height: 75vh;
  }

  .main__aside.category-aside--open .category-aside__panel {
    overflow-y: auto;
  }
}

@media (min-width: 769px) {
  .category-menu-toggle {
    display: none;
  }
}

@media (max-width: 768px) {
  /* 手機端搜索結果頁：去掉外層大白框 */
  .main > .container > .card-block {
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 480px) {
  .hero-search-form {
    flex-direction: column;
  }

  .hero-search-form__button {
    width: 100%;
    padding: 9px 16px;
  }

  .update-list__item {
    grid-template-columns: auto minmax(0, 2fr);
  }

  .update-list__chapter {
    display: none;
  }
}

@media (max-width: 768px) {
  /* 手機端首頁：避免上下兩個搜索框擠在一起 */
  .page-home .header-search-form {
    display: none;
  }
}

/* ========= reader-page-overrides（章節頁專用，置於文件末尾避免被全站樣式覆蓋） ========= */

html[data-reader-palette="light-default"] body.layout-root.page-reader {
  --reader-page-bg: #f5f5f7;
  --reader-outer-bg: #e0e0e0;
  --reader-inner-bg: #ffffff;
  --reader-btn-bg: #f3f4f6;
  --reader-btn-border: #cbd5e1;
  --reader-edge-border: rgba(0, 0, 0, 0.08);
}

html[data-reader-palette="light-warm"] body.layout-root.page-reader {
  --reader-page-bg: #ddd5c8;
  --reader-outer-bg: #ddd5c8;
  --reader-inner-bg: #fdf8ef;
  --reader-btn-bg: #f5ecd8;
  --reader-btn-border: #c9bba8;
  --reader-edge-border: rgba(120, 100, 60, 0.12);
}

html[data-reader-palette="light-green"] body.layout-root.page-reader {
  --reader-page-bg: #ccdace;
  --reader-outer-bg: #ccdace;
  --reader-inner-bg: #f2faf4;
  --reader-btn-bg: #dceee2;
  --reader-btn-border: #a8c4b0;
  --reader-edge-border: rgba(60, 100, 70, 0.12);
}

html[data-reader-palette="dark-default"] body.layout-root.page-reader {
  --reader-page-bg: #050816;
  --reader-outer-bg: #050816;
  --reader-inner-bg: #0b1020;
  --reader-btn-bg: #1e2a42;
  --reader-btn-border: #3d5270;
  --reader-edge-border: rgba(255, 255, 255, 0.1);
}

html[data-reader-palette="dark-warm"] body.layout-root.page-reader {
  --reader-page-bg: #12100c;
  --reader-outer-bg: #12100c;
  --reader-inner-bg: #2a2620;
  --reader-btn-bg: #443d35;
  --reader-btn-border: rgba(255, 240, 200, 0.38);
  --reader-edge-border: rgba(255, 240, 200, 0.14);
}

html[data-reader-palette="dark-green"] body.layout-root.page-reader {
  --reader-page-bg: #0c100e;
  --reader-outer-bg: #0c100e;
  --reader-inner-bg: #1a221c;
  --reader-btn-bg: #2a3830;
  --reader-btn-border: rgba(200, 230, 210, 0.38);
  --reader-edge-border: rgba(200, 230, 210, 0.14);
}

html[data-reader-palette] body.layout-root.page-reader {
  background-color: var(--reader-page-bg);
}

html[data-reader-palette] body.page-reader .main,
html[data-reader-palette] body.page-reader .site-footer {
  background-color: var(--reader-page-bg);
}

html[data-reader-palette] body.page-reader .container.reader-layout {
  background-color: var(--reader-inner-bg);
  border: 1px solid var(--reader-edge-border);
}

html[data-reader-palette] body.page-reader .reader-content,
html[data-reader-palette] body.page-reader #article {
  background-color: transparent;
}

html[data-reader-palette] body.page-reader .site-header {
  background: color-mix(in srgb, var(--reader-page-bg) 85%, transparent);
}

html[data-reader-palette] body.page-reader .reader-font-btn,
html[data-reader-palette] body.page-reader .reader-nav-link {
  background-color: var(--reader-btn-bg);
  border-color: var(--reader-btn-border);
  color: var(--color-text);
}

html[data-reader-palette] body.page-reader .reader-font-btn {
  font-weight: 600;
}

@media (min-width: 769px) {
  html[data-reader-palette] body.layout-root.page-reader,
  html[data-reader-palette] body.page-reader .main,
  html[data-reader-palette] body.page-reader .site-footer {
    background-color: var(--reader-outer-bg);
  }

  html[data-reader-palette] body.page-reader .site-header {
    background: color-mix(in srgb, var(--reader-outer-bg) 85%, transparent);
  }
}

