.reader-update-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 5px 11px;
    border: 1px solid #efd6d7;
    border-radius: 3px;
    background: #fff6f6;
    color: #984149;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
    cursor: pointer;
}
.reader-update-button::before {
    content: '';
    flex: none;
    width: 16px;
    height: 16px;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 4v5h-5M20 9a8 8 0 1 0 .1 5'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (hover: hover) {
    .reader-update-button:not(:disabled):hover { background: #ffeded; border-color: #e9b7bb; color: #a1242d; }
}
@media (max-width: 480px) {
    .reader-update-button { min-height: 32px; padding-inline: 8px; font-size: 13px; }
    .reader-update-button::before { width: 14px; height: 14px; }
}
.reader-update-button:disabled { opacity: .65; cursor: wait; }
.reader-update-button:focus-visible { outline: 2px solid #a1242d; outline-offset: 2px; }
.reader-update-actions { flex-wrap: wrap; align-items: center; row-gap: 4px; }

.pt-bookdetail-btn.reader-update-desktop-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 20px;
}
.reader-update-desktop-actions .reader-update-button,
.pt-bookdetail-btn.reader-update-desktop-actions > a,
.pt-bookdetail-btn.reader-update-desktop-actions .reader-update-booklist-group > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 36px;
    min-height: 36px;
    margin-right: 0;
    line-height: 1.4;
}
.reader-update-desktop-actions .reader-update-button { min-width: 100px; }
.reader-update-desktop-actions .reader-update-booklist-group { display: inline-flex; position: relative; }
.reader-update-desktop-actions .reader-update-booklist-group #btn-add-booklist { margin-left: -1px !important; }
.reader-update-desktop-actions .reader-update-booklist-group .box-booklist { top: 100%; right: 0; }

.reader-update-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    height: fit-content;
    width: min(420px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    overflow: auto;
    box-sizing: border-box;
    padding: 22px;
    border: 1px solid #eedadc;
    border-radius: 14px;
    background: #fff;
    color: #282126;
    box-shadow: 0 16px 52px #2720273b;
    font: 14px/1.5 system-ui, sans-serif;
}
.reader-update-dialog::backdrop { background: #221c23a0; }
.reader-update-dialog .reader-update-header { padding-bottom: 16px; border-bottom: 1px solid #f0e7e9; }
.reader-update-dialog h2 { margin: 0 0 6px; color: #282126; font: 700 21px/1.35 system-ui, sans-serif; }
.reader-update-dialog p { margin: 0; color: #655960; }
.reader-update-dialog #reader-update-description { font-size: 14px; line-height: 1.65; }
.reader-update-dialog .reader-update-intro { color: #756971; font-size: 13px; }
.reader-update-dialog a:any-link { color: #a1242d; text-decoration: underline; }
.reader-update-dialog ol { list-style: none; margin: 20px 0; padding: 0; }
.reader-update-dialog [hidden] { display: none; }
.reader-update-dialog li { position: relative; padding: 0 0 17px 34px; color: #756971; }
.reader-update-dialog li:last-child { padding-bottom: 0; }
.reader-update-dialog li::before {
    content: ''; position: absolute; left: 0; top: 0; width: 21px; height: 21px;
    box-sizing: border-box; border-radius: 50%; border: 2px solid #ddc9cd; background: #fff;
}
.reader-update-dialog li:not(:last-child)::after {
    content: ''; position: absolute; left: 10px; top: 23px; bottom: -1px; border-left: 1px solid #ecdfe2;
}
.reader-update-dialog li[data-state="done"] { color: #34282e; }
.reader-update-dialog li[data-state="done"]::before {
    content: '✓'; display: grid; place-items: center;
    border: 0; color: #28634f; background: #e5f2ec; font: 700 14px/1 system-ui, sans-serif;
}
.reader-update-dialog li[data-state="error"]::before {
    content: '!'; display: grid; place-items: center;
    border: 0; color: #a1242d; background: #fae8ea; font: 700 14px/1 system-ui, sans-serif;
}
.reader-update-dialog li[data-state="active"] { color: #a1242d; font-weight: 700; }
.reader-update-dialog li[data-state="active"]::before {
    border-color: #a1242d; animation: reader-update-pulse 1.3s ease-out infinite;
}
@keyframes reader-update-pulse {
    from { box-shadow: 0 0 0 0 #bf3c4c60; }
    to { box-shadow: 0 0 0 8px #bf3c4c00; }
}
@media (prefers-reduced-motion: reduce) {
    .reader-update-dialog li[data-state="active"]::before { animation: none; }
}
.reader-update-controls { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.reader-update-controls button {
    min-height: 40px; padding: 7px 14px; border: 1px solid #e6cbd0; border-radius: 7px;
    background: #fff; color: #625359; font: 600 14px/1.4 system-ui, sans-serif; cursor: pointer;
}
.reader-update-controls button + button { background: #a1242d; border-color: #a1242d; color: #fff; }
.reader-update-controls button:disabled { background: #f4ecee; border-color: #ecdee1; color: #75666c; cursor: default; }
.reader-update-controls button:focus-visible { outline: 2px solid #a1242d; outline-offset: 2px; }
.reader-update-dialog .reader-update-controls a:not([hidden]) {
    display: inline-flex; align-items: center; justify-content: center;
    box-sizing: border-box; min-height: 40px; padding: 7px 14px;
    border: 1px solid #e6cbd0; border-radius: 7px;
    color: #a1242d; text-decoration: none; font-weight: 600;
}
.reader-update-dialog .reader-update-controls .reader-update-login:not([hidden]) {
    background: #a1242d; border-color: #a1242d; color: #fff;
}
.reader-update-dialog .reader-update-result[data-result="login_required"] { margin-top: 14px; }
.reader-update-dialog .reader-update-result {
    padding: 11px 13px;
    border-radius: 8px;
    background: #f6f2f3;
    color: #493a42;
    overflow-wrap: anywhere;
}
.reader-update-dialog .reader-update-result[data-result="updated"] { background: #eaf4ef; color: #235640; }
.reader-update-dialog .reader-update-refresh {
    padding: 3px 0; border: 0; background: none; color: inherit;
    font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer;
}
.reader-update-dialog .reader-update-refresh:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (max-width: 480px) {
    .reader-update-controls button { flex: 1; min-height: 44px; }
    .reader-update-dialog[data-mode="login"] .reader-update-controls { gap: 8px; }
    .reader-update-dialog[data-mode="login"] .reader-update-controls button,
    .reader-update-dialog[data-mode="login"] .reader-update-controls a:not([hidden]) {
        flex: 0 0 auto; min-height: 44px; padding-inline: 12px;
    }
}

.reader-end-update { padding: 18px 15px 22px; background: #fff; text-align: center; }
.reader-end-update p { margin: 0 0 14px; color: #777; font-size: 14px; line-height: 1.7; }
.reader-end-update .reader-update-button { min-height: 40px; padding: 8px 20px; }
.reader-update-destinations { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.reader-update-destinations a:any-link { display: inline-flex; justify-content: center; align-items: center; flex: 1; min-height: 40px; padding: 8px 12px; border: 1px solid #efd6d7; border-radius: 3px; background: #fff6f6; color: #984149; text-decoration: none; }

/* 阅读尾页：将书名、阅读进度和检查更新组织为一个完整区域。 */
.reader-end-panel { box-sizing: border-box; padding: 40px 20px 36px; background: #fff; text-align: center; color: #323237; }
.reader-end-panel .reader-end-book { display: block; max-width: 600px; margin: 0 auto 10px; color: #81818a; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.reader-end-panel h1 { margin: 0; padding: 0; color: #323237; font-size: 26px; font-weight: 600; line-height: 1.5; }
.reader-end-panel .reader-end-description { margin: 14px 0 0; color: #777780; font-size: 15px; line-height: 1.9; }
.reader-end-panel .reader-end-update { padding: 0; margin: 24px 0 0; background: transparent; }
.reader-end-panel .reader-update-button { min-width: 164px; height: 44px; padding: 0 22px; border: 1px solid #ff5555; border-radius: 5px; background: #ff5555; color: #fff; font-size: 15px; font-weight: 500; }
.reader-end-panel .reader-update-button:not(:disabled):hover { background: #ed4747; border-color: #ed4747; color: #fff; }
.reader-end-panel a:focus-visible { outline: 2px solid #ff5555; outline-offset: 4px; }
.reader-end-dialog .reader-update-destinations a:any-link { min-height: 42px; border-radius: 5px; font-size: 14px; }
.reader-end-dialog .reader-update-destinations a:last-child { background: #ff5555; border-color: #ff5555; color: #fff; }
@media (max-width: 600px) {
    .reader-end-panel { padding: 28px 18px 30px; }
    .reader-end-panel h1 { font-size: 21px; }
    .reader-end-panel .reader-end-book { font-size: 13px; margin-bottom: 8px; }
    .reader-end-panel .reader-end-description { font-size: 14px; margin-top: 12px; line-height: 1.85; }
    .reader-end-panel .reader-end-update { margin-top: 20px; }
}

.reader-end-panel .reader-end-title-link:any-link { color: inherit; text-decoration: none; }
.reader-end-panel .reader-end-title-link:hover { color: #ff5555; }

/* 尾页推荐列表不继承阅读正文的两倍行高，长作者名不撑高卡片。 */
.reader-end-recommendations .pt-featured-list li { vertical-align: top; }
.reader-end-recommendations .pt-featured-list .pt-featured-list-cont { display: flex; flex-direction: column; height: 160px; line-height: 1.5; }
.reader-end-recommendations .pt-featured-list-cont > div:first-child { flex: none; line-height: 24px; }
.reader-end-recommendations .pt-featured-list-cont > div:nth-child(2) { flex: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 20px; }
.reader-end-recommendations .pt-featured-list .pt-featured-list-cont-intro { flex: 1; min-height: 0; height: auto; max-height: 60px; margin-top: 6px; margin-bottom: 8px; line-height: 20px; -webkit-line-clamp: 3; }
.reader-end-recommendations .pt-featured-list-cont > div:last-child { flex: none; margin-top: auto; line-height: 22px; }

/* 手机尾页推荐：书名独占一行，作者、分类和人数放在第二行。 */
.reader-end-mobile-recommendations .reader-end-rec-content { min-width: 0; }
.reader-end-mobile-recommendations .reader-end-rec-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.5; }
.reader-end-mobile-recommendations .reader-end-rec-meta { display: flex; align-items: center; gap: 7px; min-width: 0; margin-top: 5px; line-height: 20px; }
.reader-end-mobile-recommendations .reader-end-rec-author { flex: 1 1 0; min-width: 0; max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-end-mobile-recommendations .reader-end-rec-category { flex: 0 1 auto; min-width: 0; max-width: 4em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-end-mobile-recommendations .reader-end-rec-count { flex: none; margin-left: auto; white-space: nowrap; }
.reader-end-mobile-recommendations .reader-end-rec-intro { margin-top: 8px; line-height: 1.5; }

/* 尾页推荐封面等比例放大，容纳右侧标题、资料与两行简介。 */
.reader-end-mobile-recommendations .pt-recomment-item > a { flex: none; }
.reader-end-mobile-recommendations .pt-recomment-item img { width: max(20vw, 78px); height: auto; aspect-ratio: 16.93 / 22.67; object-fit: cover; display: block; }

/* PC尾页推荐两列；作者、分类、追读人数共用一行。 */
.pt-read-cont .reader-end-recommendations { box-sizing: border-box; width: 100%; padding: 10px 40px 35px; }
.reader-end-recommendations .pt-featured-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 36px; width: 100%; margin: 0; }
.reader-end-recommendations .pt-featured-list::before,
.reader-end-recommendations .pt-featured-list::after { display: none; }
.reader-end-recommendations .pt-featured-list li { display: flex; width: auto; height: auto; padding: 0; gap: 20px; min-width: 0; }
.reader-end-recommendations .pt-featured-list li > a { flex: none; }
.reader-end-recommendations .pt-featured-list li img { float: none; display: block; margin: 0; }
.reader-end-recommendations .pt-featured-list .pt-featured-list-cont { flex: 1; min-width: 0; width: auto; float: none; }
.reader-end-recommendations .pt-featured-list-cont > .reader-end-pc-meta { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.reader-end-recommendations .reader-end-pc-author { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-end-recommendations .reader-end-pc-category,
.reader-end-recommendations .reader-end-pc-count { flex: none; white-space: nowrap; }
.reader-end-recommendations .pt-featured-list .pt-featured-list-cont-intro { width: 100%; }

