/* ============================================
   图片墙（PC）
   仅服务于 tpl/index_pics_pc.html
   卡片类名与 index-pics.js 的 renderPicCard() 保持一致
   断点必须与 index-pics.js 的 computeColumns() 保持一致
   ============================================ */

.pics-content-area {
    display: block;
    width: 100%;
}

.pics-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 0 40px;
    align-items: start;
}

.pics-main {
    min-width: 0;
}

.pics-right-sidebar {
    min-width: 0;
}

/* ---------- 页头 ---------- */
.pics-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    margin-bottom: 14px;
}

.pics-title-icon {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef4ff;
    color: #1a73e8;
    font-size: 18px;
}

.pics-title {
    margin: 0;
    font-size: 17px;
    line-height: 1.3;
    color: #181c1f;
    font-weight: 700;
    white-space: nowrap;
}

.pics-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex: none;
}

.pics-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid #d9dce1;
    border-radius: 14px;
    background: #f8f9fa;
    color: #444;
    font-size: 13px;
    text-decoration: none;
}

.pics-nav-link:hover {
    background: #eef4ff;
    border-color: #b9d3f7;
    color: #1a73e8;
}

.pics-nav-link i {
    font-size: 12px;
}

/* ---------- 瀑布流 ---------- */
.pics-masonry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pics-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pic-card {
    display: block;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    transition: box-shadow .2s ease, border-color .2s ease;
}

.pic-card:hover {
    border-color: #c7d6ea;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
}

/* 图片未加载时用 3:4 占位撑出高度，避免懒加载造成的布局跳动；
   加载完成后释放为 auto，容器收敛到图片真实比例（瀑布流） */
.pic-thumb {
    aspect-ratio: 3 / 4;
    background: #f2f3f5;
    overflow: hidden;
}

.pic-thumb.is-loaded {
    aspect-ratio: auto;
}

.pic-img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity .25s ease;
}

.pic-img.is-loaded {
    opacity: 1;
}

/* 标题最多 2 行，超出的裁掉。两个坑：
   1) 站点全局是 border-box，max-height 会把 padding 算进去 —— 这里显式改回 content-box，
      让 max-height 只约束文字本身，否则 18px 的上下内边距会吃掉一整行，第二行被腰斩；
   2) line-height / max-height 用整数 px（12px 行高 18px，2 行 = 36px）。用 em 或无单位倍数
      会算出 44.796875px 这类小数高度，裁切点落在字形中间，同样会把第二行切一半。
   -webkit-line-clamp 只是锦上添花（支持时补省略号），真正兜底的是 max-height + overflow。 */
.pic-title {
    box-sizing: content-box;
    /* 底部留白必须走 margin 不能走 padding：overflow 裁在 padding 边缘，
       留 10px 下内边距就会漏出第三行的顶部一小截。.pic-card 有 overflow:hidden
       自成 BFC，这里的 margin-bottom 不会外溢，卡片高度照样算得进去。 */
    padding: 8px 10px 0;
    margin-bottom: 10px;
    font-size: 12px;
    line-height: 18px;
    max-height: 36px;
    color: #181c1f;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* ---------- 空状态 / 加载指示 ---------- */
.pics-empty {
    padding: 48px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: #666;
    text-align: center;
    font-size: 14px;
}

.pics-loading-indicator {
    min-height: 46px;
    margin: 18px 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #777;
    font-size: 13px;
}

.pics-loading-indicator.is-done i,
.pics-loading-indicator.is-idle i {
    display: none;
}

.pics-loading-indicator.is-error {
    color: #cf1322;
}

/* ---------- 响应式：5 → 4 → 3 → 2 列 ---------- */
@media (max-width: 1200px) {
    .pics-shell {
        display: block;
        max-width: 100%;
    }
    .pics-right-sidebar {
        display: none;
    }
    .pics-content-area {
        padding: 0 10px;
    }
}

@media (max-width: 992px) {
    .pics-masonry,
    .pics-col {
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .pics-header {
        padding: 10px 12px;
    }
    .pics-title {
        font-size: 15px;
    }
    .pics-masonry,
    .pics-col {
        gap: 8px;
    }
    .pic-title {
        padding: 7px 8px 0;
        margin-bottom: 9px;
    }
}

/* ---------- 深色模式 ---------- */
html[data-theme="dark"] .pics-header,
html[data-theme="dark"] .pic-card,
html[data-theme="dark"] .pics-empty {
    background: #1e1f22;
    border-color: #333;
}

html[data-theme="dark"] .pics-title,
html[data-theme="dark"] .pic-title {
    color: #e3e3e3;
}

html[data-theme="dark"] .pics-empty,
html[data-theme="dark"] .pics-loading-indicator {
    color: #999;
}

html[data-theme="dark"] .pic-thumb {
    background: #2a2b2e;
}

html[data-theme="dark"] .pics-nav-link {
    background: #2a2b2e;
    border-color: #3d3e42;
    color: #bbb;
}

html[data-theme="dark"] .pics-nav-link:hover {
    background: #33353a;
    border-color: #4a4c52;
    color: #e3e3e3;
}

html[data-theme="dark"] .pic-card:hover {
    border-color: #4a4c52;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
}

html[data-theme="dark"] .pics-title-icon {
    background: rgba(26, 115, 232, .16);
    color: #6aa8f5;
}
