@charset "UTF-8";
/* ==========================================================================
   gallery.css —— 「二创图鉴」和「肥猫美图」两个页面共用的样式
   --------------------------------------------------------------------------
   为什么不写进 common.css：
     这两个页面才用得到卡片网格、精选大卡、图片浮层这些东西，
     放进 common.css 会让首页也白白多加载一份用不上的 CSS。
   两个页面都引它，所以卡片、网格、浮层的样式只维护这一份。
   ========================================================================== */


/* ==========================================================================
   01. 页面头部
   --------------------------------------------------------------------------
   已挪到 common.css —— 因为「关于本站」只引用 common.css 却也在用这套结构，
   留在这里的话那个页面的标题会没有样式（色条消失、字号偏小）。
   公共结构就该待在公共样式表里。
   ========================================================================== */


/* ==========================================================================
   02. 筛选标签（按 tag 过滤）
   --------------------------------------------------------------------------
   标签是从数据里自动汇总出来的，写数据时给每条加 tags 就行，这里不用改。
   只有一种标签（或没有标签）时 JS 会整条隐藏，内容少的时候页面更干净。
   ========================================================================== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.filter-pill {
    padding: 7px 18px;
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    border-radius: 999px;            /* 全圆角，做成胶囊形 */
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-light);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    border-color: rgba(var(--primary-rgb), 0.45);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.filter-pill.is-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}


/* ==========================================================================
   03. 二创图鉴：精选大卡
   ========================================================================== */
.featured-card {
    position: relative;
    display: block;
    overflow: hidden;
    margin-bottom: 32px;
    border-radius: 20px;
    box-shadow: 0 10px 34px rgba(38, 47, 74, 0.16);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 44px rgba(38, 47, 74, 0.22);
}

.featured-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 6;            /* 宽扁的大卡，只做首屏一条，不会太高 */
    object-fit: cover;
}

/* 底部压暗层：保证白字压在任意封面上都读得清 */
.featured-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(12, 16, 32, 0.86) 0%, rgba(12, 16, 32, 0.25) 42%, transparent 72%);
}

.featured-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;                      /* 压在 ::after 之上 */
    padding: 28px 32px;
}

.featured-title {
    color: #fff;
    font-size: clamp(18px, 2.2vw, 26px);
    line-height: 1.4;
}

.featured-meta {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.875rem;
}

/* 「本期精选」小标签 */
.featured-flag {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 1;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.8125rem;
}

/* 「今日肥猫」：和普通精选区分开，用主色→辅助色的渐变，更像一个"彩蛋"标签 */
.featured-flag.is-daily {
    background: linear-gradient(100deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 3px 12px rgba(69, 97, 158, 0.35);
    letter-spacing: 1px;
}


/* ==========================================================================
   04. 二创图鉴：视频卡片网格
   ========================================================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.video-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(38, 47, 74, 0.08);
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(38, 47, 74, 0.16);
}

.video-thumb {
    position: relative;
    overflow: hidden;
}

.video-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.video-card:hover .video-thumb img {
    transform: scale(1.05);          /* hover 时封面轻微放大，有"活的"感觉 */
}

/* 封面左下角的播放量 */
.video-play {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(12, 16, 32, 0.62);
    color: #fff;
    font-size: 0.75rem;
}

/* 封面左上角的分集号。
   像「和纱猫猫小剧场」这种一收就是二三十集的系列，标题几乎一模一样、
   分集号又藏在标题末尾，光看网格很难分辨，所以单独拎出来做个角标 */
.video-ep {
    position: absolute;
    left: 10px;
    top: 10px;
    min-width: 34px;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.video-info {
    padding: 14px 16px 18px;
}

.video-title {
    color: var(--text-main);
    font-size: 0.9375rem;
    line-height: 1.5;
    /* 最多两行，超出打省略号 —— 卡片高度才会一致，网格不会参差 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.video-author {
    margin-top: 8px;
    color: var(--text-light);
    font-size: 0.8125rem;
}


/* ==========================================================================
   05. 肥猫美图：统一网格
   --------------------------------------------------------------------------
   每个格子固定 3:4、缩略图 object-fit: cover 裁切。
   插画大多是竖图，裁切损失很小；要看完整原图就点开浮层。
   统一比例的好处：网格绝对整齐，几百张也不会参差。
   ========================================================================== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.photo-card {
    display: block;
    text-align: left;
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    cursor: zoom-in;                 /* 鼠标移上去变成放大镜，暗示"可以点开" */
}

.photo-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(38, 47, 74, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.photo-card:hover .photo-thumb {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(38, 47, 74, 0.16);
}

.photo-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.photo-card:hover .photo-thumb img {
    transform: scale(1.04);
}

/* 右上角的 Pixiv 角标：一眼能看出这张图的来源 */
.photo-src {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    font-size: 0.6875rem;
    font-weight: 700;
}

/* 署名区：作者是必填项，所以这里一定有内容 */
.photo-meta {
    padding: 9px 2px 0;
}

.photo-author {
    color: var(--text-main);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.photo-id {
    margin-top: 2px;
    color: var(--text-light);
    font-size: 0.6875rem;
}


/* ==========================================================================
   06. 图片浮层（Lightbox）
   ========================================================================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 900;                    /* 盖住导航栏（导航 z-index 是 100） */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 48px;
    background: rgba(16, 20, 36, 0.9);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

/* 大图：contain 保证完整显示，一根手指头都不裁 */
.lightbox-figure {
    max-width: min(62vw, 900px);
    max-height: 84vh;
    margin: 0;
}

.lightbox-figure img {
    display: block;
    max-width: 100%;
    max-height: 84vh;
    margin: 0 auto;
    border-radius: 12px;
    object-fit: contain;
}

/* 右侧信息栏 */
.lightbox-info {
    width: 300px;
    flex-shrink: 0;
    color: #fff;
}

.lightbox-title {
    font-size: 1.25rem;
    line-height: 1.45;
}

.lightbox-lines {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.875rem;
    line-height: 2;
}

.lightbox-lines b {
    color: #fff;
    font-weight: 500;
}

.lightbox-actions {
    display: flex;
    gap: 12px;
    margin-top: 26px;
}

.lightbox-btn {
    padding: 11px 22px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lightbox-btn.is-primary {
    background: var(--primary-color);
    color: #fff;
}

.lightbox-btn.is-primary:hover {
    background: var(--primary-light);
}

.lightbox-btn.is-ghost {
    border-color: rgba(255, 255, 255, 0.32);
    background: none;
    color: rgba(255, 255, 255, 0.86);
}

.lightbox-btn.is-ghost:hover {
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

/* 左右切换箭头 */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.24);
}

.lightbox-nav.is-prev { left: 24px; }
.lightbox-nav.is-next { right: 24px; }

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.24);
}

.lightbox-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8125rem;
}


/* ==========================================================================
   07. 空状态 / 提示
   ========================================================================== */
.empty-note {
    padding: 64px 24px;
    border: 1px dashed rgba(var(--primary-rgb), 0.3);
    border-radius: 16px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9375rem;
    line-height: 2;
}

/* 缺署名的条目会被 JS 拦下来不渲染，这里给出数量提示，避免"内容凭空少了" */
.data-warning {
    margin-bottom: 20px;
    padding: 12px 18px;
    border-left: 3px solid var(--accent-color);
    border-radius: 8px;
    background: rgba(242, 146, 174, 0.12);
    color: var(--accent-color);
    font-size: 0.875rem;
}

/* 提示文字里的代码片段（标签名、文件名这类）单独标出来。
   默认的 <code> 只是等宽字体，中文看起来和正文几乎没差别，等于没标 */
.empty-note code,
.data-warning code {
    padding: 1px 7px;
    border-radius: 5px;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-color);
    font-size: 0.92em;
}

.data-warning code {
    background: rgba(208, 70, 95, 0.14);
    color: var(--accent-color);
}


/* ==========================================================================
   08. 响应式
   ========================================================================== */
@media (max-width: 1200px) {
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); }
    .photo-grid { grid-template-columns: repeat(3, 1fr); }

    .lightbox { flex-direction: column; gap: 18px; padding: 60px 24px 24px; overflow-y: auto; }
    .lightbox-figure { max-width: 100%; max-height: 56vh; }
    .lightbox-figure img { max-height: 56vh; }
    .lightbox-info { width: 100%; max-width: 520px; }
    .lightbox-nav { top: auto; bottom: 24px; transform: none; }
    .lightbox-nav.is-prev { left: calc(50% - 108px); }
    .lightbox-nav.is-next { right: calc(50% - 108px); }
    .lightbox-counter { display: none; }
}

@media (max-width: 600px) {
    .video-grid { grid-template-columns: 1fr; gap: 18px; }
    .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .featured-card img { aspect-ratio: 16 / 9; }
    .featured-body { padding: 18px; }
    .featured-title { font-size: 1rem; }
}
