/* ==========================================================================
   天涯书阁 (藏书阁) - 殿堂级文学典藏门户专属排版样式表
   版本：20261027-Masterpiece-v4
   ========================================================================== */

/* 全局容器与文学字体栈 */
.tianya-book-page {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--routine, #333333);
}

.tianya-book-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

/* 文学宋体/楷体专用类 */
.tianya-serif {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", "STSong", "STKaiti", serif !important;
}

/* ==========================================================================
   1. 宏大文渊阁视界 (Hero Literary Pavilion)
   ========================================================================== */
.tianya-hero-pavilion {
  position: relative;
  border-radius: 16px;
  margin-top: 18px;
  margin-bottom: 30px;
  padding: 42px 36px 36px;
  background: radial-gradient(circle at 85% 15%, rgba(212, 175, 55, 0.15) 0%, transparent 40%),
              radial-gradient(circle at 10% 85%, rgba(0, 184, 148, 0.12) 0%, transparent 45%),
              linear-gradient(135deg, #131720 0%, #1a2230 50%, #111620 100%);
  border: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  color: #f3f4f6;
}

.tianya-hero-pavilion::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #d4af37 30%, #f9e79f 50%, #d4af37 70%, transparent);
}

.tianya-hero-pavilion::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
}

.tianya-hero-watermark {
  position: absolute;
  right: 20px;
  bottom: -20px;
  font-size: 150px;
  line-height: 1;
  font-family: "STKaiti", "KaiTi", serif;
  color: rgba(255, 255, 255, 0.025);
  user-select: none;
  pointer-events: none;
  font-weight: bold;
}

.tianya-hero-badge-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.tianya-seal-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px;
  background: rgba(192, 57, 43, 0.2);
  border: 1px solid rgba(231, 76, 60, 0.6);
  border-radius: 4px;
  color: #ff7675;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.tianya-seal-tag::before {
  content: "✦";
  color: #d4af37;
}

.tianya-hero-title {
  margin: 0 0 12px 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.tianya-hero-title span.gold-text {
  background: linear-gradient(135deg, #f9e79f 0%, #d4af37 50%, #aa7c11 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tianya-hero-couplet {
  font-size: 16px;
  color: #c7cbd3;
  line-height: 1.8;
  margin-bottom: 24px;
  letter-spacing: 0.8px;
}

.tianya-hero-couplet em {
  font-style: normal;
  color: #f1c40f;
  margin: 0 4px;
}

/* 经纬检索框 */
.tianya-hero-search-wrap {
  max-width: 680px;
  position: relative;
  margin-bottom: 28px;
}

.tianya-hero-search-input {
  width: 100%;
  height: 50px;
  padding: 0 110px 0 48px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 25px;
  color: #ffffff;
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.tianya-hero-search-input:focus {
  background: rgba(255, 255, 255, 0.14);
  border-color: #f1c40f;
  box-shadow: 0 4px 24px rgba(212, 175, 55, 0.3);
}

.tianya-hero-search-input::placeholder {
  color: #9aa1ae;
}

.tianya-hero-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #d4af37;
  pointer-events: none;
}

.tianya-hero-search-btn {
  position: absolute;
  right: 5px;
  top: 5px;
  bottom: 5px;
  padding: 0 20px;
  background: linear-gradient(135deg, #d4af37, #aa7c11);
  color: #ffffff;
  border: none;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tianya-hero-search-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.5);
}

/* 4 大文学典藏指标 */
.tianya-hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.tianya-metric-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 10px;
  transition: transform 0.25s ease, background 0.25s ease;
}

.tianya-metric-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 175, 55, 0.3);
}

.tianya-metric-icon {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.12);
  color: #f1c40f;
}

.tianya-metric-info {
  display: flex;
  flex-direction: column;
}

.tianya-metric-info .label {
  font-size: 12px;
  color: #9aa1ae;
}

.tianya-metric-info .value {
  font-size: 14px;
  font-weight: 700;
  color: #f9e79f;
}

/* ==========================================================================
   2. 殿堂重器 · 镇阁名著首席展台 (3 大名作 Spotlight)
   ========================================================================== */
.tianya-spotlight-section {
  margin-bottom: 34px;
}

.tianya-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

html[data-theme='dark'] .tianya-section-header,
body.dark .tianya-section-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.tianya-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tianya-section-icon {
  font-size: 24px;
}

.tianya-section-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--main, #2c3e50);
}

.tianya-section-subtitle {
  font-size: 13.5px;
  color: var(--minor, #888888);
  font-weight: 400;
  margin-left: 6px;
}

.tianya-section-badge {
  font-size: 12px;
  padding: 4px 12px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #aa7c11;
  font-weight: 700;
  border-radius: 20px;
}

html[data-theme='dark'] .tianya-section-badge,
body.dark .tianya-section-badge {
  color: #f1c40f;
  background: rgba(212, 175, 55, 0.2);
}

.tianya-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.tianya-spotlight-card {
  background: var(--background, #ffffff);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html[data-theme='dark'] .tianya-spotlight-card,
body.dark .tianya-spotlight-card {
  background: var(--background, #202124);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.tianya-spotlight-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(212, 175, 55, 0.16);
  border-color: rgba(212, 175, 55, 0.45);
}

.tianya-spotlight-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #d4af37, #f9e79f, #aa7c11);
}

.tianya-book-3d-wrap {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.tianya-book-3d {
  width: 105px;
  height: 146px;
  flex-shrink: 0;
  position: relative;
  perspective: 1000px;
}

.tianya-book-3d-cover {
  width: 100%;
  height: 100%;
  border-radius: 4px 8px 8px 4px;
  overflow: hidden;
  position: relative;
  box-shadow: -4px 6px 14px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.15);
  transform: rotateY(-8deg);
  transform-origin: left center;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  background: #2d3436;
}

.tianya-spotlight-card:hover .tianya-book-3d-cover {
  transform: rotateY(0deg) scale(1.05);
  box-shadow: -2px 8px 20px rgba(0, 0, 0, 0.35);
}

.tianya-book-3d-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tianya-book-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
}

.tianya-book-ribbon {
  position: absolute;
  top: -4px;
  right: 12px;
  width: 14px;
  height: 26px;
  background: linear-gradient(180deg, #e74c3c, #c0392b);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
  z-index: 5;
}

.tianya-spotlight-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tianya-spotlight-seal {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  color: #c0392b;
  border: 1px solid #c0392b;
  border-radius: 3px;
  padding: 1px 6px;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

html[data-theme='dark'] .tianya-spotlight-seal,
body.dark .tianya-spotlight-seal {
  color: #ff7675;
  border-color: #ff7675;
}

.tianya-spotlight-title {
  margin: 0 0 6px 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.tianya-spotlight-title a {
  color: var(--main, #2c3e50);
  text-decoration: none;
  transition: color 0.2s;
}

.tianya-spotlight-title a:hover {
  color: #d4af37;
}

.tianya-spotlight-author {
  font-size: 13px;
  color: var(--minor, #666666);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tianya-spotlight-author b {
  color: #d4af37;
}

.tianya-spotlight-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tianya-spotlight-tag {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.04);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--minor, #777);
}

html[data-theme='dark'] .tianya-spotlight-tag,
body.dark .tianya-spotlight-tag {
  background: rgba(255, 255, 255, 0.08);
  color: #aaa;
}

.tianya-spotlight-excerpt {
  font-size: 13px;
  color: var(--minor, #666666);
  line-height: 1.65;
  background: rgba(0, 0, 0, 0.02);
  border-left: 3px solid #d4af37;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-style: italic;
}

html[data-theme='dark'] .tianya-spotlight-excerpt,
body.dark .tianya-spotlight-excerpt {
  background: rgba(255, 255, 255, 0.03);
}

.tianya-spotlight-actions {
  display: flex;
  gap: 10px;
}

.tianya-btn-gold {
  flex: 1;
  text-align: center;
  padding: 8px 14px;
  background: linear-gradient(135deg, #d4af37, #aa7c11);
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.tianya-btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.45);
}

.tianya-btn-ghost {
  flex: 1;
  text-align: center;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #aa7c11 !important;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.25s ease;
}

html[data-theme='dark'] .tianya-btn-ghost,
body.dark .tianya-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: #f1c40f !important;
  border-color: rgba(241, 196, 15, 0.35);
}

.tianya-btn-ghost:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: #d4af37;
}

/* ==========================================================================
   3. 双璧生辉架构 (左侧典藏书廊 + 右侧金榜热度)
   ========================================================================== */
.tianya-main-layout {
  display: flex;
  gap: 24px;
  margin-bottom: 34px;
}

.tianya-gallery-col {
  flex: 1;
  min-width: 0;
}

.tianya-rank-col {
  width: 330px;
  flex-shrink: 0;
}

.tianya-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.tianya-gallery-card {
  background: var(--background, #ffffff);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

html[data-theme='dark'] .tianya-gallery-card,
body.dark .tianya-gallery-card {
  background: var(--background, #202124);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.tianya-gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  border-color: rgba(212, 175, 55, 0.4);
}

.tianya-gallery-cover-wrap {
  width: 100%;
  height: 190px;
  position: relative;
  margin-bottom: 12px;
  perspective: 800px;
}

.tianya-gallery-cover {
  width: 100%;
  height: 100%;
  border-radius: 4px 8px 8px 4px;
  overflow: hidden;
  box-shadow: -3px 5px 12px rgba(0, 0, 0, 0.25);
  transform: rotateY(-6deg);
  transform-origin: left center;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  background: #f0f2f5;
  display: block;
}

.tianya-gallery-card:hover .tianya-gallery-cover {
  transform: rotateY(0deg) scale(1.04);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.tianya-gallery-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tianya-gallery-cover::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0%, rgba(0, 0, 0, 0.35) 100%);
  z-index: 2;
}

.tianya-gallery-status {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #f1c40f;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 3;
}

.tianya-gallery-title {
  margin: 0 0 6px 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
  height: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tianya-gallery-title a {
  color: var(--main, #2c3e50);
  text-decoration: none;
  transition: color 0.2s;
}

.tianya-gallery-title a:hover {
  color: #d4af37;
}

.tianya-gallery-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--minor, #888888);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.06);
}

html[data-theme='dark'] .tianya-gallery-meta,
body.dark .tianya-gallery-meta {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.tianya-gallery-author {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.tianya-gallery-heat {
  color: #e67e22;
  font-weight: 600;
  font-size: 11px;
}

/* ==========================================================================
   4. 右侧文华风云榜 (科举金榜尊荣榜单)
   ========================================================================== */
.tianya-rank-card {
  background: var(--background, #ffffff);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 80px;
}

html[data-theme='dark'] .tianya-rank-card,
body.dark .tianya-rank-card {
  background: var(--background, #202124);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.tianya-rank-title-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 2px solid #d4af37;
}

.tianya-rank-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--main, #2c3e50);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tianya-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tianya-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.tianya-rank-item:hover {
  background: rgba(212, 175, 55, 0.08);
  transform: translateX(4px);
}

.tianya-rank-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  font-family: "STSong", "SimSun", serif;
  background: rgba(0, 0, 0, 0.05);
  color: var(--minor, #888);
  flex-shrink: 0;
}

html[data-theme='dark'] .tianya-rank-num,
body.dark .tianya-rank-num {
  background: rgba(255, 255, 255, 0.08);
}

.tianya-rank-num.num-1 {
  background: linear-gradient(135deg, #f1c40f, #e67e22);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(230, 126, 34, 0.4);
}

.tianya-rank-num.num-2 {
  background: linear-gradient(135deg, #bdc3c7, #7f8c8d);
  color: #ffffff;
}

.tianya-rank-num.num-3 {
  background: linear-gradient(135deg, #e17055, #d63031);
  color: #ffffff;
}

.tianya-rank-book-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tianya-rank-book-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tianya-rank-book-name a {
  color: var(--main, #2c3e50);
  text-decoration: none;
  transition: color 0.2s;
}

.tianya-rank-book-name a:hover {
  color: #d4af37;
}

.tianya-rank-book-author {
  font-size: 11.5px;
  color: var(--minor, #999999);
}

.tianya-rank-views {
  font-size: 11px;
  color: #e67e22;
  font-weight: 600;
  white-space: nowrap;
}

/* ==========================================================================
   5. 广厦万卷 · 藏书总名录 (全新微卡格律排版 - 彻底修复排版错位)
   ========================================================================== */
.tianya-archive-shelf {
  background: var(--background, #ffffff);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  padding: 26px 28px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  margin-bottom: 34px;
}

html[data-theme='dark'] .tianya-archive-shelf,
body.dark .tianya-archive-shelf {
  background: var(--background, #202124);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* 3 列典藏微卡书架网格 */
.tianya-shelf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tianya-shelf-card {
  background: rgba(0, 0, 0, 0.015);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

html[data-theme='dark'] .tianya-shelf-card,
body.dark .tianya-shelf-card {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.06);
}

.tianya-shelf-card:hover {
  background: var(--background, #ffffff);
  border-color: rgba(212, 175, 55, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.12);
}

html[data-theme='dark'] .tianya-shelf-card:hover,
body.dark .tianya-shelf-card:hover {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* 左侧 3D 微缩图书封面 */
.tianya-shelf-thumb-wrap {
  width: 52px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 3px 5px 5px 3px;
  overflow: hidden;
  position: relative;
  box-shadow: -2px 3px 8px rgba(0, 0, 0, 0.22);
  background: #2d3436;
  display: block;
}

.tianya-shelf-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.tianya-shelf-card:hover .tianya-shelf-thumb-wrap img {
  transform: scale(1.08);
}

.tianya-shelf-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
}

/* 右侧书籍结构化数据 */
.tianya-shelf-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tianya-shelf-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tianya-shelf-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.tianya-shelf-title a {
  color: var(--main, #2c3e50);
  text-decoration: none;
  transition: color 0.2s;
}

.tianya-shelf-title a:hover {
  color: #d4af37;
}

.tianya-shelf-status-tag {
  font-size: 10px;
  font-weight: 700;
  color: #27ae60;
  background: rgba(39, 174, 96, 0.1);
  border: 1px solid rgba(39, 174, 96, 0.25);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tianya-shelf-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--minor, #888888);
}

.tianya-shelf-author {
  color: var(--routine, #666666);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.tianya-shelf-size {
  color: #e67e22;
  font-weight: 600;
  white-space: nowrap;
}

.tianya-shelf-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.tianya-shelf-read-btn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--routine, #555555) !important;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

html[data-theme='dark'] .tianya-shelf-read-btn,
body.dark .tianya-shelf-read-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cccccc !important;
}

.tianya-shelf-read-btn:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: #d4af37;
  color: #d4af37 !important;
}

.tianya-shelf-dl-btn {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 4px;
  background: linear-gradient(135deg, #d4af37, #aa7c11);
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
  white-space: nowrap;
}

.tianya-shelf-dl-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.4);
}

/* ==========================================================================
   6. 单本小说详情页专属美化样式 (Book Post Detail)
   ========================================================================== */
.tianya-book-detail-box {
  background: var(--background, #ffffff);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
  margin-bottom: 24px;
}

html[data-theme='dark'] .tianya-book-detail-box,
body.dark .tianya-book-detail-box {
  background: var(--background, #202124);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.tianya-book-breadcrumb {
  font-size: 13px;
  color: var(--minor, #888888);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

html[data-theme='dark'] .tianya-book-breadcrumb,
body.dark .tianya-book-breadcrumb {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.tianya-book-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.tianya-book-breadcrumb a:hover {
  color: #d4af37;
}

.tianya-book-detail-main {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.tianya-book-detail-cover {
  width: 170px;
  height: 236px;
  flex-shrink: 0;
  border-radius: 6px 10px 10px 6px;
  overflow: hidden;
  position: relative;
  box-shadow: -4px 8px 18px rgba(0, 0, 0, 0.25);
  background: #2d3436;
}

.tianya-book-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tianya-book-detail-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tianya-book-detail-info h1 {
  margin: 0 0 14px 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--main, #2c3e50);
  line-height: 1.4;
}

.tianya-book-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  font-size: 13.5px;
  color: var(--minor, #555555);
}

.tianya-book-detail-grid strong {
  color: var(--main, #333333);
}

.tianya-book-section-title {
  font-size: 16px;
  font-weight: 800;
  color: #aa7c11;
  border-left: 4px solid #d4af37;
  padding-left: 10px;
  margin: 22px 0 12px 0;
}

html[data-theme='dark'] .tianya-book-section-title,
body.dark .tianya-book-section-title {
  color: #f1c40f;
  border-left-color: #f1c40f;
}

.tianya-book-synopsis {
  font-size: 14px;
  line-height: 1.85;
  color: var(--routine, #444444);
  background: rgba(0, 0, 0, 0.02);
  border-left: 3px solid #d4af37;
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  text-indent: 2em;
}

html[data-theme='dark'] .tianya-book-synopsis,
body.dark .tianya-book-synopsis {
  background: rgba(255, 255, 255, 0.03);
}

.tianya-book-sidebar {
  width: 310px;
  flex-shrink: 0;
}

.tianya-book-rank-box {
  background: var(--background, #ffffff);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
}

html[data-theme='dark'] .tianya-book-rank-box,
body.dark .tianya-book-rank-box {
  background: var(--background, #202124);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   7. 移动端与平板响应式适配
   ========================================================================== */
@media (max-width: 1024px) {
  .tianya-spotlight-grid {
    grid-template-columns: 1fr;
  }
  .tianya-main-layout {
    flex-direction: column;
  }
  .tianya-rank-col {
    width: 100%;
  }
  .tianya-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .tianya-shelf-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tianya-book-layout {
    flex-direction: column;
  }
  .tianya-book-sidebar {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .tianya-hero-pavilion {
    padding: 24px 18px;
  }
  .tianya-hero-title {
    font-size: 26px;
  }
  .tianya-hero-couplet {
    font-size: 14px;
  }
  .tianya-hero-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .tianya-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .tianya-gallery-cover-wrap {
    height: 160px;
  }
  .tianya-shelf-grid {
    grid-template-columns: 1fr;
  }
  .tianya-book-detail-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .tianya-book-detail-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }
}
/* ==========================================================================
   8. 经纬九卿 · 典藏门类展开展示系统
   ========================================================================== */
.tianya-category-expand-section {
  margin: 28px 0 34px;
  background: var(--background, #ffffff);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 16px;
  padding: 24px 26px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

html[data-theme='dark'] .tianya-category-expand-section,
body.dark .tianya-category-expand-section {
  background: var(--background, #202124);
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.tianya-category-expand-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #d4af37, #f39c12, #aa7c11);
}

.tianya-cat-expand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.25);
  flex-wrap: wrap;
  gap: 10px;
}

.tianya-cat-expand-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.tianya-cat-expand-icon {
  font-size: 20px;
}

.tianya-cat-expand-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--main, #2c3e50);
  letter-spacing: 0.5px;
}

html[data-theme='dark'] .tianya-cat-expand-title,
body.dark .tianya-cat-expand-title {
  color: #f1f2f6;
}

.tianya-cat-expand-subtitle {
  font-size: 13px;
  color: var(--minor, #7f8c8d);
}

.tianya-cat-expand-badge {
  font-size: 12px;
  color: #aa7c11;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.tianya-cat-expand-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.tianya-cat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 10px;
  text-decoration: none !important;
  color: var(--main, #333);
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

html[data-theme='dark'] .tianya-cat-card,
body.dark .tianya-cat-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  color: #ddd;
}

.tianya-cat-card:hover {
  transform: translateY(-2px);
  background: #fff;
  border-color: #aa7c11;
  box-shadow: 0 4px 14px rgba(170, 124, 17, 0.18);
  color: #aa7c11 !important;
}

html[data-theme='dark'] .tianya-cat-card:hover,
body.dark .tianya-cat-card:hover {
  background: rgba(212, 175, 55, 0.15);
}

.tianya-cat-card.active {
  background: linear-gradient(135deg, #d4af37, #aa7c11) !important;
  border-color: #aa7c11 !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(170, 124, 17, 0.35);
  font-weight: 700;
}

.tianya-cat-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tianya-cat-card-icon {
  font-size: 18px;
}

.tianya-cat-card-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.tianya-cat-card-count {
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
  color: #666;
  font-weight: 500;
}

html[data-theme='dark'] .tianya-cat-card-count,
body.dark .tianya-cat-card-count {
  background: rgba(255, 255, 255, 0.1);
  color: #bbb;
}

.tianya-cat-card.active .tianya-cat-card-count {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
}

/* ==========================================================================
   9. 镇阁重宝 · 殿堂名著 (3 行 15 本精装立轴全景书架)
   ========================================================================== */
.tianya-spotlight-grid-15 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.tianya-spotlight-item-15 {
  background: var(--background, #ffffff);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

html[data-theme='dark'] .tianya-spotlight-item-15,
body.dark .tianya-spotlight-item-15 {
  background: var(--background, #202124);
  border-color: rgba(212, 175, 55, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.tianya-spotlight-item-15:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 26px rgba(170, 124, 17, 0.18);
  border-color: #aa7c11;
}

/* 顶部尊荣席位角标 */
.tianya-spot-rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 6;
  letter-spacing: 0.5px;
}

.tianya-crown-1 {
  background: linear-gradient(135deg, #f1c40f, #d4af37);
  color: #fff;
  box-shadow: 0 2px 6px rgba(241, 196, 15, 0.4);
}

.tianya-crown-2 {
  background: linear-gradient(135deg, #bdc3c7, #7f8c8d);
  color: #fff;
  box-shadow: 0 2px 6px rgba(189, 195, 199, 0.4);
}

.tianya-crown-3 {
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: #fff;
  box-shadow: 0 2px 6px rgba(230, 126, 34, 0.4);
}

.tianya-crown-normal {
  background: rgba(0, 0, 0, 0.05);
  color: #8c7b6c;
  border: 1px solid rgba(140, 123, 108, 0.2);
}

html[data-theme='dark'] .tianya-crown-normal,
body.dark .tianya-crown-normal {
  background: rgba(255, 255, 255, 0.08);
  color: #d5cfc2;
  border-color: rgba(255, 255, 255, 0.15);
}

/* 3D 封皮容器 */
.tianya-spot-cover-wrap {
  width: 100%;
  height: 168px;
  margin-bottom: 12px;
  position: relative;
  perspective: 800px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tianya-spot-cover-3d {
  width: 118px;
  height: 160px;
  border-radius: 3px 6px 6px 3px;
  overflow: hidden;
  position: relative;
  box-shadow: -3px 5px 14px rgba(0, 0, 0, 0.28);
  transform: rotateY(-7deg);
  transform-origin: left center;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  background: #2c3e50;
}

.tianya-spotlight-item-15:hover .tianya-spot-cover-3d {
  transform: rotateY(0deg) scale(1.04);
  box-shadow: -1px 8px 18px rgba(0, 0, 0, 0.35);
}

.tianya-spot-cover-3d img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tianya-spot-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
}

.tianya-spot-ribbon {
  position: absolute;
  top: -2px;
  right: 10px;
  width: 12px;
  height: 22px;
  background: linear-gradient(180deg, #e74c3c, #c0392b);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 70%, 0 100%);
  z-index: 5;
}

.tianya-spot-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tianya-spot-title {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tianya-spot-title a {
  color: var(--main, #2c3e50);
  text-decoration: none;
  transition: color 0.2s;
}

html[data-theme='dark'] .tianya-spot-title a,
body.dark .tianya-spot-title a {
  color: #f1f2f6;
}

.tianya-spot-title a:hover {
  color: #aa7c11;
}

.tianya-spot-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--minor, #7f8c8d);
  margin-bottom: 10px;
}

.tianya-spot-author {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.tianya-spot-heat {
  color: #e67e22;
  font-weight: 600;
}

.tianya-spot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: auto;
}

.tianya-spot-btn-read {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  background: rgba(212, 175, 55, 0.12);
  color: #aa7c11 !important;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s;
}

.tianya-spot-btn-read:hover {
  background: #aa7c11;
  color: #fff !important;
}

.tianya-spot-btn-dl {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  background: linear-gradient(135deg, #d4af37, #aa7c11);
  color: #fff !important;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(170, 124, 17, 0.25);
  transition: all 0.2s;
}

.tianya-spot-btn-dl:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(170, 124, 17, 0.35);
}

/* 媒体查询响应式 */
@media (max-width: 1200px) {
  .tianya-cat-expand-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .tianya-spotlight-grid-15 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .tianya-cat-expand-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .tianya-spotlight-grid-15 {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .tianya-spot-cover-wrap {
    height: 148px;
  }
  .tianya-spot-cover-3d {
    width: 104px;
    height: 142px;
  }
}

@media (max-width: 768px) {
  .tianya-book-container {
    padding: 0 10px !important;
    margin-top: 10px !important;
  }
  .tianya-category-expand-section {
    padding: 14px 12px !important;
    border-radius: 12px !important;
    margin: 16px 0 20px !important;
  }
  .tianya-cat-expand-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .tianya-cat-card {
    padding: 8px 10px !important;
  }
  .tianya-spotlight-grid-15 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .tianya-spot-cover-wrap {
    height: 138px !important;
  }
  .tianya-spot-cover-3d {
    width: 96px !important;
    height: 130px !important;
  }
  .tianya-book-detail-box {
    padding: 14px 12px !important;
  }
}

@media (max-width: 380px) {
  .tianya-spot-cover-wrap {
    height: 120px !important;
  }
  .tianya-spot-cover-3d {
    width: 84px !important;
    height: 114px !important;
  }
}
