/* ============ 旺财电子图书馆 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
  background: #14100a;
  color: #e8dcc0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 图书馆场景 ---------- */
#scene-lib {
  min-height: 100%;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(255, 196, 110, 0.22), transparent 60%),
    radial-gradient(ellipse 120% 80% at 50% 110%, #241a10 0%, #171009 55%, #0e0a06 100%);
  padding: 26px 14px 60px;
  position: relative;
}
.library-inner { max-width: 980px; margin: 0 auto; }

/* 牌匾 */
.plaque-wrap { text-align: center; margin-bottom: 34px; }
.plaque {
  display: inline-block;
  background: linear-gradient(160deg, #4a2f1a, #2e1c0e 70%);
  border: 2px solid #6b4a28;
  border-radius: 4px;
  padding: 14px 46px 18px;
  box-shadow: 0 6px 30px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,160,.15), inset 0 -3px 8px rgba(0,0,0,.45);
  position: relative;
}
.plaque::before, .plaque::after {
  content: ""; position: absolute; top: 50%; width: 42px; height: 2px;
  background: linear-gradient(90deg, transparent, #8a6a3a); 
}
.plaque::before { left: -46px; }
.plaque::after { right: -46px; transform: scaleX(-1); }
.plaque h1 {
  font-size: 44px; letter-spacing: 14px; text-indent: 14px;
  color: #d9b878; font-weight: 700;
  text-shadow: 0 0 18px rgba(217,184,120,.35), 0 2px 3px rgba(0,0,0,.8);
}
.plaque .sub {
  margin-top: 6px; font-size: 13px; letter-spacing: 6px; text-indent: 6px;
  color: #9a7d4e;
}
.plaque .divider {
  width: 100%; height: 1px; margin-top: 10px;
  background: linear-gradient(90deg, transparent, #8a6a3a 30%, #8a6a3a 70%, transparent);
}

/* ---------- 书架 ---------- */
.shelf-area { display: flex; flex-direction: column; gap: 44px; perspective: 1400px; }
.shelf { position: relative; }
.shelf-label {
  display: inline-block; margin-left: 18px; margin-bottom: 8px;
  font-size: 13px; letter-spacing: 4px; color: #a3825a;
  border-bottom: 1px solid #5a4225; padding-bottom: 4px;
}
.shelf-cabinet {
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.12)),
    linear-gradient(135deg, #43301c, #352514 45%, #2c1e10);
  border: 2px solid #5a3f24;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 22px 20px 0;
  box-shadow: inset 0 0 46px rgba(0,0,0,.55), 0 16px 40px rgba(0,0,0,.5);
  transform-style: preserve-3d;
  position: relative;
}
/* 横板 */
.shelf-board {
  height: 16px;
  background: linear-gradient(180deg, #6b4a28, #4a3018 40%, #33200f);
  border-radius: 2px;
  box-shadow: 0 6px 14px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,210,140,.2);
  position: relative;
  z-index: 5;
}
.shelf-board::after {
  content: ""; position: absolute; left: -4px; right: -4px; bottom: -9px; height: 9px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
}
/* 书脊排 */
.books-row {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 7px; min-height: 250px; padding: 0 6px;
  flex-wrap: nowrap;
}

/* ---------- 书脊 ---------- */
.spine {
  position: relative;
  width: var(--w, 86px);
  height: var(--h, 238px);
  background: linear-gradient(90deg,
    rgba(0,0,0,.34) 0%, rgba(255,255,255,.09) 9%, rgba(255,255,255,0) 22%,
    rgba(0,0,0,0) 72%, rgba(0,0,0,.30) 100%), var(--c, #7a3030);
  border-radius: 4px 4px 2px 2px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,.5);
  transition: transform .22s ease, box-shadow .22s ease;
  transform: translateY(0) rotateY(0deg);
  flex-shrink: 0;
  overflow: hidden;
}
.spine:hover, .spine:active {
  transform: translateY(-16px) rotateY(14deg);
  box-shadow: 0 16px 22px rgba(0,0,0,.6);
  z-index: 3;
}
.spine-title {
  writing-mode: vertical-rl;
  font-size: var(--ts, 19px); font-weight: 700; letter-spacing: var(--tls, 5px);
  color: #f0e2bd; text-shadow: 0 1px 2px rgba(0,0,0,.65);
  flex: none;
  height: calc(var(--h, 238px) - 88px);   /* 竖排正交流下 flex:1 会場陷，改用显式高度 */
  overflow: hidden;
  max-width: 100%;
}
.spine-author {
  writing-mode: vertical-rl;
  font-size: 10.5px; letter-spacing: 4px; color: rgba(240,226,189,.62);
  margin-top: 8px;
}
.spine::before, .spine::after {
  content: ""; width: 56%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(240,222,170,.5), transparent);
}
.spine::before { order: -1; margin-bottom: 10px; }
.spine::after { margin-top: 10px; }
/* 进度标记：书脊小丝带 */
.spine .ribbon {
  display: none; position: absolute; top: -12px; right: 12px;
  width: 8px; height: 26px;
  background: linear-gradient(180deg, #c33d2e, #8e2417);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.spine.reading .ribbon { display: block; }
.spine.reading::after { background: linear-gradient(90deg, transparent, rgba(255,190,90,.85), transparent); }

/* 未缓存的书：冷色半透明 + 云标记 */
.spine.notcached { opacity: .88; }
.spine.notcached::after { background: linear-gradient(90deg, transparent, rgba(180,200,230,.45), transparent); }
.spine .cloud {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: rgba(220,230,250,.75); display: none;
}
.spine.notcached .cloud { display: block; }

/* ---------- 飞行书 ---------- */
#book-flyer {
  position: fixed; z-index: 90; pointer-events: none;
  display: none;
}
#book-flyer.on { display: block; }
.flyer-cover {
  width: var(--fw, 130px); height: var(--fh, 238px);
  background: linear-gradient(135deg, var(--c, #7a3030), color-mix(in srgb, var(--c, #7a3030) 62%, #000));
  border-radius: 3px 8px 8px 3px;
  box-shadow: 0 14px 40px rgba(0,0,0,.7);
  position: relative;
  transform-origin: left center;
}
.flyer-cover::before { /* 书脊侧 */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 12px;
  background: linear-gradient(90deg, rgba(0,0,0,.5), transparent);
}

/* ---------- 封面卡 ---------- */
#book-card {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: rgba(8, 5, 2, 0.82);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#book-card.on { display: flex; }
.card-inner {
  display: flex; gap: 34px; align-items: center;
  animation: cardIn .45s cubic-bezier(.2,.9,.3,1.1);
  max-width: 92vw;
}
@keyframes cardIn {
  from { transform: scale(.72) translateY(30px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
/* 立体封面 */
.cover3d {
  width: 216px; height: 312px;
  background: linear-gradient(150deg, var(--c, #7a3030) 0%, color-mix(in srgb, var(--c, #7a3030) 55%, #1a0d06) 100%);
  border-radius: 3px 10px 10px 3px;
  position: relative;
  box-shadow: 22px 30px 60px rgba(0,0,0,.65), 0 4px 14px rgba(0,0,0,.5);
  padding: 26px 20px;
  display: flex; flex-direction: column; align-items: center;
  border-left: 14px solid rgba(0,0,0,.28);
  flex-shrink: 0;
}
.cover3d::before { /* 烫金边框 */
  content: ""; position: absolute; inset: 12px 12px 12px 24px;
  border: 1.5px solid rgba(222,192,130,.55);
  border-radius: 2px; pointer-events: none;
}
.cover3d .c-title {
  writing-mode: vertical-rl;
  font-size: 34px; font-weight: 700; letter-spacing: 12px;
  color: #f2e4c0; text-shadow: 0 2px 4px rgba(0,0,0,.55);
  margin: 18px 0 14px;
}
.cover3d .c-author {
  writing-mode: vertical-rl; font-size: 14px; letter-spacing: 6px;
  color: rgba(242,228,192,.8);
}
.cover3d .c-orn {
  position: absolute; bottom: 26px; font-size: 20px; color: rgba(222,192,130,.5);
}
.cover3d .c-spine-shadow {
  position: absolute; left: 14px; top: 0; bottom: 0; width: 10px;
  background: linear-gradient(90deg, rgba(0,0,0,.4), transparent);
}
/* 右侧信息 */
.card-info { max-width: 320px; }
.card-info h2 { font-size: 30px; letter-spacing: 3px; color: #ecdfc0; margin-bottom: 4px; }
.card-info .author { font-size: 14px; color: #a3825a; letter-spacing: 2px; margin-bottom: 16px; }
.card-info .desc {
  font-size: 14.5px; line-height: 1.85;
  color: #c9b98d; margin-bottom: 20px;
}
.card-info .meta { font-size: 12.5px; color: #8a7048; margin-bottom: 24px; letter-spacing: 1px; }
.card-info .meta b { color: #c9a45c; }
.card-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  appearance: none; border: 1px solid #8a6a3a; cursor: pointer;
  background: linear-gradient(180deg, #3a2a16, #2a1d0e);
  color: #d9b878; font-family: inherit;
  font-size: 15px; letter-spacing: 3px;
  padding: 11px 26px; border-radius: 3px;
  transition: all .18s;
  box-shadow: 0 3px 10px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,220,160,.1);
}
.btn:hover { background: #4a3620; transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(180deg, #8a6228, #6b4a1c);
  border-color: #b08a48; color: #f5e8c8;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.btn.primary:hover { background: linear-gradient(180deg, #9a7030, #7a5522); }
.card-close {
  position: absolute; top: 18px; right: 22px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(180,150,100,.4); background: rgba(0,0,0,.3);
  color: #c9a45c; font-size: 18px; cursor: pointer;
}
@media (max-width: 640px) {
  .card-inner { flex-direction: column; gap: 20px; text-align: center; padding: 12px; }
  .cover3d { width: 150px; height: 220px; padding: 16px 12px; border-left-width: 9px; }
  .cover3d .c-title { font-size: 24px; letter-spacing: 8px; margin-top: 8px; }
  .cover3d .c-author { font-size: 11px; }
  .card-info h2 { font-size: 22px; }
  .card-info .desc { font-size: 13px; }
  .card-btns { justify-content: center; }
}

/* ---------- 阅读器 ---------- */
#reader {
  position: fixed; inset: 0; z-index: 200;
  display: none; flex-direction: column;
  background: linear-gradient(180deg, #221a10, #17110a);
}
#reader.on { display: flex; }
.reader-top {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(20,14,8,.96), rgba(28,20,12,.92));
  border-bottom: 1px solid rgba(150,110,60,.25);
  z-index: 10;
}
.reader-top .back {
  border: 1px solid #7a5c30; background: rgba(0,0,0,.25); color: #d9b878;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px;
}
.reader-top .r-title {
  flex: 1; text-align: center; font-size: 15px; letter-spacing: 2px;
  color: #d9c9a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
  border: 1px solid #7a5c30; background: rgba(0,0,0,.25); color: #d9b878;
  min-width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  font-size: 14px; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 8px;
}
.icon-btn.active { background: #6b4a1c; color: #ffe9b8; }
/* 书页区 */
.reader-stage { flex: 1; overflow: hidden; position: relative; display: flex; }
.page-book {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 30px 26px 90px;
  background:
    linear-gradient(90deg, rgba(120,80,30,.07), transparent 7%, transparent 93%, rgba(120,80,30,.08)),
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(255,235,190,.14), transparent),
    linear-gradient(180deg, #efe4c8, #e8dabb 60%, #e2d2b0);
  color: #3a2c18;
  scroll-behavior: smooth;
  transition: background .3s;
}
/* 中缝（宽屏双栏时隐藏，单栏模拟书页左右阴影） */
.page-book::before {
  content: ""; position: fixed; top: 0; bottom: 0; left: 0; width: 14px;
  background: linear-gradient(90deg, rgba(90,60,20,.22), transparent);
  pointer-events: none;
}
.page-book::after {
  content: ""; position: fixed; top: 0; bottom: 0; right: 0; width: 14px;
  background: linear-gradient(-90deg, rgba(90,60,20,.22), transparent);
  pointer-events: none;
}
.page-book.night {
  background: linear-gradient(180deg, #1c1814, #161310);
  color: #b8a888;
}
.ch-title {
  text-align: center; font-size: 21px; letter-spacing: 2px; font-weight: 700;
  color: #5a3d1e; margin: 14px 0 26px; line-height: 1.6;
}
.page-book.night .ch-title { color: #cfa96a; }
.ch-body p {
  font-size: var(--fs, 18px); line-height: 2.0; text-indent: 2em;
  margin: 0 0 4px; text-align: justify;
  letter-spacing: .4px;
}
/* 翻页动画 */
.page-flip { animation: flipIn .5s ease; }
@keyframes flipIn {
  0% { opacity: 0; transform: perspective(1600px) rotateY(-9deg) translateX(26px); }
  100% { opacity: 1; transform: perspective(1600px) rotateY(0) translateX(0); }
}
.page-flip-back { animation: flipInBack .5s ease; }
@keyframes flipInBack {
  0% { opacity: 0; transform: perspective(1600px) rotateY(9deg) translateX(-26px); }
  100% { opacity: 1; transform: perspective(1600px) rotateY(0) translateX(0); }
}
/* 底栏 */
.reader-bottom {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  background: linear-gradient(0deg, rgba(20,14,8,.97), rgba(28,20,12,.92));
  border-top: 1px solid rgba(150,110,60,.25);
  z-index: 10;
}
.reader-bottom .nav-btn {
  border: 1px solid #7a5c30; background: linear-gradient(180deg,#3a2a16,#2a1d0e);
  color: #d9b878; font-family: inherit; font-size: 13.5px; letter-spacing: 1px;
  padding: 9px 14px; border-radius: 3px; cursor: pointer; white-space: nowrap;
}
.reader-bottom .nav-btn:disabled { opacity: .35; cursor: default; }
.progress-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
.progress-bar { flex: 1; height: 5px; background: rgba(120,90,50,.3); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #a37b3a, #d9b878); border-radius: 3px; transition: width .3s; }
.progress-text { font-size: 11.5px; color: #9a8054; white-space: nowrap; }
/* 加载态 */
.page-loading { text-align: center; color: #8a7048; padding: 60px 0; font-size: 14px; letter-spacing: 2px; }

/* ---------- 书签面板 ---------- */
#bookmark-panel {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(8,5,2,.7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
}
#bookmark-panel.on { display: flex; }
.bm-card {
  width: min(480px, 90vw); max-height: 74vh; overflow-y: auto;
  background: linear-gradient(180deg, #f0e6cc, #e6d8b6);
  color: #4a3820; border-radius: 6px;
  padding: 20px 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
  animation: cardIn .3s ease;
}
.bm-card h3 { font-size: 17px; letter-spacing: 3px; margin-bottom: 14px; color: #5a3d1e; text-align: center; }
.bm-item {
  padding: 12px 12px; border-bottom: 1px dashed rgba(120,90,40,.35);
  cursor: pointer; display: flex; align-items: center; gap: 10px;
}
.bm-item:active { background: rgba(140,100,40,.12); }
.bm-item .bm-icon { color: #a33025; font-size: 15px; }
.bm-item .bm-main { flex: 1; min-width: 0; }
.bm-item .bm-title { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-item .bm-snippet { font-size: 12px; color: #7a6440; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-item .bm-del {
  border: none; background: none; color: #a33025; cursor: pointer;
  font-size: 15px; padding: 4px 6px; opacity: .6; font-family: inherit;
}
.bm-empty { text-align: center; color: #8a7048; font-size: 13.5px; padding: 26px 0; letter-spacing: 1px; }
.bm-actions { margin-top: 16px; text-align: center; }
.bm-actions .btn { border-color: #8a6a3a; background: linear-gradient(180deg,#3a2a16,#2a1d0e); color: #e2c890; }

/* ---------- 目录面板 ---------- */
#toc-panel {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(8,5,2,.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: none;
}
#toc-panel.on { display: block; }
.toc-card {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(400px, 88vw);
  background: linear-gradient(180deg, #f2e8ce, #e9dcbc);
  color: #4a3820;
  box-shadow: -14px 0 50px rgba(0,0,0,.55);
  display: flex; flex-direction: column;
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toc-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.toc-head h3 { font-size: 17px; letter-spacing: 4px; color: #5a3d1e; }
.toc-head .card-close {
  position: static; width: 32px; height: 32px; font-size: 15px;
  border: 1px solid rgba(140,110,60,.4); background: none; color: #8a6a3a;
}
#toc-search {
  margin: 0 18px 10px; padding: 9px 12px;
  border: 1px solid rgba(140,110,60,.4); border-radius: 4px;
  background: rgba(255,252,240,.7); color: #4a3820; font-family: inherit; font-size: 14px;
  outline: none;
}
#toc-list { flex: 1; overflow-y: auto; padding: 0 8px 18px; }
.toc-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 10px 12px; border-radius: 4px; cursor: pointer;
  border-bottom: 1px dashed rgba(120,90,40,.22);
  font-size: 14.5px; line-height: 1.5;
}
.toc-item:active { background: rgba(140,100,40,.14); }
.toc-item .n { color: #9a7d4e; font-size: 11.5px; min-width: 34px; text-align: right; flex-shrink: 0; }
.toc-item.cur { background: rgba(150,105,40,.16); font-weight: 700; color: #5a3d1e; }
.toc-item.cur::after { content: "◂ 当前方目"; font-size: 10px; color: #a33025; margin-left: auto; flex-shrink: 0; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: rgba(20,14,6,.92); color: #e8d5a8; border: 1px solid rgba(180,140,80,.4);
  padding: 10px 22px; border-radius: 30px; font-size: 13.5px; letter-spacing: 1px;
  z-index: 400; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(-6px); }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  #scene-lib { padding: 20px 8px 46px; }
  .plaque h1 { font-size: 30px; letter-spacing: 9px; text-indent: 9px; padding: 0; }
  .plaque { padding: 10px 26px 14px; }
  .plaque::before, .plaque::after { width: 20px; }
  .plaque::before { left: -24px; }
  .plaque::after { right: -24px; }
  .books-row { gap: 5px; min-height: 208px; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 4px 2px 10px; }
  .spine { --h: 200px !important; }
  .shelf-cabinet { padding: 16px 10px 0; }
  .reader-top .r-title { font-size: 13.5px; }
  .page-book { padding: 22px 18px 80px; }
}
@media (min-width: 900px) {
  .page-book { padding: 40px 90px 100px; }
}

/* ---------- v2: Tab切换 / 搜索 / 网文 ---------- */
.lib-tabs {
  display: flex; justify-content: center; gap: 14px;
  margin: 14px 0 6px;
}
.lib-tabs .tab {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-size: 17px; letter-spacing: 3px;
  color: #cdb98a; background: linear-gradient(180deg, #3a2c18, #241a0d);
  border: 1px solid #5a4728; border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 9px 26px 7px; cursor: pointer;
  opacity: .55; transition: all .2s;
}
.lib-tabs .tab.on {
  opacity: 1; color: #f4e6c0;
  background: linear-gradient(180deg, #55401f, #352712);
  box-shadow: 0 -3px 10px rgba(0,0,0,.4);
  transform: translateY(1px);
}
.lib-search {
  position: relative; max-width: 560px; margin: 8px auto 16px; padding: 0 16px;
}
.lib-search input {
  width: 100%; box-sizing: border-box;
  background: rgba(20,14,6,.75);
  border: 1px solid #5a4728; border-radius: 22px;
  color: #f0e2bd; font-size: 15px;
  padding: 11px 44px 11px 20px; outline: none;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
}
.lib-search input:focus { border-color: #8a6d3b; box-shadow: 0 0 0 3px rgba(138,109,59,.25); }
.lib-search input::placeholder { color: rgba(205,185,138,.5); }
.lib-search .s-ico {
  position: absolute; right: 30px; top: 50%; transform: translateY(-50%);
  font-size: 15px; opacity: .7; pointer-events: none;
}

/* 搜索结果视图 */
.search-view { max-width: 620px; margin: 0 auto; padding: 4px 16px 40px; text-align: left; }
.sv-head {
  font-family: "Kaiti SC", "STKaiti", serif; font-size: 15px;
  color: #cdb98a; margin: 6px 4px 12px; letter-spacing: 1px;
}
.sv-list { display: flex; flex-direction: column; gap: 9px; }
.sv-item {
  display: flex; align-items: center; gap: 13px;
  background: linear-gradient(180deg, rgba(58,44,24,.9), rgba(36,26,13,.9));
  border: 1px solid #4a3a1e; border-radius: 8px;
  padding: 10px 14px; cursor: pointer; transition: transform .15s, border-color .15s;
}
.sv-item:active, .sv-item:hover { transform: translateX(4px); border-color: #8a6d3b; }
.sv-item.notcached { opacity: .8; }
.sv-cover {
  width: 40px; height: 54px; border-radius: 3px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--c, #7a4a2b), rgba(0,0,0,.55));
  color: #f0e2bd; display: flex; align-items: center; justify-content: center;
  font-family: "Kaiti SC", serif; font-size: 15px;
  box-shadow: inset -3px 0 5px rgba(0,0,0,.4), 0 2px 5px rgba(0,0,0,.5);
}
.sv-main { flex: 1; min-width: 0; }
.sv-title { color: #f0e2bd; font-size: 15.5px; font-weight: 700; }
.sv-title em { font-style: normal; font-size: 11px; color: #8ab4d8; margin-left: 6px; }
.sv-sub { color: rgba(205,185,138,.65); font-size: 12px; margin-top: 3px; }
.sv-go { color: #8a6d3b; font-size: 13px; flex-shrink: 0; }
mark { background: #8a6d3b; color: #fff3d6; border-radius: 2px; padding: 0 1px; }

/* 网文视图 */
.wn-tip { max-width: 620px; margin: 0 auto 12px; padding: 0 16px; }
.wn-bar {
  display: flex; justify-content: space-between; align-items: center;
  font-family: "Kaiti SC", serif; color: #cdb98a; font-size: 15px; letter-spacing: 1px;
}
.wn-empty {
  max-width: 620px; margin: 30px auto; padding: 40px 20px; text-align: center;
  color: rgba(205,185,138,.55); font-family: "Kaiti SC", serif; font-size: 15px; line-height: 1.9;
  border: 1px dashed #4a3a1e; border-radius: 10px;
}
.spine.wn { border-radius: 3px; }

/* 网文搜书面板 */
#novel-panel {
  position: fixed; inset: 0; z-index: 80; display: none;
  background: rgba(8,5,2,.72); backdrop-filter: blur(3px);
}
#novel-panel.on { display: flex; align-items: center; justify-content: center; }
.np-card {
  width: min(560px, 92vw); max-height: 80vh;
  background: linear-gradient(160deg, #2e2313, #1d150a);
  border: 1px solid #5a4728; border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column;
  box-shadow: 0 18px 50px rgba(0,0,0,.7);
}
.np-search-row { display: flex; gap: 8px; margin: 10px 0; }
.np-search-row input {
  flex: 1; background: rgba(20,14,6,.8); border: 1px solid #5a4728; border-radius: 8px;
  color: #f0e2bd; font-size: 15px; padding: 10px 14px; outline: none;
}
.np-search-row input:focus { border-color: #8a6d3b; }
.np-result { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.np-item {
  display: flex; align-items: center; gap: 10px;
  background: rgba(90,71,40,.14); border: 1px solid rgba(90,71,40,.45);
  border-radius: 8px; padding: 10px 12px;
}
.np-main { flex: 1; min-width: 0; }
.np-title { color: #f0e2bd; font-size: 14.5px; font-weight: 700; }
.np-sub { color: rgba(205,185,138,.6); font-size: 11.5px; margin-top: 2px; }
.np-desc {
  color: rgba(205,185,138,.45); font-size: 11.5px; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.np-add { flex-shrink: 0; font-size: 13px !important; padding: 7px 12px !important; }

.btn.danger { color: #e8a89a; border-color: #6b3a2e; background: rgba(107,58,46,.2); }
.np-src {
  font-style: normal; font-size: 10px; font-weight: 400;
  color: #8ab4d8; background: rgba(90,120,160,.18);
  border: 1px solid rgba(138,180,216,.3); border-radius: 4px;
  padding: 1px 5px; margin-left: 6px; vertical-align: 2px;
}

/* 童书苑 */
.np-zone-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: rgba(205,185,138,.6); margin: -4px 0 10px;
}
.np-zone-btn {
  background: rgba(90,71,40,.2); border: 1px solid #5a4728; border-radius: 14px;
  color: #cdb98a; font-size: 12px; padding: 4px 12px; cursor: pointer;
}
.np-zone-btn.on {
  color: #f4e6c0; background: linear-gradient(180deg, #55401f, #352712);
  border-color: #8a6d3b;
}
