/* =========================================================
   YG Novel — 详情页 / 阅读页统一版式
   作用域：.ygv   （避免与主题 bootstrap 冲突）
   ========================================================= */

:root {
    --yg-ink: #12182b;
    --yg-ink-2: #26304a;
    --yg-muted: #5b6579;
    --yg-muted-2: #77809a;
    --yg-line: #e6e9f2;
    --yg-line-2: #eef1f7;
    --yg-bg: #f4f6fb;
    --yg-card: #ffffff;
    --yg-brand: #0f8f6b;
    --yg-brand-2: #0b6f78;
    --yg-brand-soft: #e7f6f1;
    --yg-accent: #ef7d3a;
    --yg-gold: #f5a623;
    --yg-radius: 18px;
    --yg-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 14px 34px -18px rgba(16, 24, 40, .22);
}

/* 只在本页替换背景，不影响其它页面 */
body.yg-novel-body {
    background: var(--yg-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
        "Noto Sans", "Liberation Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--yg-ink);
    font-size: 16px;
}

.ygv {
    padding: 18px 16px 56px;
    color: var(--yg-ink);
}

.ygv *,
.ygv *::before,
.ygv *::after {
    box-sizing: border-box;
}

.ygv__inner {
    max-width: 1180px;
    margin: 0 auto;
}

.ygv a {
    color: inherit;
    text-decoration: none;
}

.ygv a:hover,
.ygv a:focus {
    text-decoration: none;
}

/* ---------------- 面包屑 ---------------- */
.ygv-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--yg-muted);
    margin: 4px 0 16px;
    padding: 0 2px;
}

.ygv-crumb a {
    color: var(--yg-muted);
    border-bottom: 1px solid transparent;
}

.ygv-crumb a:hover {
    color: var(--yg-brand);
    border-bottom-color: currentColor;
}

.ygv-crumb__sep {
    color: #c2c9d8;
}

.ygv-crumb__now {
    color: var(--yg-ink-2);
    font-weight: 600;
    max-width: 42ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------- Hero ---------------- */
.ygv-hero {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 32px;
    background: var(--yg-card);
    border: 1px solid var(--yg-line);
    border-radius: var(--yg-radius);
    box-shadow: var(--yg-shadow);
    padding: 26px;
    position: relative;
    overflow: hidden;
}

.ygv-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--yg-brand), #2bb3a3 45%, var(--yg-accent));
}

.ygv-hero__cover {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* 纯 CSS 文字封面：图片缺失时的漂亮替代 */
.ygv-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 220 / 300;
    border-radius: 14px;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 18% 8%, rgba(255, 255, 255, .22), transparent 58%),
        linear-gradient(158deg, #0f8f6b 0%, #0b6f78 52%, #123a56 100%);
    box-shadow: 0 18px 30px -18px rgba(11, 62, 74, .65), inset 0 0 0 1px rgba(255, 255, 255, .16);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px 18px;
    isolation: isolate;
}

.ygv-cover::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 9px;
    width: 2px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .35), transparent);
    opacity: .7;
}

.ygv-cover__mark {
    position: absolute;
    top: -14px;
    right: -6px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 156px;
    line-height: 1;
    font-weight: 700;
    color: rgba(255, 255, 255, .10);
    z-index: 0;
    pointer-events: none;
}

.ygv-cover__name {
    position: relative;
    z-index: 1;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    line-height: 1.45;
    font-weight: 700;
    letter-spacing: .2px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .28);
    max-height: 8.7em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
}

.ygv-cover__rule {
    position: relative;
    z-index: 1;
    display: block;
    width: 46px;
    height: 2px;
    margin: 16px 0 12px;
    background: rgba(255, 255, 255, .55);
    border-radius: 2px;
}

.ygv-cover__brand {
    position: relative;
    z-index: 1;
    font-size: 10.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .78);
}

.ygv-cover__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    background: #dfe4ee;
    opacity: 0;
    transition: opacity .3s ease;
}

.ygv-cover.has-img .ygv-cover__img {
    opacity: 1;
}

.ygv-cover.is-text .ygv-cover__img {
    display: none !important;
}

/* 评分 */
.ygv-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--yg-line);
    border-radius: 12px;
    background: #fbfcfe;
}

.ygv-score__stars {
    position: relative;
    font-size: 15px;
    line-height: 1;
    letter-spacing: 2px;
    white-space: nowrap;
}

.ygv-score__bg {
    color: #dde2ec;
}

.ygv-score__fg {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    overflow: hidden;
    color: var(--yg-gold);
    white-space: nowrap;
}

.ygv-score__meta {
    font-size: 13px;
    color: var(--yg-muted);
    white-space: nowrap;
}

.ygv-score__none {
    color: var(--yg-muted-2);
    font-size: 12.5px;
}

.ygv-score__meta b {
    font-size: 15px;
    color: var(--yg-ink);
}

/* 右侧主体 */
.ygv-hero__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ygv-title {
    margin: 2px 0 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    line-height: 1.28;
    font-weight: 700;
    letter-spacing: -.2px;
    color: var(--yg-ink);
    word-break: break-word;
}

.ygv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.ygv-chip {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .2px;
    line-height: 1;
}

.ygv-chip:empty {
    display: none;
}

.ygv-chip--state {
    color: #0b6b4f;
    background: var(--yg-brand-soft);
    border: 1px solid #cdece0;
}

.ygv-chip--cat {
    color: #8a4a12;
    background: #fdf1e6;
    border: 1px solid #f7ddc4;
}

.ygv-chip--cat:hover {
    background: #fbe6d3;
}

.ygv-chip--ghost {
    color: var(--yg-muted);
    background: #f5f7fb;
    border: 1px solid var(--yg-line);
}

.ygv-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 0 16px;
    margin-bottom: 4px;
    border-top: 1px dashed var(--yg-line);
    border-bottom: 1px dashed var(--yg-line);
}

.ygv-fact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ygv-fact__k {
    font-size: 11.5px;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--yg-muted-2);
    font-weight: 600;
}

.ygv-fact__v {
    font-size: 15px;
    font-weight: 600;
    color: var(--yg-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 简介 */
.ygv-desc {
    margin: 16px 0 20px;
}

.ygv-desc__h {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--yg-muted-2);
}

.ygv-desc__body {
    font-size: 16px;
    line-height: 1.78;
    color: #2b3446;
    word-break: break-word;
}

.ygv-desc__body.is-clip {
    max-height: 158px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 68%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 68%, transparent 100%);
}

.ygv-desc__body.is-open {
    max-height: none;
    -webkit-mask-image: none;
    mask-image: none;
}

.ygv-desc__more {
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--yg-brand);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}

.ygv-desc__more:hover {
    text-decoration: underline;
}

/* 按钮 */
.ygv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.ygv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
    white-space: nowrap;
}

.ygv-btn__ico {
    font-size: 12px;
    line-height: 1;
}

.ygv-btn--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--yg-brand), var(--yg-brand-2));
    box-shadow: 0 10px 22px -12px rgba(11, 111, 120, .9);
}

.ygv-btn--primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -12px rgba(11, 111, 120, .95);
}

.ygv-btn--ghost {
    color: var(--yg-ink-2);
    background: #fff;
    border-color: var(--yg-line);
}

.ygv-btn--ghost:hover {
    color: var(--yg-brand);
    border-color: #bfe3d7;
    background: #f7fdfb;
}

.ygv-btn--soft {
    color: var(--yg-ink-2);
    background: #f5f7fb;
    border-color: var(--yg-line);
}

.ygv-btn--soft:hover {
    background: #eef2f9;
}

.ygv-btn--soft.is-on {
    color: #b4482a;
    background: #fdf0ea;
    border-color: #f6d5c6;
}

.ygv-btn.is-disabled,
.ygv-btn[aria-disabled="true"] {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

/* ---------------- 双栏 ---------------- */
.ygv-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 22px;
    margin-top: 22px;
    align-items: start;
}

.ygv-card {
    background: var(--yg-card);
    border: 1px solid var(--yg-line);
    border-radius: var(--yg-radius);
    box-shadow: var(--yg-shadow);
    padding: 22px 24px;
}

.ygv-card + .ygv-card {
    margin-top: 22px;
}

.ygv-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ygv-card__head--tight {
    margin-bottom: 10px;
}

.ygv-card__title {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--yg-ink);
    letter-spacing: -.1px;
}

.ygv-count {
    color: var(--yg-muted-2);
    font-weight: 600;
    font-size: 14px;
}

/* 排序切换 */
.ygv-dir {
    display: inline-flex;
    padding: 3px;
    background: #f2f5fa;
    border-radius: 10px;
}

.ygv-dir__btn {
    border: 0;
    background: none;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--yg-muted);
    border-radius: 8px;
    cursor: pointer;
}

.ygv-dir__btn.is-active {
    background: #fff;
    color: var(--yg-brand);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}

/* 搜索 */
.ygv-chap__filter {
    margin-bottom: 12px;
}

.ygv-chap__filter input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--yg-line);
    border-radius: 11px;
    background: #fbfcfe;
    font-size: 14.5px;
    color: var(--yg-ink);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.ygv-chap__filter input::placeholder {
    color: #98a1b5;
}

.ygv-chap__filter input:focus {
    background: #fff;
    border-color: #9fd8c7;
    box-shadow: 0 0 0 4px rgba(15, 143, 107, .10);
}

/* 章节列表 */
.ygv-chap__list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: chap;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ygv-chap__item {
    counter-increment: chap;
    min-width: 0;
}

.ygv-chap__item.is-hidden {
    display: none;
}

.ygv-chap__link {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--yg-line-2);
    border-radius: 11px;
    background: #fcfdff;
    transition: border-color .15s ease, background .15s ease, transform .12s ease;
}

.ygv-chap__link:hover {
    background: #f6fbf9;
    border-color: #c9e8dd;
    transform: translateX(1px);
}

.ygv-chap__no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #eef3f9;
    color: #55627c;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ygv-chap__no::before {
    content: counter(chap);
}

.ygv-chap__link:hover .ygv-chap__no {
    background: var(--yg-brand-soft);
    color: #0b6b4f;
}

.ygv-chap__name {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--yg-ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ygv-chap__date {
    font-size: 12px;
    color: var(--yg-muted-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ygv-chap__empty {
    margin: 6px 0 0;
    padding: 22px 18px;
    border: 1px dashed #d7dfec;
    border-radius: 12px;
    background: #fbfcff;
    color: var(--yg-muted);
    font-size: 14.5px;
    line-height: 1.75;
    text-align: center;
}

.ygv-chap__foot {
    margin-top: 14px;
    text-align: center;
}

/* 说明卡 */
.ygv-note p {
    margin: 0 0 10px;
    font-size: 15px;
    line-height: 1.8;
    color: #2b3446;
}

.ygv-note p:last-child {
    margin-bottom: 0;
}

.ygv-note a {
    color: var(--yg-brand);
    font-weight: 600;
    border-bottom: 1px solid rgba(15, 143, 107, .3);
}

.ygv-note b {
    color: var(--yg-ink);
}

/* ---------------- 侧栏 ---------------- */
.ygv-side {
    padding: 18px 20px;
}

.ygv-side__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ygv-mini {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--yg-line-2);
}

.ygv-mini:last-child {
    border-bottom: 0;
}

/* 侧栏缩略图：图片缺失时显示首字 CSS 色块 */
.ygv-mini__thumb {
    position: relative;
    width: 46px;
    height: 62px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(155deg, #12826f, #0d5f74 60%, #1b3d5c);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px -8px rgba(13, 70, 84, .8);
}

.ygv-mini__letter {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 700;
    color: rgba(255, 255, 255, .92);
    line-height: 1;
}

.ygv-mini__thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .3s ease;
}

.ygv-mini__thumb.has-img img {
    opacity: 1;
}

.ygv-mini__thumb.is-text img {
    display: none;
}

.ygv-mini__body {
    min-width: 0;
}

.ygv-mini__name {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
}

.ygv-mini__name a {
    color: var(--yg-ink-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ygv-mini__name a:hover {
    color: var(--yg-brand);
}

.ygv-mini__meta {
    font-size: 12px;
    color: var(--yg-muted-2);
    font-variant-numeric: tabular-nums;
}

.ygv-info {
    margin: 0;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 9px 10px;
    font-size: 13.5px;
    line-height: 1.6;
}

.ygv-info dt {
    color: var(--yg-muted-2);
    font-weight: 500;
}

.ygv-info dd {
    margin: 0;
    color: var(--yg-ink-2);
    font-weight: 600;
    word-break: break-word;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 991px) {
    .ygv-hero {
        grid-template-columns: 172px minmax(0, 1fr);
        gap: 22px;
        padding: 20px;
    }

    .ygv-title {
        font-size: 24px;
    }

    .ygv-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 10px;
    }

    .ygv-cols {
        grid-template-columns: minmax(0, 1fr);
    }

    .ygv-col-side {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .ygv-col-side .ygv-card + .ygv-card {
        margin-top: 0;
    }
}

@media (max-width: 640px) {
    .ygv {
        padding: 12px 12px 44px;
    }

    .ygv-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding: 18px;
        border-radius: 16px;
    }

    .ygv-hero__cover {
        flex-direction: row;
        align-items: center;
        gap: 14px;
    }

    .ygv-cover {
        width: 116px;
        flex: 0 0 116px;
        padding: 12px 10px;
    }

    .ygv-cover__mark {
        font-size: 84px;
        top: -8px;
    }

    .ygv-cover__name {
        font-size: 13px;
        -webkit-line-clamp: 4;
    }

    .ygv-cover__rule {
        margin: 8px 0 6px;
        width: 28px;
    }

    .ygv-cover__brand {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .ygv-score {
        flex: 1 1 auto;
        min-width: 0;
        padding: 9px 10px;
    }

    .ygv-title {
        font-size: 21px;
        margin-bottom: 10px;
    }

    .ygv-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px 0;
    }

    .ygv-fact__v {
        font-size: 14px;
    }

    .ygv-desc__body {
        font-size: 15.5px;
    }

    .ygv-btn {
        flex: 1 1 calc(50% - 6px);
        padding: 0 12px;
        font-size: 13.5px;
    }

    .ygv-chap__list {
        grid-template-columns: minmax(0, 1fr);
    }

    .ygv-card {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .ygv-col-side {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* 深色系统的极浅适配：避免白底刺眼时文本仍清晰 */
@media (prefers-contrast: more) {
    .ygv-fact__k,
    .ygv-mini__meta,
    .ygv-chap__date,
    .ygv-info dt {
        color: #3d4759;
    }
}
