
:root{--th-bg:#f5f7f7;--th-surface:#ffffff;--th-text:#1f2937;--th-muted:#607082;--th-accent:#29435b;--th-border:#dce4e8}
body.th-dark-mode{--th-bg:#0f1720;--th-surface:#16202b;--th-text:#eaf1f7;--th-muted:#9fb0c0;--th-accent:#8bb8ff;--th-border:#263445;background:var(--th-bg);color:var(--th-text)}
body.th-dark-mode .th-header,body.th-dark-mode .th-footer,body.th-dark-mode .tsv3-home,body.th-dark-mode .th-card,body.th-dark-mode .th-detail-panel,body.th-dark-mode .th-detail-content,body.th-dark-mode .th-search-dialog,body.th-dark-mode .th-auth-dialog,body.th-dark-mode .th-mobile-menu-sheet{background:var(--th-surface)!important;color:var(--th-text)!important}
body.th-dark-mode a,body.th-dark-mode .th-card-title a,body.th-dark-mode .th-site-main,body.th-dark-mode .th-section-title,body.th-dark-mode h1,body.th-dark-mode h2,body.th-dark-mode h3{color:var(--th-text)!important}
body.th-dark-mode .th-card-category,body.th-dark-mode .th-card-language,body.th-dark-mode .th-card-author,body.th-dark-mode .tsv3-section-sub,body.th-dark-mode .th-breadcrumb,body.th-dark-mode .th-author-hero__content p{color:var(--th-muted)!important}
.th-dark-toggle{border:0;background:#eef2f6;border-radius:999px;padding:8px 10px;font-size:16px;line-height:1;cursor:pointer}
.book-wishlist{position:absolute;top:10px;right:10px;width:38px;height:38px;border:0;border-radius:999px;background:rgba(255,255,255,.92);box-shadow:0 8px 24px rgba(0,0,0,.12);cursor:pointer;font-size:18px;z-index:5}
.book-wishlist.is-active{background:#ffeff2;color:#d12f52}
.th-card{position:relative}
.th-card-author a,.th-author-box a,.author-mini a{text-decoration:none;color:inherit}
.th-author-box small{display:block;margin-top:6px;opacity:.8;line-height:1.5}
.th-author-hero{display:grid;grid-template-columns:180px 1fr;gap:28px;align-items:center;background:linear-gradient(135deg,#eef5fb,#f8fbfd);border:1px solid var(--th-border);border-radius:28px;padding:28px;margin:20px 0 28px}
.th-author-hero__image img{width:180px;height:180px;border-radius:24px;object-fit:cover;display:block}
.th-author-eyebrow{display:inline-block;margin-bottom:8px;font-weight:700;color:#5f7b98}
.th-author-stats{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:14px}.th-author-stats span,.th-author-stats a{display:inline-flex;padding:10px 14px;border-radius:999px;background:#fff;text-decoration:none;color:#29435b;font-weight:700}
.th-sticky-player{position:fixed;left:14px;right:14px;bottom:14px;z-index:9999;display:grid;grid-template-columns:auto 1fr auto 180px auto;gap:12px;align-items:center;background:rgba(20,31,43,.96);color:#fff;padding:12px 14px;border-radius:18px;box-shadow:0 18px 36px rgba(0,0,0,.25)}
.th-sticky-player__cover img{width:48px;height:48px;border-radius:12px;object-fit:cover}
.th-sticky-player__meta{display:flex;flex-direction:column;min-width:0}.th-sticky-player__meta strong,.th-sticky-player__meta span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.th-sticky-player__meta span{opacity:.75;font-size:13px}.th-sticky-player__toggle{width:42px;height:42px;border:0;border-radius:999px;background:#fff;color:#0f1720;font-weight:700;cursor:pointer}
.th-sticky-player input[type=range]{width:100%}.th-sticky-player__time{font-size:13px;white-space:nowrap}
@media (max-width:760px){.th-author-hero{grid-template-columns:1fr;text-align:center}.th-author-hero__image img{margin:0 auto}.th-sticky-player{grid-template-columns:auto 1fr auto;grid-template-areas:'cover meta toggle' 'range range range' 'time time time'}.th-sticky-player__cover{grid-area:cover}.th-sticky-player__meta{grid-area:meta}.th-sticky-player__toggle{grid-area:toggle}.th-sticky-player input[type=range]{grid-area:range}.th-sticky-player__time{grid-area:time}}

body.th-dark-mode .th-mobile-dark-toggle{background:#8bb8ff!important;color:#0f1720!important;}
@media (max-width:640px){body.th-dark-mode{background:var(--th-bg)!important;color:var(--th-text)!important;} body.th-dark-mode .th-site-main{background:transparent!important;}}


/* ===== v13 modern header icons ===== */
:root{
  --th-header-icon:#0f172a;
  --th-header-soft:#eef2f6;
  --th-profile-blue:#6788c2;
}
body.th-dark-mode{
  --th-header-icon:#f8fafc;
  --th-header-soft:#1e293b;
  --th-profile-blue:#7fa6ea;
}
.th-modern-header-icons{gap:18px;}
.th-modern-toggle,
.th-modern-icon-btn,
.th-modern-profile-btn{border:0;background:transparent;padding:0;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;}
.th-modern-toggle__track{width:56px;height:32px;background:var(--th-header-soft);border:1px solid var(--th-border);border-radius:999px;position:relative;display:block;transition:background .25s ease,border-color .25s ease;}
.th-modern-toggle__thumb{width:22px;height:22px;border-radius:50%;background:var(--th-header-icon);position:absolute;top:4px;left:4px;transition:transform .28s cubic-bezier(.34,1.56,.64,1), background .25s ease;}
body.th-dark-mode .th-modern-toggle__thumb{transform:translateX(24px);}
.th-modern-icon-btn{width:38px;height:38px;color:var(--th-header-icon);border-radius:12px;transition:background .2s ease, transform .2s ease, color .2s ease;}
.th-modern-icon-btn:hover,.th-modern-profile-btn:hover,.th-modern-toggle:hover{transform:translateY(-1px);}
.th-modern-icon-btn:hover{background:var(--th-header-soft);}
.th-modern-icon{width:23px;height:23px;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;fill:none;display:block;}
.th-modern-profile-btn{border-radius:999px;}
.th-user-avatar--icon{width:44px;height:44px;min-width:44px;min-height:44px;border-radius:50%;background:var(--th-profile-blue) !important;color:#fff;display:inline-flex;align-items:center;justify-content:center;box-shadow:none;}
.th-user-avatar--icon .th-modern-icon{width:22px;height:22px;stroke:#fff;}
.th-user-trigger.th-modern-profile-btn{gap:10px;}
.th-user-trigger.th-modern-profile-btn .th-user-name{font-weight:600;}
body.th-dark-mode .th-user-dropdown{background:var(--th-surface);border-color:var(--th-border);}
body.th-dark-mode .th-user-dropdown a{color:var(--th-text);}
body.th-dark-mode .th-user-dropdown a:hover{background:#1b2632;}

@media (max-width: 640px){
  .th-modern-header-icons{gap:12px;}
  .th-modern-toggle__track{width:52px;height:30px;}
  .th-modern-toggle__thumb{width:20px;height:20px;}
  body.th-dark-mode .th-modern-toggle__thumb{transform:translateX(22px);}
  .th-modern-icon-btn{width:34px;height:34px;}
  .th-modern-icon{width:22px;height:22px;}
  .th-user-avatar--icon{width:40px;height:40px;min-width:40px;min-height:40px;}
  .th-user-name{display:none !important;}
}






/* ===== v14.1 fix: dark mode button only in header, desktop-like ===== */
.th-mobile-menu-utilities{display:none !important;}
.th-modern-header-icons{display:flex;align-items:center;gap:20px;}
.th-modern-toggle{width:52px;height:52px;border-radius:999px;background:#eef2f6;display:inline-flex;align-items:center;justify-content:center;transition:transform .2s ease, background .25s ease;}
.th-modern-toggle:hover{transform:translateY(-1px);background:#e7edf4;}
.th-modern-toggle__disc{width:24px;height:24px;border-radius:50%;border:2px solid #111827;display:inline-flex;align-items:center;justify-content:center;background:#fff;overflow:hidden;position:relative;}
.th-modern-toggle__yin{width:100%;height:100%;border-radius:50%;background:linear-gradient(to right,#111827 50%, #ffffff 50%);display:block;}
body.th-dark-mode .th-modern-toggle{background:#1e293b;}
body.th-dark-mode .th-modern-toggle__disc{border-color:#f8fafc;box-shadow:0 0 0 1px rgba(255,255,255,.05) inset;}
body.th-dark-mode .th-modern-toggle__yin{background:linear-gradient(to right,#111827 50%, #ffffff 50%);}

@media (max-width:640px){
  .th-header-right.th-modern-header-icons{gap:16px !important;}
  .th-modern-toggle{width:46px;height:46px;min-width:46px;}
  .th-modern-toggle__disc{width:22px;height:22px;}
}


/* ===== v15.1 restore dark toggle on desktop and mobile ===== */
.th-header-right > .th-modern-toggle{display:inline-flex !important;}
.th-header-right > *[data-dark-toggle]{display:inline-flex !important;}
@media (max-width:1024px){.th-header-right > .th-modern-toggle,.th-header-right > *[data-dark-toggle]{display:inline-flex !important;}}
@media (max-width:640px){.th-header-right.th-modern-header-icons{gap:14px !important;} .th-header-right > .th-modern-toggle,.th-header-right > *[data-dark-toggle]{display:inline-flex !important;width:46px !important;height:46px !important;min-width:46px !important;order:0;} .th-modern-toggle__disc{width:22px !important;height:22px !important;}}
