/* 作品列表样式（搜索 / 归档 / 分类页）。卡片复用 story.css 的 .novel-frame-related-* 样式族 */

/* 归档筛选工具条 */

.novel-frame-archive-toolbar {
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.novel-frame-archive-stats {
    font-size: 13px;
    opacity: .7;
}

.novel-frame-archive-stats strong {
    color: #0469d0;
    font-weight: 700;
    margin: 0 2px;
}

/* 搜索行：搜索框 + 搜索按钮 + 筛选按钮 */
.novel-frame-archive-search {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin: 0;
}

.novel-frame-search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.novel-frame-search-input-wrap .fa {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: .45;
    pointer-events: none;
}

.novel-frame-search-input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 38px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 8px;
    background: rgba(0, 0, 0, .02);
    font-size: 13.5px;
    color: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.novel-frame-search-input:focus {
    border-color: #0469d0;
    background: var(--main-bg-color, #fff);
    box-shadow: 0 0 0 3px rgba(4, 105, 208, .1);
}

/* 覆盖父主题 .but 的默认外间距 / 高度，统一与 search input 对齐 */
.novel-frame-archive-search .but {
    height: 40px;
    line-height: 38px;
    padding: 0 18px;
    font-size: 13.5px;
    border-radius: 8px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.novel-frame-filter-toggle {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, .12);
    color: inherit;
}

.novel-frame-filter-toggle.is-open,
.novel-frame-filter-toggle:hover {
    border-color: #0469d0;
    color: #0469d0;
}

.novel-frame-filter-toggle .fa {
    font-size: 13px;
}

/* 筛选面板 */

.novel-frame-archive-filter {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 18px;
    background: rgba(4, 105, 208, .03);
    border: 1px solid rgba(4, 105, 208, .08);
    border-radius: 10px;
}

.novel-frame-archive-filter[hidden] {
    display: none;
}

.novel-frame-filter-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.novel-frame-filter-label {
    flex: 0 0 auto;
    min-width: 64px;
    font-size: 13px;
    font-weight: 600;
    line-height: 26px;
    opacity: .85;
}

.novel-frame-chip-list {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

/* chip：未激活浅灰底，激活主色 */
.novel-frame-filter-chip {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 12px;
    font-size: 12.5px;
    color: inherit;
    background: rgba(0, 0, 0, .04);
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.novel-frame-filter-chip:hover {
    background: rgba(4, 105, 208, .08);
    color: #0469d0;
    text-decoration: none;
    transform: translateY(-1px);
}

.novel-frame-filter-chip.is-active,
.novel-frame-filter-chip.is-active:hover {
    background: #0469d0;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(4, 105, 208, .28);
    transform: none;
}

/* 排序方向 chip 的图标与文字间距（目前只有 升序/降序 chip 内带 <i>） */
.novel-frame-filter-chip > i {
    margin-right: 4px;
    font-size: 11px;
}

/* 「仅显示已完结」开关：利用 checkbox 原生 checked，外观用纯 CSS */
.novel-frame-filter-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-left: 0;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    line-height: 1;
}

.novel-frame-filter-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.novel-frame-filter-switch-ui {
    position: relative;
    flex: 0 0 auto;
    width: 36px;
    height: 20px;
    background: rgba(0, 0, 0, .14);
    border-radius: 999px;
    transition: background-color .2s ease;
}

.novel-frame-filter-switch-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .2s ease;
}

.novel-frame-filter-switch input:checked + .novel-frame-filter-switch-ui {
    background: #0469d0;
}

.novel-frame-filter-switch input:checked + .novel-frame-filter-switch-ui::after {
    transform: translateX(16px);
}

.novel-frame-filter-switch input:focus-visible + .novel-frame-filter-switch-ui {
    box-shadow: 0 0 0 3px rgba(4, 105, 208, .25);
}

.novel-frame-filter-switch-text {
    opacity: .85;
}

.novel-frame-filter-switch:hover .novel-frame-filter-switch-text {
    opacity: 1;
}

/* 响应式：筛选工具条 */

@media (max-width: 768px) {
    .novel-frame-archive-search {
        flex-wrap: wrap;
    }
    .novel-frame-search-input-wrap {
        flex: 1 1 100%;
    }
    .novel-frame-archive-search .but {
        flex: 1 1 auto;
        justify-content: center;
    }
    .novel-frame-filter-label {
        min-width: 0;
        flex-basis: 100%;
    }
}

@media (max-width: 480px) {
    .novel-frame-archive-toolbar {
        padding: 12px;
    }
    .novel-frame-archive-filter {
        padding: 12px;
    }
}

/* 暗色：筛选工具条 */

body.dark-theme .novel-frame-search-input {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .1);
}

body.dark-theme .novel-frame-search-input:focus {
    background: rgba(255, 255, 255, .06);
    border-color: #5ea8ff;
    box-shadow: 0 0 0 3px rgba(94, 168, 255, .15);
}

body.dark-theme .novel-frame-filter-toggle {
    border-color: rgba(255, 255, 255, .14);
}

body.dark-theme .novel-frame-filter-toggle.is-open,
body.dark-theme .novel-frame-filter-toggle:hover {
    border-color: #5ea8ff;
    color: #5ea8ff;
}

body.dark-theme .novel-frame-archive-filter {
    background: rgba(94, 168, 255, .06);
    border-color: rgba(94, 168, 255, .12);
}

body.dark-theme .novel-frame-filter-chip {
    background: rgba(255, 255, 255, .06);
}

body.dark-theme .novel-frame-filter-chip:hover {
    background: rgba(94, 168, 255, .18);
    color: #9ec5ff;
}

body.dark-theme .novel-frame-filter-chip.is-active,
body.dark-theme .novel-frame-filter-chip.is-active:hover {
    background: #1f6fd8;
    box-shadow: 0 2px 8px rgba(31, 111, 216, .4);
}

body.dark-theme .novel-frame-filter-switch-ui {
    background: rgba(255, 255, 255, .18);
}

body.dark-theme .novel-frame-filter-switch input:checked + .novel-frame-filter-switch-ui {
    background: #1f6fd8;
}

/* 归档页面头 */

.novel-frame-archive-header {
    padding: 20px 22px;
    margin-bottom: 16px;
}

.novel-frame-archive-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    position: relative;
    padding-left: 12px;
}

.novel-frame-archive-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    border-radius: 2px;
    background: #0469d0;
}

.novel-frame-archive-subtitle {
    margin: 8px 0 0;
    padding-left: 12px;
    font-size: 13px;
    opacity: .65;
}

.novel-frame-archive-desc {
    margin: 10px 0 0;
    padding-left: 12px;
    font-size: 13px;
    opacity: .8;
    line-height: 1.6;
}

/* 归档头嵌入「访问受限」提示时收紧标题区下边距 */
.novel-frame-archive-restricted {
    margin-top: 14px;
    padding: 24px 20px;
}

/* 列表外层包裹 */

.novel-frame-story-list {
    padding: 16px 18px;
}

.novel-frame-search-results {
    /* 当作为 search tab 内容容器时去掉父主题 zib-widget 的 padding 重复 */
    padding: 0;
}

/* 列表网格 */

.novel-frame-story-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

/* li 用 flex 让内部 <a> 卡片撑满高度，配合下方 stats margin-top:auto 实现同行底对齐 */
.novel-frame-story-card-item {
    min-width: 0;
    display: flex;
}

.novel-frame-story-card-item > .novel-frame-story-card--list {
    width: 100%;
}

/* 列表卡片美化（仅 .novel-frame-story-card--list，related 保持原样）
   极简快看风：封面顶格 + 胶囊角标 / 章节徽章 / hover 简介浮层；信息区仅「标题 + 作者」 */

.novel-frame-story-card--list {
    position: relative;
    padding: 0;
    gap: 0;
    overflow: hidden;
    background: var(--main-bg-color, #fff);
    border: 0;
    border-radius: 0;
    box-shadow:
        0 1px 2px rgba(17, 24, 39, .04),
        0 2px 8px rgba(17, 24, 39, .05);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1),
                box-shadow .3s cubic-bezier(.4, 0, .2, 1);
}

.novel-frame-story-card--list:hover {
    transform: translateY(-4px);
    box-shadow:
        0 4px 12px rgba(4, 105, 208, .1),
        0 18px 36px rgba(4, 105, 208, .14);
}

/* 封面：顶格贴到卡片两侧，取消基础 6px 圆角；hover 时图片缓慢放大 */
.novel-frame-story-card--list .novel-frame-related-thumb {
    border-radius: 0;
    background: #f3f4f6;
}

.novel-frame-story-card--list .novel-frame-related-thumb img {
    transition: transform .6s cubic-bezier(.2, 0, .2, 1);
}

.novel-frame-story-card--list:hover .novel-frame-related-thumb img {
    transform: scale(1.08);
}

/* 底部渐变遮罩：给左下章节徽章提供深色底衬 */
.novel-frame-story-card__shade {
    position: absolute;
    inset: auto 0 0 0;
    height: 45%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, .15) 40%,
        rgba(0, 0, 0, .55) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* 类型角标：封面右上角，玻璃态渐变胶囊 */
.novel-frame-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .5px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}

.novel-frame-card-badge--novel {
    background: linear-gradient(135deg, rgba(37, 99, 235, .94) 0%, rgba(4, 105, 208, .94) 100%);
}

.novel-frame-card-badge--comic {
    background: linear-gradient(135deg, rgba(249, 115, 22, .94) 0%, rgba(208, 88, 27, .94) 100%);
}

/* 章节徽章：封面左下角，玻璃态 */
.novel-frame-story-card__chapters {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .3px;
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: none;
}

.novel-frame-story-card__chapters i {
    font-size: 11px;
    opacity: .95;
}

.novel-frame-story-card__chapters.is-serializing {
    color: #ecfeff;
    background: rgba(6, 182, 212, .28);
    border-color: rgba(103, 232, 249, .48);
}

/* 已完结态：金色玻璃变体，让读者一眼识别「可一口气读完」 */
.novel-frame-story-card__chapters.is-completed {
    color: #fff8e1;
    background: rgba(234, 179, 8, .32);
    border-color: rgba(253, 224, 71, .55);
}

/* 占位封面：按类型差异化渐变 + 中心 icon + 下方类型文字 */
.novel-frame-related-thumb-placeholder--novel,
.novel-frame-related-thumb-placeholder--comic {
    flex-direction: column;
    gap: 14px;
    opacity: 1;
    font-size: 0;
}

.novel-frame-related-thumb-placeholder--novel {
    background: linear-gradient(135deg, #eef4ff 0%, #c7ddff 100%);
    color: rgba(37, 99, 235, .55);
}

.novel-frame-related-thumb-placeholder--comic {
    background: linear-gradient(135deg, #fff1e6 0%, #ffd2b3 100%);
    color: rgba(208, 88, 27, .6);
}

.novel-frame-related-thumb-placeholder--novel i,
.novel-frame-related-thumb-placeholder--comic i {
    font-size: 40px;
    line-height: 1;
    opacity: .75;
}

.novel-frame-related-thumb-placeholder--novel em,
.novel-frame-related-thumb-placeholder--comic em {
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 4px;
    opacity: .7;
}

/* 信息区：极简快看风只渲染「标题 + 作者」两行，收紧 padding / gap 减少视觉空旷 */
.novel-frame-story-card--list .novel-frame-related-info {
    flex: 1 1 auto;
    gap: 4px;
    padding: 11px 14px 13px;
}

/* 标题 */
.novel-frame-story-card--list .novel-frame-related-name {
    margin: 0;
    color: #1f2937;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    transition: color .2s ease;
}

.novel-frame-story-card--list:hover .novel-frame-related-name {
    color: #0469d0;
}

/* Hover 简介浮层：从封面底部滑出半透明深色遮罩；
   空简介时 PHP 直接不输出 DOM，无需 CSS 兜底。
   z-index:3 盖过 __shade(1) 与 card-badge/__chapters(2)，hover 时视觉焦点聚焦简介。 */
.novel-frame-story-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    padding: 14px;
    background: linear-gradient(180deg,
        rgba(15, 23, 42, 0) 0%,
        rgba(15, 23, 42, .35) 35%,
        rgba(15, 23, 42, .92) 100%);
    opacity: 0;
    transform: translateY(18%);
    transition: opacity .35s cubic-bezier(.4, 0, .2, 1),
                transform .35s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none;
}

.novel-frame-story-card--list:hover .novel-frame-story-card__overlay {
    opacity: 1;
    transform: translateY(0);
}

.novel-frame-story-card__overlay-excerpt {
    margin: 0;
    color: rgba(255, 255, 255, .92);
    font-size: 12.5px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

/* 作者行：快看风参考样式，硬裁超长作者名 */
.novel-frame-story-card__author {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(17, 24, 39, .55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .15s ease;
}

.novel-frame-story-card--list:hover .novel-frame-story-card__author {
    color: rgba(4, 105, 208, .75);
}

/* 空状态 */

.novel-frame-story-empty {
    grid-column: 1 / -1;
    list-style: none;
    text-align: center;
    padding: 40px 0;
    font-size: 14px;
    opacity: .55;
}

/* 自定义空态容器（覆盖父主题 zib_get_null 默认结构里 img opacity / margin），让插画轻盈一些 */
.novel-frame-list-empty img {
    opacity: .55 !important;
}

.novel-frame-list-empty p {
    margin-top: 14px !important;
    font-size: 13px;
}

/* 响应式 */

@media (max-width: 1199px) {
    .novel-frame-story-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
}

@media (max-width: 991px) {
    .novel-frame-story-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .novel-frame-story-list {
        padding: 12px;
    }

    .novel-frame-story-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .novel-frame-story-card--list .novel-frame-related-info {
        padding: 9px 10px 11px;
        gap: 3px;
    }

    .novel-frame-story-card--list .novel-frame-related-name {
        font-size: 13.5px;
    }

    .novel-frame-story-card__author {
        font-size: 11.5px;
    }

    /* 窄屏下 overlay 收紧 padding 与行数，避免封面浮层文本裁截过多 */
    .novel-frame-story-card__overlay {
        padding: 10px;
    }

    .novel-frame-story-card__overlay-excerpt {
        font-size: 11.5px;
        line-height: 1.55;
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }

    .novel-frame-card-badge,
    .novel-frame-story-card__chapters {
        top: 6px;
        right: 6px;
        padding: 3px 8px;
        font-size: 10px;
    }

    .novel-frame-story-card__chapters {
        right: auto;
        left: 6px;
        top: auto;
        bottom: 6px;
        gap: 4px;
    }

    .novel-frame-story-card__chapters i {
        font-size: 10px;
    }
}

@media (max-width: 560px) {
    .novel-frame-archive-toolbar {
        padding: 10px;
        margin-bottom: 12px;
        border-radius: 14px;
    }

    .novel-frame-archive-stats {
        font-size: 12px;
    }

    .novel-frame-archive-search {
        gap: 7px;
    }

    .novel-frame-search-input {
        height: 38px;
        border-radius: 999px;
        font-size: 13px;
    }

    .novel-frame-archive-search .but {
        height: 38px;
        line-height: 36px;
        border-radius: 999px;
        font-size: 13px;
    }

    .novel-frame-archive-filter {
        gap: 12px;
        border-radius: 14px;
    }

    .novel-frame-filter-chip {
        height: 24px;
        padding: 0 10px;
        font-size: 12px;
    }

    .novel-frame-story-list {
        padding: 6px 10px 14px;
    }

    /* 移动端：两列封面卡片网格，复用 ≤1199 / ≤640 已有的「封面顶格 + 信息区在下」纵向卡结构 */
    .novel-frame-story-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* 两列下单卡宽度比三列大，标题 / 作者字号适当括大避免发虚 */
    .novel-frame-story-card--list .novel-frame-related-name {
        font-size: 14px;
    }

    .novel-frame-story-card__author {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .novel-frame-story-grid {
        gap: 12px 8px;
    }

    .novel-frame-story-card--list .novel-frame-related-name {
        font-size: 13px;
    }

    .novel-frame-story-card__author {
        font-size: 11.5px;
    }
}

/* 暗色 */

body.dark-theme .novel-frame-archive-header {
    background: rgba(255, 255, 255, .02);
    box-shadow: none;
}

body.dark-theme .novel-frame-story-card--list {
    background: rgba(255, 255, 255, .03);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, .3),
        0 2px 8px rgba(0, 0, 0, .25);
}

body.dark-theme .novel-frame-story-card--list:hover {
    box-shadow:
        0 4px 12px rgba(4, 105, 208, .25),
        0 18px 36px rgba(0, 0, 0, .5);
}

body.dark-theme .novel-frame-story-card--list .novel-frame-related-thumb {
    background: rgba(255, 255, 255, .04);
}

body.dark-theme .novel-frame-story-card--list .novel-frame-related-name {
    color: rgba(255, 255, 255, .92);
}

body.dark-theme .novel-frame-story-card__author {
    color: rgba(255, 255, 255, .55);
}

body.dark-theme .novel-frame-story-card--list:hover .novel-frame-story-card__author {
    color: #9ec5ff;
}

body.dark-theme .novel-frame-story-card__chapters.is-serializing {
    color: #cffafe;
    background: rgba(8, 145, 178, .32);
    border-color: rgba(103, 232, 249, .42);
}

body.dark-theme .novel-frame-story-card__chapters.is-completed {
    color: #fff7cc;
    background: rgba(234, 179, 8, .34);
    border-color: rgba(253, 224, 71, .5);
}

body.dark-theme .novel-frame-related-thumb-placeholder--novel {
    background: linear-gradient(135deg, rgba(37, 99, 235, .18) 0%, rgba(4, 105, 208, .3) 100%);
    color: rgba(147, 184, 255, .75);
}

body.dark-theme .novel-frame-related-thumb-placeholder--comic {
    background: linear-gradient(135deg, rgba(234, 88, 12, .18) 0%, rgba(208, 88, 27, .3) 100%);
    color: rgba(255, 184, 138, .75);
}

