/* ===========================
   她阅 (TY) Theme - Lotus Whisper
   Mobile-first, max-width 440px
   Pink-toned feminine design for Taiwan readers
   =========================== */

@font-face {
    font-family: "Droid Sans";
    src: url('/lib/fonts/DroidSans-Bold.ttf') format('truetype');
    font-style: normal;
    font-display: swap;
}


:root {
    --sn-primary: #E88CA5;
    --sn-primary-dark: #D4738E;
    --sn-primary-light: #FFF0F3;
    --sn-bg: #ffffff;
    --sn-white: #ffffff;
    --sn-text: #1A1A2E;
    --sn-text-secondary: #6B7280;
    --sn-text-muted: #9CA3AF;
    --sn-border: #E5E7EB;
    --sn-gray-bg: #F6F7F8;
    --sn-radius: 16px;
    --sn-radius-sm: 10px;
    --sn-radius-xs: 8px;
    --sn-tabbar-height: 60px;
    --sn-header-height: 56px;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: "Microsoft YaHei", "\5fae\8f6f\96c5\9ed1", sans-serif;
    background: var(--sn-bg);
    color: var(--sn-text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* sticky footer：页面内容不足一屏时，footer 仍贴在视口底部而非浮在中间 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

.imgbox {
    position: relative;
    overflow: hidden;
    background: #eee;
}
.imgbox img { width: 100%; display: block; }
.imgbox .imgmask { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; }

/* === PC NavBar (hidden on mobile, shown >= 768px) === */
.sn-navbar { display: none; }

/* === Mobile Header (shown on mobile, hidden >= 768px) === */
.sn-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--sn-white);
    height: var(--sn-header-height);
}

.sn-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 100%;
}

.sn-logo a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sn-logo-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: block;
    object-fit: contain;
}

.sn-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--sn-text);
    letter-spacing: 0.5px;
}

.sn-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sn-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--sn-text-secondary);
    padding: 6px;
    display: flex;
    align-items: center;
    border-radius: 50%;
}

.sn-search-btn:active { background: var(--sn-bg); }

/* === Main Content === */
.sn-main {
    padding-top: var(--sn-header-height);
    /* tabbar 遮挡由其后的 .sn-footer margin-bottom 统一兜底，此处不再留白避免与 footer 间出现空隙 */
    /* body 是 flex 列容器；margin:0 auto 的横向 auto 边距会抑制 stretch，
       无显式宽度时 .sn-main 缩成内容宽度(被 max-width 卡在 768)，手机端横向溢出。
       显式 width:100% 给出确定宽度，与 .sn-footer 同理。 */
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
}

.sn-main.sn-no-mobile-header {
    padding-top: 0;
}

.sn-pagebody {
}

.sn-home {
    padding: 0 0 32px;
}

/* 全站柔和水彩花卉背景：低透明度点缀，固定视口、不影响内容点击。
   覆盖：首页 / 书库 / 排行榜 / 书架 / 我的 / 搜索 / 书详情。
   阅读页（.sn-reader-body）不在列表，自动排除。 */
.sn-home,
.sn-library,
.sn-rank-page,
.activity-page,
.sn-history-page,
.sn-user-page,
.sn-search-page,
.sn-book-detail {
    position: relative;
    isolation: isolate;
}

.sn-home::before,
.sn-library::before,
.sn-rank-page::before,
.activity-page::before,
.sn-history-page::before,
.sn-user-page::before,
.sn-search-page::before,
.sn-book-detail::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('/images/bg.webp');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
}

/* Home Search Bar (pill style below header) */
.sn-home-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--sn-gray-bg);
    border-radius: 20px;
    padding: 0 16px 0 12px;
    height: 40px;
    margin: 0 16px 16px;
    cursor: pointer;
}

.sn-home-search svg { flex-shrink: 0; color: var(--sn-text-muted); }

.sn-home-search span {
    font-size: 14px;
    color: var(--sn-text-muted);
}

/* PC: hide home inline search (navbar has its own) */
/* === Banner / Carousel === */
.sn-banner {
    position: relative;
    overflow: hidden;
    margin: 0 16px 4px;
    border-radius: var(--sn-radius);
}

.sn-banner-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.sn-banner-slide {
    min-width: 100%;
    position: relative;
    display: block;
    flex-shrink: 0;
    transition: transform 0.4s ease, filter 0.4s ease, opacity 0.4s ease;
}

.sn-banner-img {
    position: relative;
    width: 100%;
    /* 750×262 图的真实比例 = 262/750 = 34.93% */
    padding-bottom: 34.93%;
    overflow: hidden;
    border-radius: var(--sn-radius);
}

.sn-banner-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sn-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 16px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.3) 50%, transparent);
    border-radius: 0 0 var(--sn-radius) var(--sn-radius);
}

.sn-banner-overlay h3 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 4px 8px rgba(0,0,0,0.15);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    line-height: 28px;
}

.sn-banner-overlay p {
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    text-shadow: 0 3px 6px rgba(0,0,0,0.12);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sn-banner-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 4px;
}

.sn-banner-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sn-text-muted);
    opacity: 0.4;
    transition: all 0.3s;
}

.sn-banner-dots .dot.active {
    width: 20px;
    border-radius: 3px;
    background: var(--sn-primary);
    opacity: 1;
}

/* Banner arrows: hidden by default (mobile), shown on PC */
.sn-banner-arrow { display: none; }

/* PC Banner: center-mode 3-column with blurred sides */
/* === Sections === */
.sn-section {
    margin-bottom: 32px;
    padding: 0 16px;
}

.sn-section-center { text-align: center; }

.sn-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.sn-section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--sn-text);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 24px;
}

.sn-section-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.sn-more {
    font-size: 13px;
    color: var(--sn-primary);
    white-space: nowrap;
    font-weight: 400;
}

/* === Hot Recommendations (2-col wide covers) === */
.sn-hot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sn-hot-card {
    display: block;
    border-radius: var(--sn-radius-sm);
    overflow: hidden;
}

.sn-hot-card-cover {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--sn-radius-sm);
    background: #eee;
}

.sn-hot-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sn-hot-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--sn-text);
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 20px;
}

/* === Category Grid (4 colored icons) === */
.sn-cate-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    text-align: center;
}

.sn-cate-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.sn-cate-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.sn-cate-icon svg {
    width: 28px;
    height: 28px;
}

.sn-cate-name {
    font-size: 13px;
    color: var(--sn-text);
    font-weight: 700;
    line-height: 18px;
}

/* === Free Banner (Blue gradient CTA card) === */
.sn-free-banner {
    display: block;
    background: linear-gradient(135deg, #E88CA5 0%, #D4738E 100%);
    border-radius: var(--sn-radius);
    overflow: hidden;
    color: #fff;
}

.sn-free-banner-inner {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sn-free-banner-text h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 26px;
}

.sn-free-banner-text p {
    font-size: 13px;
    opacity: 0.85;
    line-height: 18px;
}

.sn-free-banner-btn {
    display: inline-block;
    align-self: flex-start;
    font-size: 14px;
    font-weight: 700;
    background: rgba(255,255,255,0.2);
    padding: 8px 20px;
    border-radius: 24px;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.sn-free-banner-btn:active { background: rgba(255,255,255,0.3); }

/* === Book List (Vertical - for 最新更新, 分类精选) === */
.sn-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sn-book-listitem {
    display: flex;
    gap: 12px;
    padding: 12px 8px;
    border-radius: var(--sn-radius-sm);
    align-items: center;
    border-bottom: 1px solid var(--sn-border);
}

.sn-book-listitem:last-child { border-bottom: none; }

.sn-book-listitem:active { background: rgba(0,0,0,0.02); }

.sn-book-listitem-cover {
    flex-shrink: 0;
    width: 64px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sn-book-listitem-cover .imgbox {
    border-radius: 4px;
    position: relative;
    width: 100%;
    /* H5 */
    height: 85px;
    aspect-ratio: 3 / 4;
}

.sn-book-listitem-cover .imgbox img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.sn-book-listitem:hover .sn-book-listitem-cover .imgbox img {
    transform: scale(1.06);
}

.sn-book-listitem-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.sn-book-listitem-info h3 {
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 20px;
    color: var(--sn-text);
}

.sn-book-desc {
    font-size: 13px;
    color: var(--sn-text-secondary);
    line-height: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sn-book-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--sn-text-muted);
    margin-top: 2px;
}

.sn-book-author { color: var(--sn-text-secondary); }

.sn-tag-finish {
    padding: 1px 8px;
    border-radius: 4px;
    background: #d1fae5;
    color: #065f46;
    font-size: 11px;
    font-weight: 600;
}

.sn-tag-serial {
    padding: 1px 8px;
    border-radius: 4px;
    background: var(--sn-primary-light);
    color: var(--sn-primary);
    font-size: 11px;
    font-weight: 600;
}

.sn-book-chapters { color: var(--sn-text-muted); }
.sn-book-reads { color: var(--sn-text-muted); }

/* === Tabs (Category Select) === */
.sn-tabs-nav {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 12px;
    background: var(--sn-bg);
    border-radius: var(--sn-radius-sm);
    padding: 4px;
}

.sn-tabs-nav::-webkit-scrollbar { display: none; }

.sn-tab-btn {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--sn-text-secondary);
    background: none;
    border: none;
    border-radius: var(--sn-radius-xs);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sn-tab-btn.active {
    color: var(--sn-primary);
    background: var(--sn-white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.sn-tabs-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 80px;
}

/* === Rank List === */
.sn-rank-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sn-rank-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 8px;
    border-radius: var(--sn-radius-sm);
}

.sn-rank-item:active { background: rgba(0,0,0,0.02); }

.sn-rank-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--sn-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--sn-text-muted);
    background: var(--sn-gray-bg);
    position: relative;
}

.sn-rank-crown {
    display: none;
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
}

.sn-rank-num.top-1 {
    background: linear-gradient(135deg, #F59E0B, #F97316);
    color: #fff;
}

.sn-rank-num.top-2 {
    background: linear-gradient(135deg, #9CA3AF, #C0C0C0);
    color: #fff;
}

.sn-rank-num.top-3 {
    background: linear-gradient(135deg, #CD7F32, #B8733A);
    color: #fff;
}

.sn-rank-num.top .sn-rank-crown {
    display: block;
}

.sn-rank-num.top-1 .sn-rank-crown { color: #FFD700; }
.sn-rank-num.top-2 .sn-rank-crown { color: #E8E8E8; }
.sn-rank-num.top-3 .sn-rank-crown { color: #FFDAB0; }

.sn-rank-cover {
    flex-shrink: 0;
    width: 48px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sn-rank-cover .imgbox {
    border-radius: 4px;
    position: relative;
    width: 100%;
    /* H5 */
    height: 64px;
    aspect-ratio: 3 / 4;
}

.sn-rank-cover .imgbox img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.sn-rank-item:hover .sn-rank-cover .imgbox img {
    transform: scale(1.06);
}

.sn-rank-info {
    flex: 1;
    min-width: 0;
}

.sn-rank-info h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 20px;
}

/* === Load More Button === */
.sn-loadmore-btn {
    display: inline-block;
    padding: 12px 40px;
    border-radius: 24px;
    border: 1.5px solid var(--sn-border);
    font-size: 14px;
    font-weight: 600;
    color: var(--sn-text-secondary);
    background: var(--sn-white);
    transition: all 0.2s;
}

.sn-loadmore-btn:active {
    background: var(--sn-bg);
    border-color: var(--sn-text-muted);
}

/* === Bottom Tab Bar (Pill style) === */
.sn-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--sn-white);
    display: flex;
    align-items: center;
    height: calc(var(--sn-tabbar-height) + env(safe-area-inset-bottom, 0px));
    padding: 0 12px env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -1px 12px rgba(0, 0, 0, 0.06);
}

.sn-tabbar-pill {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    width: 100%;
    height: var(--sn-tabbar-height);
}

.sn-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 100%;
    gap: 4px;
    color: var(--sn-text-muted);
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: none;
}

.sn-tab svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sn-tab.active {
    color: var(--sn-primary);
}

.sn-tab span {
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0;
    line-height: 12px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hide tabbar on PC */
/* === Footer (light, theme-matching) === */
.sn-footer {
    display: block;
    /* 跟 .sn-main / nav / tabbar 一样锁 768 居中，不再左右满屏延伸 */
    /* width:100% 给出明确宽度：body 为 flex 列容器时，左右 auto 边距会让无宽度的块缩成内容宽度，
       导致 footer 比上方 .sn-main 窄。显式 100% + max-width 锁定 768，与上方内容对齐 */
    width: 100%;
    max-width: 768px;
    /* margin-top:auto → 配合 body flex，内容不足一屏时被撑到视口底部 */
    margin: auto auto calc(var(--sn-tabbar-height) + env(safe-area-inset-bottom, 0px));
    padding: 20px 16px;
    text-align: center;
    background: transparent;
    border-top: 1px solid rgba(232, 140, 165, 0.22);
    border-radius: 16px 16px 0 0;
}

.sn-footer-inner {
    max-width: 768px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sn-footer-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--sn-primary-dark);
}

.sn-footer-desc {
    font-size: 14px;
    color: var(--sn-text-secondary);
}

.sn-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
}

.sn-footer-links a {
    font-size: 13px;
    color: var(--sn-text-secondary);
    transition: color 0.2s;
}

.sn-footer-links a:hover {
    color: var(--sn-primary);
}

.sn-footer-copy {
    font-size: 12px;
    color: var(--sn-text-muted);
}

/* === Loading overlay === */
.loading {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
}

.loadmask {
    position: absolute;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
}

.loadani {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 4px;
}

.loadani span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: loadpulse 1s ease-in-out infinite;
}

.loadani span:nth-child(2) { animation-delay: 0.1s; }
.loadani span:nth-child(3) { animation-delay: 0.2s; }
.loadani span:nth-child(4) { animation-delay: 0.3s; }
.loadani span:nth-child(5) { animation-delay: 0.4s; }

@keyframes loadpulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.5); opacity: 1; }
}

/* === User panel in header === */
.headuser { display: flex; align-items: center; }
.headuser a { display: flex; align-items: center; }
.headuser img { width: 28px; height: 28px; border-radius: 50%; }
.sn-login-btn { color: var(--sn-text-secondary); display: flex; align-items: center; }

/* === Header search icon === */
.ty-header-search {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 8px;
}

.sn-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* === Horizontal Scroll (for other pages reuse) === */
.sn-scroll-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.sn-scroll-list::-webkit-scrollbar { display: none; }

.sn-book-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.sn-book-scroll::-webkit-scrollbar { display: none; }

/* PC: book scroll becomes a grid */
.sn-book-card {
    flex-shrink: 0;
    width: 100px;
    scroll-snap-align: start;
    display: block;
}

.sn-book-card-cover {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sn-book-card-cover .imgbox {
    border-radius: 4px;
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
}

.sn-book-card-cover .imgbox img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.sn-book-card:hover .sn-book-card-cover .imgbox img {
    transform: scale(1.06);
}

.sn-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.sn-badge.adult { background: #ef4444; }
.sn-badge.finish { background: #10b981; }

.sn-book-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--sn-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* === Featured Layout (今日必讀 - hero + side grid) === */
/* === Today (今日必讀 - H5 featured hero / PC rich grid) === */

/* H5: featured hero + side grid */
.sn-featured-h5 {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sn-featured-hero {
    display: flex;
    gap: 14px;
    background: var(--sn-white);
    border-radius: var(--sn-radius);
    padding: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.sn-featured-hero-cover {
    flex-shrink: 0;
    width: 100px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.sn-featured-hero-cover .imgbox {
    position: relative;
    width: 100%;
    /* H5 */
    height: 133px;
    aspect-ratio: 3 / 4;
    border-radius: 4px;
}

.sn-featured-hero-cover .imgbox img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.sn-featured-hero:hover .sn-featured-hero-cover .imgbox img {
    transform: scale(1.06);
}

.sn-featured-hero-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.sn-featured-hero-info h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--sn-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sn-featured-hero-info p {
    font-size: 13px;
    color: var(--sn-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sn-featured-author {
    font-size: 12px;
    color: var(--sn-text-muted);
}

.sn-featured-side {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 10px;
    overflow: hidden;
}

/* 手机端只显示前 6 个 side cell（cshtml 渲染 8 个，多出 2 个供 iPad 4 列使用） */
.sn-featured-side .sn-featured-cell:nth-child(n+7) {
    display: none;
}

.sn-featured-cell {
    display: block;
    text-decoration: none;
    min-width: 0;
}

.sn-featured-cell-cover {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: #eee;
    /* H5: 宽度跟随网格列宽，高度由比例自动算出 */
    width: 100%;
    aspect-ratio: 3 / 4;
}

.sn-featured-cell-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s;
}

.sn-featured-cell:hover .sn-featured-cell-cover img {
    transform: scale(1.06);
}

.sn-cell-tag {
    position: absolute;
    top: 0;
    right: 0;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    border-radius: 0 8px 0 8px;
}

.sn-cell-tag.finish { background: #10b981; }
.sn-cell-tag.serial { background: var(--sn-primary); }

.sn-featured-cell-title {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sn-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* PC: hide H5 featured, show rich grid */
.sn-today-grid { display: none; }

.sn-today-card {
    display: block;
}

.sn-today-cover {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sn-today-cover .imgbox {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 4px;
}

.sn-today-cover .imgbox img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.sn-today-card:hover .sn-today-cover .imgbox img {
    transform: scale(1.06);
}

.sn-today-cover .sn-badge {
    padding: 2px 8px;
    z-index: 1;
}

.sn-today-cover .sn-badge.finish { background: #10b981; }
.sn-today-cover .sn-badge.serial { background: var(--sn-primary); }
.sn-today-cover .sn-badge.adult { top: auto; bottom: 6px; left: auto; background: #ef4444; }

.sn-today-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sn-today-info h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--sn-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.sn-today-author {
    font-size: 12px;
    color: var(--sn-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sn-today-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--sn-text-muted);
}

/* === Tinted Section (subtle variety) === */
.sn-section-tinted {
    /* no background change — blends with page */
}

/* === Popular List (大家都愛看 - list items, multi-col on PC) === */
.sn-popular-list {
    display: flex;
    flex-direction: column;
}

/* === Book Grid (static grid, not scrollable) === */
.sn-book-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 14px;
}

.sn-book-grid .sn-book-card:nth-child(n+7) {
    display: none;
}

.sn-popular-actions {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.sn-popular-change {
    min-width: 132px;
    height: 42px;
    padding: 0 24px;
    border: 1px solid rgba(232, 140, 165, 0.45);
    border-radius: 999px;
    background: var(--sn-white);
    color: var(--sn-primary-dark);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.sn-popular-change:disabled {
    opacity: 0.58;
    cursor: default;
}

/* === Page-specific tab highlight === */
body.page-library .sn-tabbar a[href="/library/"],
body.page-rank .sn-tabbar a[href="/rank/"] {
    color: var(--sn-primary);
}

body.page-library .sn-tabbar a[href="/"],
body.page-rank .sn-tabbar a[href="/"] {
    color: var(--sn-text-muted);
}

/* ============================================
   Page Header (for Library, Rank, History, User)
   ============================================ */
.sn-page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--sn-header-height);
    background: var(--sn-white);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sn-page-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--sn-text);
}

.sn-page-header .sn-edit-btn {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--sn-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.sn-back-btn {
    display: flex;
    align-items: center;
    padding: 4px;
    color: var(--sn-text);
}

.sn-page-header .sn-back-btn {
    position: absolute;
    left: 12px;
}

/* ============================================
   WeeklyFree Page (每週限免)
   ============================================ */
.sn-weeklyfree-page {
    padding-bottom: 80px;
}

.sn-weeklyfree-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px 16px;
    padding: 16px;
    border-radius: var(--sn-radius);
    background: linear-gradient(135deg, var(--sn-primary) 0%, #f59e9e 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(232, 140, 165, 0.25);
}

.sn-weeklyfree-hero-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
}

.sn-weeklyfree-hero-text {
    flex: 1;
    min-width: 0;
}

.sn-weeklyfree-hero-text h2 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 4px;
}

.sn-weeklyfree-hero-text p {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

/* ============================================
   Recommend Page (編輯精選)
   ============================================ */
.sn-recommend-page {
    padding-bottom: 80px;
}

.sn-recommend-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px 16px;
    padding: 16px;
    border-radius: var(--sn-radius);
    background: linear-gradient(135deg, var(--sn-primary) 0%, #f59e9e 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(232, 140, 165, 0.25);
}

.sn-recommend-hero-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
}

.sn-recommend-hero-text {
    flex: 1;
    min-width: 0;
}

.sn-recommend-hero-text h2 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 4px;
}

.sn-recommend-hero-text p {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

.sn-empty-state {
    text-align: center;
    padding: 60px 24px;
}

.sn-empty-state .sn-empty-icon {
    margin-bottom: 16px;
}

.sn-empty-state h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--sn-text);
    margin-bottom: 8px;
}

.sn-empty-state p {
    font-size: 13px;
    color: var(--sn-text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.sn-empty-btn {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 22px;
    background: var(--sn-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.sn-empty-btn:active {
    background: var(--sn-primary-dark);
}

/* ============================================
   Library Page (书库)
   ============================================ */
.sn-library {
    padding-bottom: 20px;
    position: relative;
}

.sn-filter-bar {
    padding: 0 16px;
    margin-bottom: 8px;
}

.sn-filter-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
}

.sn-filter-scroll::-webkit-scrollbar { display: none; }

.sn-filter-tag {
    flex-shrink: 0;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sn-text-secondary);
    background: var(--sn-gray-bg);
    border: 1.5px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.sn-filter-tag.active {
    color: var(--sn-primary);
    background: var(--sn-primary-light);
    border-color: var(--sn-primary);
}

.sn-sub-tag {
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sn-text-muted);
    background: none;
    white-space: nowrap;
}

.sn-sub-tag.active {
    color: var(--sn-primary);
    background: var(--sn-primary-light);
}

/* === Tag Filter (2-row collapsed + dropdown arrow) === */
.sn-tag-filter {
    display: flex;
    align-items: flex-start;
    padding: 20px 16px 4px;
    margin-bottom: 10px;
    gap: 8px;
}
.sn-tag-filter-inner {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    max-height: 58px;
    overflow: hidden;
    transition: max-height 0.3s;
    line-height: 25px;
}
.sn-tag-item {
    display: inline-block;
    padding: 2px 0;
    font-size: 13px;
    color: var(--sn-text-secondary);
    white-space: nowrap;
    transition: color 0.2s;
    line-height: 25px;
}
.sn-tag-item.active {
    color: var(--sn-primary);
    font-weight: 700;
    background: var(--sn-primary-light);
    border-radius: 12px;
    padding: 2px 10px;
}
.sn-tag-item:hover {
    color: var(--sn-primary);
}
.sn-tag-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin-top: 29px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--sn-border);
    border-radius: 6px;
    background: var(--sn-white);
    color: var(--sn-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.sn-tag-toggle:hover {
    border-color: var(--sn-primary);
    color: var(--sn-primary);
}
.sn-tag-toggle.open svg {
    transform: rotate(180deg);
}

/* Tag dropdown overlay */
.sn-tag-dropdown {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--sn-bg);
    flex-direction: column;
}
.sn-tag-dropdown.open {
    display: flex;
}
.sn-tag-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--sn-border);
}
.sn-tag-dropdown-header span {
    font-size: 16px;
    font-weight: 700;
    color: var(--sn-text);
}
.sn-tag-dropdown-header button {
    background: none;
    border: none;
    color: var(--sn-text-muted);
    cursor: pointer;
    padding: 4px;
}
.sn-tag-dropdown-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-content: flex-start;
}
.sn-tag-dropdown-body .sn-tag-item {
    padding: 8px 4px;
    font-size: 14px;
}

/* PC: dropdown as floating panel */
/* === Pagination === */
.sn-pagination {
    padding: 16px;
    text-align: center;
}
.sn-pagination ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.sn-pagination ul li {
    display: inline-block;
}
.sn-pagination ul li a,
.sn-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sn-text-secondary);
    background: var(--sn-gray-bg);
    transition: all 0.2s;
    text-decoration: none;
}
.sn-pagination ul li a:hover {
    background: var(--sn-primary-light);
    color: var(--sn-primary);
}
.sn-pagination ul li.current span,
.sn-pagination ul li.current a {
    background: var(--sn-primary);
    color: #fff;
}
.sn-pagination ul li.firstpage a,
.sn-pagination ul li.lastpage a {
    font-size: 12px;
}
.sn-pagination ul li.sn-page-dots span {
    background: none;
    border: none;
    color: var(--sn-text-muted);
    font-size: 14px;
    min-width: 20px;
    padding: 0 2px;
    cursor: default;
}

/* === Follow Pager (prev/next for AJAX follow list) === */
.sn-follow-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
}
.sn-follow-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    font-size: 13px;
    color: var(--sn-primary);
    background: var(--sn-primary-light);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}
.sn-follow-pager-btn:hover {
    background: var(--sn-primary);
    color: #fff;
}
.sn-follow-pager-info {
    font-size: 13px;
    color: var(--sn-text-muted);
}

/* === Library Grid: H5 3cols (21 items), PC 6cols (30 items) === */
.sn-lib-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px 10px !important;
    padding: 0 16px;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}
.sn-lib-grid .sn-grid-card:nth-child(n+7) {
    display: block !important;
}
/* H5: hide items beyond 21 (7 rows × 3 cols) */
.sn-lib-grid .sn-grid-card:nth-child(n+22) {
    display: none !important;
}
.sn-grid-card { display: block; min-width: 0; }

.sn-grid-card-cover {
    border-radius: var(--sn-radius-xs);
    overflow: hidden;
    margin-bottom: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.sn-grid-card-cover .imgbox {
    border-radius: var(--sn-radius-xs);
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
}
.sn-grid-card-cover .imgbox img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sn-grid-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--sn-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 18px;
}

.sn-grid-card-author {
    font-size: 11px;
    color: var(--sn-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.sn-grid-card-meta {
    font-size: 11px;
    color: var(--sn-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}
.sn-grid-card-meta span {
    margin-left: 6px;
    color: var(--sn-text-muted);
    font-size: 10px;
}

/* ============================================
   Rank Page (排行榜)
   ============================================ */
.sn-rank-page {
    padding-bottom: 20px;
}

.sn-rank-page .sn-tabs-nav {
    margin: 0 16px 16px;
}

.sn-rank-page .sn-rank-list {
    padding: 0 16px;
}

/* ============================================
   Book Detail Page (书籍详情)
   ============================================ */
.sn-book-detail {
    padding-bottom: 80px;
}

/* Floating back button (replaces header) */
.sn-detail-back-float {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 50;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.35);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* === Book detail floating actions (top-right): search + user === */
.sn-detail-actions-float {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sn-detail-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.35);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    overflow: hidden;
}

.sn-detail-action-btn:active { transform: scale(0.94); }

.sn-detail-action-avatar { background: transparent; padding: 0; }
.sn-detail-action-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.sn-detail-content {
    padding: 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Compact top header: cover on left, info (name/author/score/intro) on right */
.sn-detail-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-left: 10px;
    margin-right: 10px;
}

.sn-detail-cover-wrap {
    flex-shrink: 0;
}

.sn-detail-cover {
    width: 96px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.sn-detail-cover .imgbox {
    border-radius: var(--sn-radius-sm);
    position: relative;
    width: 100%;
    height: 128px;
    aspect-ratio: 3 / 4;
}

.sn-detail-cover .imgbox img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sn-detail-info {
    flex: 1;
    min-width: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sn-detail-info h2 {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sn-detail-author-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: var(--sn-text-secondary);
}

/* Inline intro (placed under author line on the right of cover) */
.sn-detail-intro-wrap {
    position: relative;
    padding-right: 20px;
    margin-top: 2px;
    cursor: pointer;
}

.sn-detail-intro {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--sn-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sn-detail-intro-wrap.sn-intro-expanded .sn-detail-intro {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

/* 右下角小三角指示器 */
.sn-intro-toggle {
    position: absolute;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: var(--sn-text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
    pointer-events: none;
}

.sn-intro-toggle svg {
    display: block;
}

.sn-detail-intro-wrap.sn-intro-expanded .sn-intro-toggle {
    transform: rotate(180deg);
    color: var(--sn-primary);
}

.sn-detail-author {
    color: var(--sn-primary);
    font-weight: 600;
    text-decoration: none;
}

.sn-detail-author:hover {
    text-decoration: underline;
}

.sn-detail-dot {
    color: var(--sn-text-muted);
}

.sn-detail-status {
    color: var(--sn-text-secondary);
}

.sn-detail-score {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #f59e0b;
    font-weight: 700;
    font-size: 14px;
}

.sn-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
}

.sn-detail-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    background: linear-gradient(120deg, var(--sn-primary), var(--sn-primary-dark));
}

.sn-detail-tag.tag-color-0 { background: linear-gradient(120deg, #667eea, #764ba2); }
.sn-detail-tag.tag-color-1 { background: linear-gradient(120deg, #f093fb, #c2185b); }
.sn-detail-tag.tag-color-2 { background: linear-gradient(120deg, #4facfe, #1565c0); }
.sn-detail-tag.tag-color-3 { background: linear-gradient(120deg, #11998e, #38ef7d); }
.sn-detail-tag.tag-color-4 { background: linear-gradient(120deg, #fa709a, #d84315); }
.sn-detail-tag.tag-color-5 { background: linear-gradient(120deg, #30cfd0, #330867); }
.sn-detail-tag.tag-color-6 { background: linear-gradient(120deg, #8e44ad, #c0392b); }
.sn-detail-tag.tag-color-7 { background: linear-gradient(120deg, #ff6b6b, #ee5a6f); }
.sn-detail-tag.tag-color-8 { background: linear-gradient(120deg, #f39c12, #e67e22); }
.sn-detail-tag.tag-color-9 { background: linear-gradient(120deg, #16a085, #2980b9); }

.sn-detail-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.sn-detail-stats {
    display: flex;
    background: var(--sn-white);
    border-radius: 12px;
    padding: 12px 0;
}

.sn-stat-item {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid var(--sn-border);
}

.sn-stat-item:last-child { border-right: none; }

.sn-stat-item strong {
    font-size: 16px;
    font-weight: 700;
    color: var(--sn-text);
}

.sn-stat-item span {
    font-size: 11px;
    color: var(--sn-text-muted);
}

.sn-detail-chapters {
    background: var(--sn-white);
    border-radius: var(--sn-radius-sm);
    padding: 16px;
}

.sn-detail-chapters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sn-detail-chapters-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.sn-chapter-preview {
    display: flex;
    flex-direction: column;
}

/* 章節目錄 — 內聯分頁 (HX 風格) */
.sn-chapters-count {
    font-size: 13px;
    color: var(--sn-text-muted);
    font-weight: 500;
}

.sn-chapter-tabs {
    margin-bottom: 8px;
}

.sn-detail-chapters .sn-chapter-tabs-wrapper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
}

.sn-detail-chapters .sn-chapter-tabs-wrapper::-webkit-scrollbar { display: none; }

.sn-chapter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--sn-border);
}

.sn-chapter-name {
    font-size: 13px;
    color: var(--sn-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.sn-chapter-status {
    font-size: 11px;
    color: var(--sn-text-muted);
    flex-shrink: 0;
    margin-left: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: transparent;
    line-height: 1.4;
}

.sn-chapter-status.state-free      { background: #e8f8f0; color: #27ae60; }
.sn-chapter-status.state-free-time { background: #fef5e7; color: #e67e22; }
.sn-chapter-status.state-login     { background: #ebf5fb; color: #2980b9; }
.sn-chapter-status.state-vip       { background: #f4ecf7; color: #8e44ad; }
.sn-chapter-status.state-lock      { background: #fdedec; color: #c0392b; }
.sn-chapter-status.state-purchased { background: #e8f6f3; color: #16a085; }

/* All catalog button at bottom of latest chapters */
.sn-all-catalog-btn {
    display: block;
    text-align: center;
    margin-top: 12px;
    padding: 10px 0;
    border-radius: 22px;
    border: 1.5px solid var(--sn-primary);
    color: var(--sn-primary);
    font-size: 14px;
    font-weight: 700;
}

.sn-all-catalog-btn:active {
    background: var(--sn-primary-light);
}

/* Action Buttons (inline, above synopsis) */
.sn-detail-actions {
    display: flex;
    gap: 12px;
}

.sn-btn-read {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border-radius: 22px;
    background: var(--sn-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s;
}

.sn-btn-read:active {
    background: var(--sn-primary-dark);
}

.sn-btn-collect {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    border-radius: 22px;
    border: 1.5px solid var(--sn-border);
    background: var(--sn-white);
    color: var(--sn-text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sn-btn-collect.active {
    border-color: #fbbf24;
    color: #f59e0b;
    background: #fffbeb;
}

.sn-btn-collect:active {
    transform: scale(0.97);
}

/* Chapter List Modal */
.sn-chapter-list-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    overflow: hidden;
}

.sn-chapter-modal-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    touch-action: none;
}

.sn-chapter-modal-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 400px;
    height: 100%;
    background: var(--sn-white);
    border-radius: 0 var(--sn-radius) var(--sn-radius) 0;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.sn-chapter-list-modal.open .sn-chapter-modal-panel {
    transform: translateX(0);
}

.sn-chapter-list-modal .sn-chapter-modal-bg {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sn-chapter-list-modal.open .sn-chapter-modal-bg {
    opacity: 1;
}

.sn-chapter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--sn-border);
}

.sn-chapter-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.sn-chapter-modal-header span {
    font-size: 13px;
    color: var(--sn-text-muted);
}

.sn-chapter-modal-header button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--sn-text-secondary);
}

/* Chapter modal pagination tabs */
.sn-chapter-modal-tabs {
    padding: 10px 16px;
    border-bottom: 1px solid var(--sn-border);
    flex-shrink: 0;
}

.sn-chapter-tabs-wrapper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.sn-chapter-tabs-wrapper::-webkit-scrollbar { display: none; }

.sn-chapter-tab-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sn-text-secondary);
    background: var(--sn-gray-bg);
    border: 1.5px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.sn-chapter-tab-btn.active {
    color: var(--sn-primary);
    background: var(--sn-primary-light);
    border-color: var(--sn-primary);
}

.sn-chapter-modal-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
}

.sn-chapter-modal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.sn-chapter-modal-item:active { background: var(--sn-bg); }

/* ============================================
   Search Page (搜索)
   ============================================ */
.sn-search-page {
    min-height: 100vh;
}

.sn-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--sn-white);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sn-search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--sn-gray-bg);
    border-radius: 20px;
    padding: 0 16px 0 12px;
    height: 40px;
}

.sn-search-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--sn-text);
}

.sn-search-input-wrap input::placeholder { color: var(--sn-text-muted); }

.sn-search-submit {
    background: var(--sn-primary);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.sn-search-body { padding: 16px; }

.sn-search-section { margin-bottom: 24px; }

.sn-search-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sn-search-section-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.sn-search-section-header a {
    font-size: 13px;
    color: var(--sn-text-muted);
    cursor: pointer;
}

.sn-search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sn-search-tag {
    padding: 6px 14px;
    border-radius: 16px;
    background: var(--sn-gray-bg);
    font-size: 13px;
    color: var(--sn-text-secondary);
    cursor: pointer;
}

.sn-search-tag:active { background: var(--sn-border); }

.sn-search-results { min-height: 200px; }

.sn-search-results .sn-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sn-search-empty {
    padding: 56px 16px;
    text-align: center;
    color: var(--sn-text-muted);
    font-size: 14px;
}

/* ============================================
   User Profile Page (我的) — HX-style layout
   ============================================ */
.sn-user-page {
    padding-bottom: 20px;
    max-width: 768px;
    margin: 0 auto;
}

/* Header card */
.sn-mine-header {
    background: linear-gradient(135deg, #2D2233 0%, #3D2240 40%, #4A2050 70%, #2D2233 100%);
    border-radius: 16px;
    padding: 24px;
    margin: 12px 16px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.sn-mine-header::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.04) 40%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 60%, transparent 100%);
    animation: sn-shine 4s ease-in-out infinite;
}
@keyframes sn-shine { 0% { left: -100%; } 50%, 100% { left: 200%; } }

.sn-mine-header.sn-mine-header-unlogin {
    cursor: pointer;
    align-items: center;
    background: linear-gradient(135deg, var(--sn-primary-light), #e0e7ff);
}
.sn-mine-header.sn-mine-header-unlogin .sn-mine-info { display: flex; flex-direction: column; }
.sn-mine-unlogin-title { font-size: 20px; font-weight: bold; color: var(--sn-text); margin: 0; }
.sn-mine-unlogin-desc { font-size: 13px; color: var(--sn-text-muted); margin: 4px 0 0; }

/* Top row: avatar + name + edit */
.sn-mine-top-row {
    width: 100%; display: flex; align-items: center; gap: 14px;
    position: relative; z-index: 1;
}

/* Avatar */
.sn-mine-avatar {
    width: 56px; height: 56px;
    border-radius: 50%; overflow: hidden; flex-shrink: 0;
    border: 3px solid var(--sn-primary);
    background: var(--sn-bg);
    display: flex; align-items: center; justify-content: center;
}
.sn-mine-avatar.placeholder { border-color: #ddd; }
.sn-mine-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Name */
.sn-mine-name { font-size: 20px; font-weight: bold; color: #fff; flex: 1; min-width: 0; }
.sn-mine-edit {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.12); border-radius: 8px;
    color: var(--sn-primary); cursor: pointer; flex-shrink: 0;
}

/* Stats — below top row */
.sn-mine-stats { width: 100%; display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.sn-mine-stat-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sn-mine-stat-info { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.sn-mine-stat-info svg { flex-shrink: 0; }
.sn-mine-stat-label { font-size: 13px; color: rgba(255,255,255,0.7); flex-shrink: 0; }
.sn-mine-stat-value { font-size: 13px; font-weight: bold; color: #fff; flex-shrink: 0; }
.sn-mine-stat-btn {
    padding: 6px 14px; font-size: 13px; font-weight: 600;
    background: rgba(255,255,255,0.1); color: var(--sn-primary) !important;
    border: 1px solid var(--sn-primary); border-radius: 6px;
    white-space: nowrap; text-decoration: none;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.sn-account-alert {
    margin: 12px 16px 0;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
}
.sn-account-alert-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f97316;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    flex-shrink: 0;
}
.sn-account-alert-icon.facebook {
    background: #1877f2;
    font-family: Arial, sans-serif;
    font-size: 20px;
    font-weight: 800;
}
.sn-account-alert-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.sn-account-alert-copy strong {
    color: #9a3412;
    font-size: 14px;
    line-height: 20px;
}
.sn-account-alert-copy span {
    color: #7c2d12;
    font-size: 12px;
    line-height: 18px;
}
.sn-account-alert button {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: #f97316;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}
@media (max-width: 420px) {
    .sn-account-alert {
        align-items: flex-start;
    }
    .sn-account-alert button {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* Sign-in */
.sn-mine-signin { width: 100%; position: relative; z-index: 1; margin-top: 4px; }
.sn-signin-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.sn-signin-day {
    background: rgba(255,255,255,0.08); border-radius: 8px;
    padding: 8px 4px; display: flex; flex-direction: column;
    align-items: center; gap: 4px;
}
.sn-signin-day-name { font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 400; }
.sn-signin-day-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.sn-signin-action {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 12px;
}
.sn-signin-reward { font-size: 13px; color: rgba(255,255,255,0.7); flex: 1; }
.sn-signin-btn {
    padding: 7px 20px; font-size: 13px; font-weight: 600;
    background: var(--sn-primary); color: #fff; border: none;
    border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.sn-signin-btn:disabled { opacity: 0.5; cursor: default; }

/* Menu entries */
.sn-mine-entries {
    margin: 16px 16px 0;
    background: var(--sn-white);
    border-radius: var(--sn-radius);
    overflow: hidden;
}
.sn-mine-entry {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 16px; color: var(--sn-text); font-size: 15px;
    text-decoration: none; transition: background 0.15s;
}
.sn-mine-entry:active { background: var(--sn-bg); }
.sn-mine-entry-left { display: flex; align-items: center; gap: 14px; }
.sn-mine-entry-icon {
    width: 32px; height: 32px;
    background: var(--sn-primary-light); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--sn-primary); flex-shrink: 0;
}
.sn-mine-entry-icon.facebook {
    background: #1877f2;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    font-family: Arial, sans-serif;
}
.sn-mine-entry-icon.logout { background: #fef2f2; color: #ef4444; }
.sn-mine-entry-logout span { color: #ef4444; }

/* Mask overlay */
.sn-mask {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 999;
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 15vh;
}

/* Modal */
.sn-modal {
    background: var(--sn-white); border-radius: 16px;
    width: 90%; max-width: 440px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    animation: sn-modal-in 0.25s ease;
}
@keyframes sn-modal-in { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.sn-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--sn-border);
}
.sn-modal-header h3 { font-size: 18px; font-weight: bold; margin: 0; }
.sn-modal-close {
    width: 32px; height: 32px; border: none; background: none;
    font-size: 22px; color: #999; cursor: pointer; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.sn-modal-close:hover { background: var(--sn-bg); color: var(--sn-text); }
.sn-modal-body { padding: 20px; }
.sn-form-group { margin-bottom: 16px; }
.sn-form-group:last-child { margin-bottom: 0; }
.sn-form-group label { display: block; font-size: 14px; font-weight: 400; margin-bottom: 8px; color: var(--sn-text); }
.sn-form-input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--sn-border);
    border-radius: 8px; font-size: 14px; box-sizing: border-box;
    background: var(--sn-bg); color: var(--sn-text);
}
.sn-form-input:focus { outline: none; border-color: var(--sn-primary); }
.sn-account-modal-note {
    margin: 0 0 16px;
    color: var(--sn-text-muted);
    font-size: 13px;
    line-height: 20px;
}
.sn-modal-footer {
    display: flex; gap: 12px; padding: 16px 20px;
    border-top: 1px solid var(--sn-border);
}
.sn-modal-footer button { flex: 1; padding: 10px; border: none; border-radius: 8px; font-size: 15px; cursor: pointer; font-weight: 400; }
.sn-btn-cancel { background: var(--sn-bg); color: var(--sn-text-muted); }
.sn-btn-save { background: var(--sn-primary); color: #fff; }

/* Avatar section in edit modal */
.sn-avatar-section { display: flex; align-items: center; gap: 16px; }
.sn-current-avatar { width: 70px; height: 70px; border-radius: 50%; overflow: hidden; border: 3px solid var(--sn-primary); }
.sn-current-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sn-change-avatar-btn {
    padding: 8px 16px; background: var(--sn-primary); color: #fff;
    border: none; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.sn-avatar-library {
    margin-top: 12px; padding: 12px; background: var(--sn-bg);
    border-radius: 10px; max-height: 240px; overflow-y: auto;
}
.sn-avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sn-avatar-option {
    aspect-ratio: 1; border-radius: 50%; overflow: hidden; cursor: pointer;
    border: 3px solid transparent;
}
.sn-avatar-option.selected { border-color: var(--sn-primary); }
.sn-avatar-option img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* PC responsive */
/* ============================================
   Toast & Confirm
   ============================================ */
.sn-toast {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: rgba(0,0,0,0.78); color: #fff;
    padding: 10px 24px; border-radius: 8px;
    font-size: 14px; white-space: nowrap; z-index: 10000;
    pointer-events: none; opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
}
.sn-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.sn-confirm-mask {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.sn-confirm-mask.show { opacity: 1; }
.sn-confirm-box {
    background: var(--sn-white, #fff); border-radius: 14px;
    width: 280px; max-width: 90vw; overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    transform: scale(0.9); transition: transform 0.2s;
}
.sn-confirm-mask.show .sn-confirm-box { transform: scale(1); }
.sn-confirm-msg {
    padding: 28px 24px 20px; text-align: center;
    font-size: 15px; line-height: 1.5; color: var(--sn-text, #333);
}
.sn-confirm-btns {
    display: flex; border-top: 1px solid var(--sn-border, #eee);
}
.sn-confirm-btns button {
    flex: 1; padding: 14px 0; border: none; background: none;
    font-size: 16px; cursor: pointer; transition: background 0.15s;
}
.sn-confirm-btns button:active { background: var(--sn-bg, #f5f5f5); }
.sn-confirm-cancel { color: var(--sn-text-muted, #999); }
.sn-confirm-ok { color: var(--sn-primary, #4f46e5); font-weight: 600; border-left: 1px solid var(--sn-border, #eee) !important; }

/* ============================================
   Login Dialog (登录弹窗)
   ============================================ */
.sn-login-panel {
    position: relative;
    background: var(--sn-bg);
    border-radius: 16px;
    padding: 32px 28px 24px;
    max-width: 380px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.sn-login-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--sn-gray-bg);
    cursor: pointer;
    color: var(--sn-text-muted);
    transition: background 0.2s;
}
.sn-login-close:hover {
    background: var(--sn-border);
    color: var(--sn-text);
}

.sn-login-logo-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.sn-login-logo-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.sn-login-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--sn-text);
    margin: 0;
}

.sn-login-subtitle {
    font-size: 13px;
    color: var(--sn-text-muted);
    margin-top: -8px;
}

.sn-login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sn-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--sn-gray-bg);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0 14px;
    height: 44px;
    transition: border-color 0.2s;
}
.sn-input-group:focus-within {
    border-color: var(--sn-primary);
}

.sn-input-group input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-size: 14px;
    color: var(--sn-text);
}

.sn-input-group input::placeholder { color: var(--sn-text-muted); }

.sn-login-submit {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    background: var(--sn-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s;
}
.sn-login-submit:hover { opacity: 0.9; }
.sn-login-submit:active { background: var(--sn-primary-dark); }

.sn-login-divider {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sn-text-muted);
    font-size: 12px;
}

.sn-login-divider::before,
.sn-login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--sn-border);
}

.sn-facebook-login {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: #1877f2;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sn-facebook-login:active {
    background: #166fe5;
}

.sn-facebook-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    color: #1877f2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.sn-login-terms {
    font-size: 11px;
    color: var(--sn-text-muted);
    text-align: center;
    margin-top: 4px;
}

.sn-login-switch {
    text-align: center;
    font-size: 13px;
    color: var(--sn-text-secondary);
}
.sn-login-switch a {
    color: var(--sn-primary);
    font-weight: 600;
    cursor: pointer;
}

.sn-login-msg {
    text-align: center;
    color: #ef4444;
    font-size: 13px;
    padding: 0;
    display: none;
}

/* layer.js skin overrides for login dialog */
.layui-m-layer-sn-login-layer {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 90% !important;
    max-width: 380px !important;
}
.layui-m-layer-sn-login-layer .layui-m-layercont {
    padding: 0 !important;
}
.layui-m-layer-sn-login-layer .layui-m-layerbtn {
    display: none !important;
}
.layui-m-layer-sn-login-layer .sn-login-panel,
.layui-m-layer-sn-login-layer .sn-login-panel *,
.layui-m-layer-sn-login-layer .sn-login-panel *::before,
.layui-m-layer-sn-login-layer .sn-login-panel *::after {
    box-sizing: border-box !important;
}

/* ============================================
   History / Bookshelf Page (书架)
   ============================================ */
.sn-shelf-tabs {
    display: flex;
    gap: 0;
    padding: 0 16px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--sn-border);
}
.sn-shelf-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--sn-text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.sn-shelf-tab.active {
    color: var(--sn-primary);
    border-bottom-color: var(--sn-primary);
}
.sn-loading-placeholder {
    text-align: center;
    padding: 40px 0;
    color: var(--sn-text-muted);
    font-size: 14px;
}

.sn-history-page {
    padding-bottom: 20px;
}

.sn-history-content {
    padding: 16px;
}

.sn-history-list {
    display: flex;
    flex-direction: column;
}

.sn-history-item {
    display: flex;
    align-items: center;
}

.sn-history-link {
    flex: 1;
    display: flex;
    gap: 12px;
    padding: 12px 8px;
    align-items: center;
    border-radius: var(--sn-radius-sm);
    min-width: 0;
}

.sn-history-del {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--sn-text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}
.sn-history-del:hover {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}
.sn-history-del:active {
    color: #ef4444;
}

.sn-history-link:active { background: rgba(0,0,0,0.02); }

.sn-history-cover {
    flex-shrink: 0;
    width: 56px;
    border-radius: var(--sn-radius-xs);
    overflow: hidden;
}

.sn-history-cover .imgbox {
    border-radius: var(--sn-radius-xs);
    position: relative;
    width: 100%;
    /* H5 */
    height: 75px;
    aspect-ratio: 3 / 4;
}

.sn-history-cover .imgbox img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sn-history-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sn-history-info h3 {
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sn-history-progress {
    font-size: 12px;
    color: var(--sn-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sn-history-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--sn-gray-bg);
    border-radius: 2px;
    overflow: hidden;
}

.sn-history-progress-fill {
    height: 100%;
    background: var(--sn-primary);
    border-radius: 2px;
    transition: width 0.3s;
}

.sn-history-pct {
    font-size: 11px;
    font-weight: 400;
    color: var(--sn-text-muted);
}

.sn-history-meta {
    font-size: 12px;
    color: var(--sn-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sn-history-time {
    font-size: 11px;
    color: var(--sn-text-muted);
    opacity: 0.7;
}

.sn-history-actions {
    position: fixed;
    bottom: var(--sn-tabbar-height);
    left: 0;
    right: 0;
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--sn-white);
    border-top: 1px solid var(--sn-border);
    z-index: 50;
}

.sn-btn-select-all,
.sn-btn-delete {
    flex: 1;
    height: 40px;
    border-radius: 20px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.sn-btn-select-all {
    background: var(--sn-bg);
    color: var(--sn-text-secondary);
}

.sn-btn-delete {
    background: #ef4444;
    color: #fff;
}

/* Empty state */
.sn-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 80px 0;
    text-align: center;
}

.sn-empty p {
    font-size: 14px;
    color: var(--sn-text-muted);
}

.sn-empty-btn {
    padding: 10px 32px;
    border-radius: 20px;
    background: var(--sn-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

/* ============================================
   Cover 尺寸统一管理 (H5 在各自组件基础样式中, PC 统一在此)
   网格类封面: 纯靠 aspect-ratio: 3/4 + width:100%, 高度由宽度推导, 保证不同视口下比例一致
   非网格类 (详情/历史): 保留固定 height
   ============================================ */

/* --- PC Cover Heights (>= 768px) --- */
/* ============================================
   TY (她阅) Homepage Components
   ============================================ */

/* === Search Bar === */
.ty-search-bar {
    padding: 8px 16px 4px;
}

.ty-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--sn-gray-bg);
    border-radius: 20px;
    padding: 0 16px;
    height: 40px;
    border: 1px solid var(--sn-border);
    transition: border-color 0.2s;
}

.ty-search-form:focus-within {
    border-color: var(--sn-primary);
}

.ty-search-form input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-size: 14px;
    color: var(--sn-text);
}

.ty-search-form input::placeholder {
    color: var(--sn-text-muted);
}

/* === Quick Menu === */
.ty-quick-menu {
    display: flex;
    justify-content: space-around;
    padding: 14px 16px 14px;
}

.ty-quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.ty-quick-icon {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* 右上角高光小点 */
.ty-qi-dot {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.55);
    box-shadow: 0 0 6px rgba(255,255,255,0.6);
}

/* 五个按钮的渐变色 */
.ty-qi-rank   { background: linear-gradient(135deg, #FFA5B5 0%, #FF8FA3 100%); }
.ty-qi-finish { background: linear-gradient(135deg, #9FE5BA 0%, #6CCF93 100%); }
.ty-qi-free   { background: linear-gradient(135deg, #FFD77A 0%, #FFB545 100%); }
.ty-qi-bl     { background: linear-gradient(135deg, #D49AEC 0%, #B472D9 100%); }
.ty-qi-lib    { background: linear-gradient(135deg, #B4C2F7 0%, #8B9DEF 100%); }

.ty-quick-item:active .ty-quick-icon {
    transform: scale(0.95);
}

.ty-quick-item span {
    font-size: 12px;
    font-weight: 600;
    color: var(--sn-text);
}

/* === LINE Login Promo Banner === */
.ty-line-promo {
    padding: 8px 16px 0;
}

.ty-line-promo-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--sn-primary-light) 0%, #FFF0F3 100%);
    border-radius: var(--sn-radius);
    padding: 16px 20px;
    border: 1px solid var(--sn-border);
}

.ty-line-promo-text h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--sn-text);
    margin-bottom: 2px;
}

.ty-line-promo-text p {
    font-size: 12px;
    color: var(--sn-text-secondary);
}

.ty-line-promo-btn {
    flex-shrink: 0;
    padding: 8px 20px;
    border-radius: 20px;
    background: var(--sn-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.ty-line-promo-btn:active {
    background: var(--sn-primary-dark);
}

/* === App & LINE Promo Banner === */
.ty-app-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px;
    margin: 0 16px 20px;
    background: #fff;
    border-radius: var(--sn-radius);
    border: 1px solid var(--sn-border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    gap: 14px;
}

.ty-app-promo-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.ty-app-promo-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
}

.ty-app-promo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ty-app-promo-text {
    min-width: 0;
    text-align: left;
}

.ty-app-promo-text h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--sn-text);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ty-app-promo-text p {
    font-size: 12px;
    color: var(--sn-text-tertiary);
    margin: 4px 0 0;
    line-height: 1.4;
}

.ty-app-promo-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 12px;
    min-width: 130px;
}

.ty-app-promo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: opacity 0.2s;
}

.ty-app-promo-btn:active {
    opacity: 0.8;
}

.ty-app-promo-btn.download {
    background: var(--sn-primary);
    color: #fff;
}

.ty-app-promo-btn.line {
    background: #06C755;
    color: #fff;
    border-radius: 8px;
    height: 43px;
    padding: 0 17px;
    font-size: 16px;
    gap: 8px;
    align-self: center;
}

.ty-app-promo-btn.line svg {
    flex-shrink: 0;
    width: 19px;
    height: 19px;
}

/* Store badge button: 整张图即按钮，无背景、无内边距，按图片自然比例显示 */
.ty-app-promo-btn.store {
    background: none;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
    align-self: center;
}

.ty-app-promo-btn.store .ty-app-promo-store-img {
    height: 45px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* 超小屏（<400px）：icon 与按钮缩小约 1.5 倍 */
@media (max-width: 399px) {
    .ty-app-promo {
        padding: 10px;
    }

    .ty-app-promo-left {
        gap: 10px;
        padding-left: 10px;
    }

    .ty-app-promo-icon {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }

    .ty-app-promo-actions {
        margin-left: 0;
    }

    .ty-app-promo-btn.line {
        height: 29px;
        padding: 0 11px;
        font-size: 11px;
        gap: 5px;
    }

    .ty-app-promo-btn.line svg {
        width: 13px;
        height: 13px;
    }

    .ty-app-promo-btn.store .ty-app-promo-store-img {
        height: 30px;
    }
}

/* === Reading Continue Banner (above tabbar) === */
.ty-continue-bar {
    position: fixed;
    bottom: calc(var(--sn-tabbar-height) + 20px);
    left: 12px;
    right: 12px;
    z-index: 90;
    background: var(--sn-white);
    border: 1px solid var(--sn-border);
    border-radius: var(--sn-radius-sm);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 10px 40px 10px 12px;
}

.ty-continue-bar a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.ty-continue-bar img {
    width: 36px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.ty-continue-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ty-continue-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--sn-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ty-continue-chapter {
    font-size: 11px;
    color: var(--sn-text-secondary);
}

.ty-continue-time {
    font-size: 10px;
    color: var(--sn-text-muted);
}

.ty-continue-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 16px;
    background: var(--sn-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-right: -8px;
}

.ty-continue-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border: 1px solid var(--sn-border);
    background: var(--sn-white);
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    color: var(--sn-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* === FAB Buttons (popfqa style) === */
.ty-fab-btn {
    position: fixed;
    right: 20px;
    z-index: 91;
    width: 52px;
    height: 52px;
    background: var(--sn-white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    text-decoration: none;
    color: var(--sn-primary);
    transition: all 0.3s;
}

.ty-fab-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.ty-fab-btn svg {
    fill: var(--sn-primary);
}

.ty-fab-btn span {
    font-size: 10px;
    font-weight: 700;
    color: var(--sn-primary);
    line-height: 1;
}

.ty-fab-history {
    bottom: calc(var(--sn-tabbar-height) + 20px);
}

.ty-fab-feedback {
    transition: bottom 0.25s ease;
}

/* Feedback above banner when banner is visible */
.ty-fab-feedback.above-bar {
    bottom: calc(var(--sn-tabbar-height) + 120px);
}

/* Feedback above history bubble when banner is hidden */
.ty-fab-feedback.above-bubble {
    bottom: calc(var(--sn-tabbar-height) + 84px);
}

/* Feedback alone (no history) */
.ty-fab-feedback.alone {
    bottom: calc(var(--sn-tabbar-height) + 20px);
}

/* ============================================================
   Book Detail - Reader Comments
   ============================================================ */
.sn-detail-comments {
    background: var(--sn-white);
    border-radius: var(--sn-radius-sm);
    padding: 16px;
}

.sn-detail-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sn-detail-comments-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.sn-detail-comments-header .sn-more {
    font-size: 12px;
    color: var(--sn-primary);
}

.sn-comment-list {
    min-height: 40px;
}

.sn-comment-loading {
    text-align: center;
    padding: 16px 0;
    font-size: 12px;
    color: var(--sn-text-muted);
}

.sn-comment-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
    color: var(--sn-text-muted);
    gap: 8px;
}

.sn-comment-empty svg {
    color: var(--sn-primary-light);
}

.sn-comment-empty p {
    font-size: 13px;
}

.sn-comment-list-inner {
    display: flex;
    flex-direction: column;
}

.sn-comment-item {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid var(--sn-border);
}

.sn-comment-item:first-child {
    border-top: none;
}

.sn-comment-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--sn-gray-bg);
}

.sn-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sn-comment-body {
    flex: 1;
    min-width: 0;
}

.sn-comment-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.sn-comment-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--sn-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.sn-comment-time {
    font-size: 11px;
    color: var(--sn-text-muted);
    flex-shrink: 0;
}

.sn-comment-text {
    font-size: 13px;
    color: var(--sn-text-secondary);
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.sn-comment-loadmore {
    text-align: center;
    padding: 12px 0 4px;
}

.sn-comment-loadmore button {
    padding: 8px 20px;
    border-radius: 18px;
    border: 1px solid var(--sn-border);
    background: var(--sn-white);
    color: var(--sn-text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.sn-comment-loadmore button:active {
    background: var(--sn-gray-bg);
}

.sn-write-comment-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    padding: 10px 0;
    border-radius: 22px;
    border: 1.5px solid var(--sn-primary);
    color: var(--sn-primary);
    font-size: 14px;
    font-weight: 700;
}

.sn-write-comment-btn:active {
    background: var(--sn-primary-light);
}

/* ============================================================
   Rating Modal
   ============================================================ */
.sn-rating-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.sn-rating-modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sn-rating-modal.open .sn-rating-modal-bg {
    opacity: 1;
}

.sn-rating-modal-panel {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--sn-white);
    border-radius: 16px;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-height: 85vh;
    overflow-y: auto;
}

.sn-rating-modal.open .sn-rating-modal-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.sn-rating-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--sn-border);
}

.sn-rating-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--sn-text);
}

.sn-rating-modal-header button {
    background: none;
    border: none;
    padding: 0;
    color: var(--sn-text-muted);
    cursor: pointer;
}

.sn-rating-modal-body {
    padding: 16px;
}

.sn-rating-book-name {
    text-align: center;
    font-size: 14px;
    color: var(--sn-text-secondary);
    margin-bottom: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sn-rating-stars {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 8px;
}

.sn-rating-star {
    font-size: 28px;
    color: #e5e7eb;
    cursor: pointer;
    transition: color 0.15s;
    user-select: none;
}

.sn-rating-star.active {
    color: #f59e0b;
}

.sn-rating-value {
    text-align: center;
    font-size: 13px;
    color: var(--sn-text-muted);
    margin-bottom: 16px;
}

.sn-rating-value #currentRating {
    color: var(--sn-primary);
    font-weight: 700;
    font-size: 16px;
}

.sn-rating-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border-radius: var(--sn-radius-xs);
    border: 1px solid var(--sn-border);
    background: var(--sn-gray-bg);
    font-family: inherit;
    font-size: 14px;
    color: var(--sn-text);
    resize: none;
    outline: none;
    margin-bottom: 16px;
}

.sn-rating-textarea:focus {
    border-color: var(--sn-primary);
    background: var(--sn-white);
}

.sn-rating-actions {
    display: flex;
    gap: 12px;
}

.sn-rating-btn {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.sn-rating-btn-cancel {
    background: var(--sn-gray-bg);
    color: var(--sn-text-secondary);
}

.sn-rating-btn-submit {
    background: var(--sn-primary);
    color: #fff;
}

.sn-rating-btn-submit:active {
    background: var(--sn-primary-dark);
}

/* ============================================================
   盖楼 / 回复 / 评论元信息
   ============================================================ */

/* 顶楼评论的单行流式布局 */
.sn-comment-line {
    font-size: 13px;
    line-height: 1.6;
    color: var(--sn-text);
    word-wrap: break-word;
}

.sn-comment-line .sn-comment-name {
    color: var(--sn-text);
    font-weight: 600;
    margin-right: 0;
}

.sn-comment-colon {
    color: var(--sn-text-secondary);
    margin-right: 4px;
}

.sn-comment-text {
    color: var(--sn-text);
}

/* 元信息栏(时间 + 点赞 + 点踩 + 回复按钮 + N 条回复) */
.sn-comment-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--sn-text-muted);
}

.sn-comment-meta .sn-comment-time {
    font-size: 11px;
    color: var(--sn-text-muted);
    flex-shrink: 0;
}

.sn-comment-action {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--sn-text-muted);
    font-size: 11px;
    padding: 2px 0;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.sn-comment-action:active,
.sn-comment-action.active {
    color: var(--sn-primary);
}

.sn-comment-action.active svg {
    fill: var(--sn-primary);
    fill-opacity: 0.15;
}

.sn-like-count:empty {
    display: none;
}

.sn-comment-reply-btn {
    color: var(--sn-text-muted);
}

.sn-comment-reply-count {
    color: var(--sn-primary);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    padding: 2px 10px;
    border: 1px solid var(--sn-primary);
    border-radius: 999px;
    background: #fff;
    line-height: 1.6;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.sn-comment-reply-count:hover {
    text-decoration: none;
    border-color: var(--sn-primary-dark);
    color: var(--sn-primary-dark);
}

.sn-comment-reply-count.sn-expanded {
    color: var(--sn-primary);
    border-color: var(--sn-primary);
    background: #fff;
}

/* 楼中楼容器 */
.sn-comment-replies {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--sn-gray-bg);
    border-radius: var(--sn-radius-xs);
}

/* 楼中楼回复项 - 与顶楼类似的 avatar + body 布局,但尺寸更小 */
.sn-comment-reply-item {
    display: flex;
    gap: 8px;
    padding: 8px 0;
}

.sn-comment-reply-item + .sn-comment-reply-item {
    border-top: 1px dashed var(--sn-border);
}

.sn-comment-reply-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--sn-white);
}

.sn-comment-reply-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sn-comment-reply-body {
    flex: 1;
    min-width: 0;
}

.sn-comment-reply-line {
    font-size: 13px;
    line-height: 1.55;
    color: var(--sn-text);
    word-wrap: break-word;
}

.sn-comment-reply-name {
    color: var(--sn-text);
    font-weight: 600;
}

.sn-comment-reply-verb {
    color: var(--sn-text-muted);
    margin: 0 4px;
}

.sn-comment-reply-target {
    color: var(--sn-primary);
    font-weight: 600;
}

.sn-comment-reply-target:active {
    opacity: 0.7;
}

.sn-comment-reply-colon {
    color: var(--sn-text-secondary);
    margin-right: 4px;
}

.sn-comment-reply-text {
    color: var(--sn-text);
}

.sn-comment-reply-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--sn-text-muted);
}

.sn-comment-reply-meta .sn-comment-time {
    color: var(--sn-text-muted);
    flex-shrink: 0;
}

.sn-comment-reply-inline-btn {
    color: var(--sn-text-muted);
}

.sn-comment-reply-inline-btn:active {
    color: var(--sn-primary);
}

.sn-comment-view-all-replies {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 10px;
    font-size: 12px;
    color: var(--sn-primary);
    background: #fff;
    border: 1px solid var(--sn-primary);
    border-radius: 999px;
    line-height: 1.6;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.sn-comment-view-all-replies:hover {
    text-decoration: none;
    border-color: var(--sn-primary-dark);
    color: var(--sn-primary-dark);
}

/* 内联回复框 */
.sn-reply-box {
    margin-top: 10px;
    padding: 10px;
    background: var(--sn-primary-light);
    border-radius: var(--sn-radius-xs);
    border: 1px solid var(--sn-primary);
}

.sn-reply-hint {
    font-size: 12px;
    color: var(--sn-primary-dark);
    margin-bottom: 6px;
    padding: 4px 8px;
    background: rgba(232, 140, 165, 0.12);
    border-radius: 4px;
    font-weight: 600;
}

.sn-reply-textarea {
    width: 100%;
    min-height: 64px;
    padding: 8px 10px;
    border: 1px solid var(--sn-border);
    border-radius: var(--sn-radius-xs);
    background: var(--sn-white);
    font-family: inherit;
    font-size: 13px;
    color: var(--sn-text);
    resize: none;
    outline: none;
    line-height: 1.5;
}

.sn-reply-textarea:focus {
    border-color: var(--sn-primary);
}

.sn-reply-box-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.sn-reply-btn {
    padding: 6px 16px;
    border-radius: 16px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.sn-reply-btn-cancel {
    background: var(--sn-white);
    color: var(--sn-text-secondary);
    border: 1px solid var(--sn-border);
}

.sn-reply-btn-submit {
    background: var(--sn-primary);
    color: #fff;
}

.sn-reply-btn-submit:disabled {
    background: var(--sn-text-muted);
    cursor: not-allowed;
}

/* 段落评论:删除/举报按钮 */
.sn-comment-delete-btn {
    color: #c94a4a;
}

.sn-comment-delete-btn:active {
    color: #8b1a1a;
}

.sn-comment-report-btn {
    color: var(--sn-text-muted);
}

/* 段落评论:举报原因弹窗 */
.sn-report-dialog {
    padding: 12px 14px;
    min-width: 240px;
    max-width: 86vw;
    box-sizing: border-box;
}

.sn-report-dialog .sn-report-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--sn-text, #222);
    margin-bottom: 10px;
}

.sn-report-dialog .sn-report-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 2px;
    font-size: 13px;
    color: var(--sn-text, #222);
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sn-report-dialog .sn-report-item:last-of-type {
    border-bottom: none;
}

.sn-report-dialog .sn-report-item input[type="radio"] {
    margin: 0;
    accent-color: var(--sn-primary);
}

.sn-report-dialog .sn-report-text {
    width: 100%;
    min-height: 64px;
    margin-top: 10px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--sn-text, #222);
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.sn-report-dialog .sn-report-text:focus {
    outline: none;
    border-color: var(--sn-primary);
}

/* ============================================
   iPad 竖屏 / PC 增量层（>=768px）
   策略：
   1. 数据栅格 auto-fill 多列；不够时由 cshtml 提高 .Take(N) 补数据
   2. 强烈推荐区切到 5 卡富 grid（隐藏手机 hero+小）
   3. 轮播 center mode：中 60% + 左右各露 20% 前后图（配合 home.js trackIndex*60-20）
   PC 沿用 iPad 形态（不再做 PC 专属规则）
   ============================================ */
@media (min-width: 768px) {
    /* --- App Promo: PC 下 left 横向、文字显示、按钮横向并放大 --- */
    .ty-app-promo-left {
        flex-direction: row;
        align-items: center;
        gap: 14px;
    }

    .ty-app-promo-icon {
        width: 64px;
        height: 64px;
        border-radius: 14px;
    }

    .ty-app-promo-text {
        display: block;
    }

    .ty-app-promo-actions {
        flex-direction: row;
        align-items: center;
        min-width: 0;
        gap: 12px;
    }

    .ty-app-promo-btn.store .ty-app-promo-store-img {
        height: 46px;
    }

    .ty-app-promo-btn.line {
        height: 46px;
        padding: 0 20px;
        font-size: 15px;
        gap: 8px;
    }

    .ty-app-promo-btn.line svg {
        width: 18px;
        height: 18px;
    }

    /* --- 数据栅格：auto-fill 多列填充 --- */
    .sn-book-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .sn-popular-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 16px;
    }

    .sn-rank-list {
        gap: 8px;
    }

    .sn-rank-item {
        gap: 20px;
        padding: 16px 12px;
        min-height: 112px;
        background: rgba(255, 255, 255, 0.62);
    }

    .sn-rank-num {
        width: 40px;
        height: 40px;
        font-size: 16px;
        border-radius: 12px;
    }

    .sn-rank-cover {
        width: 66px;
        border-radius: 6px;
    }

    .sn-rank-cover .imgbox {
        height: 88px;
        border-radius: 6px;
    }

    .sn-rank-info h3 {
        font-size: 16px;
        line-height: 24px;
        margin-bottom: 8px;
    }

    .sn-rank-info .sn-book-meta {
        font-size: 13px;
        gap: 12px;
    }

    .sn-popular-list .sn-book-listitem {
        gap: 16px;
        padding: 16px 14px;
        min-height: 142px;
        background: rgba(255, 255, 255, 0.62);
        border: 1px solid rgba(229, 231, 235, 0.8);
        border-radius: 12px;
    }

    .sn-popular-list .sn-book-listitem-cover {
        width: 82px;
        border-radius: 6px;
    }

    .sn-popular-list .sn-book-listitem-cover .imgbox {
        height: 110px;
        max-height: none;
        border-radius: 6px;
    }

    .sn-popular-list .sn-book-listitem-info {
        gap: 6px;
    }

    .sn-popular-list .sn-book-listitem-info h3 {
        font-size: 16px;
        line-height: 24px;
    }

    .sn-popular-list .sn-book-desc {
        font-size: 14px;
        line-height: 21px;
    }

    .sn-popular-list .sn-book-meta {
        font-size: 13px;
        margin-top: 4px;
    }

    /* --- 新书速递：PC 全部展示，同时放大卡片 --- */
    .ty-home .sn-book-scroll {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
        gap: 18px 16px;
        overflow: visible;
        scroll-snap-type: none;
        padding-bottom: 0;
    }

    .ty-home .sn-book-scroll .sn-book-card {
        width: 100%;
    }

    .ty-home .sn-book-scroll .sn-book-card-cover {
        margin-bottom: 10px;
        border-radius: 6px;
    }

    .ty-home .sn-book-scroll .sn-book-card-cover .imgbox {
        border-radius: 6px;
    }

    .ty-home .sn-book-scroll .sn-book-card-title {
        font-size: 15px;
        line-height: 22px;
        font-weight: 700;
    }

    .ty-home .sn-featured-hero {
        gap: 22px;
        padding: 18px;
        min-height: 196px;
        border-radius: 18px;
    }

    .ty-home .sn-featured-hero-cover {
        width: 132px;
        border-radius: 8px;
    }

    .ty-home .sn-featured-hero-cover .imgbox {
        height: 176px;
        border-radius: 8px;
    }

    .ty-home .sn-featured-hero-info {
        gap: 10px;
    }

    .ty-home .sn-featured-hero-info h3 {
        font-size: 20px;
        line-height: 28px;
    }

    .ty-home .sn-featured-hero-info p {
        font-size: 15px;
        line-height: 24px;
        -webkit-line-clamp: 3;
    }

    .ty-home .sn-featured-author {
        font-size: 14px;
    }

    .sn-featured-side {
        grid-template-columns: repeat(4, 1fr);
    }
    .sn-featured-side .sn-featured-cell:nth-child(n+7) {
        display: block;
    }

    /* --- 轮播 center mode：每张占 60% + 左右各露 20%（配合 home.js） --- */
    .sn-banner-slide {
        min-width: 60%;
        transform: scale(0.9);
        opacity: 0.55;
        transition: transform 0.4s ease, opacity 0.4s ease;
    }
    .sn-banner-slide.active {
        transform: scale(1);
        opacity: 1;
    }
    .sn-banner-img {
        max-height: 240px;
    }
    .sn-banner-img img {
        object-fit: cover;
    }

    /* --- 轮播左右箭头：iPad/PC 显示，hover 浮现 --- */
    .sn-banner-arrow {
        display: flex;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.85);
        color: var(--sn-text);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        opacity: 0;
        transition: opacity 0.3s;
    }
    .sn-banner:hover .sn-banner-arrow { opacity: 1; }
    .sn-banner-arrow-left { left: 12px; }
    .sn-banner-arrow-right { right: 12px; }

    /* --- 列表卡封面高度兜底 --- */
    .sn-book-listitem-cover .imgbox {
        max-height: 180px;
    }

    /* --- 顶部 nav 与底部 tabbar 跟 .sn-main 一样锁 768 居中 --- */
    .sn-header,
    .sn-tabbar {
        left: 50%;
        right: auto;
        width: 768px;
        max-width: 100vw;
        transform: translateX(-50%);
        box-sizing: border-box;
    }

    /* --- 历史浮动条（继续阅读 ty-continue-bar）跟 .sn-main 同宽居中 --- */
    .ty-continue-bar {
        left: 50%;
        right: auto;
        width: calc(768px - 24px);
        max-width: calc(100vw - 24px);
        transform: translateX(-50%);
    }

    /* --- 反馈/历史 FAB 悬浮按钮：贴 .sn-main 容器右侧（不再贴屏幕右） --- */
    .ty-fab-btn {
        right: calc(50vw - 384px + 20px);
    }

    /* --- 书页返回按钮：贴 .sn-main 容器左侧（不再贴屏幕左） --- */
    .sn-detail-back-float {
        left: calc(50vw - 384px + 12px);
    }
    .sn-detail-actions-float {
        right: calc(50vw - 384px + 12px);
    }
}

/* ============================================================
   Facebook Login Loading Overlay
   ============================================================ */
.sn-fb-loading-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sn-fb-loading-box {
    background: #fff;
    border-radius: 12px;
    padding: 22px 28px;
    min-width: 180px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.sn-fb-loading-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid #f3f4f6;
    border-top-color: #1877f2;
    border-radius: 50%;
    margin: 0 auto 10px;
    animation: snFbSpin 0.9s linear infinite;
}

.sn-fb-loading-text {
    font-size: 14px;
    color: #4b5563;
}

@keyframes snFbSpin {
    to { transform: rotate(360deg); }
}
