/* ============================================================
 * 标签页（掘金式）· PC
 * 层级对齐掘金标签页：居中大标签名 → 关注·文章统计 →
 * 卡片顶部条（图标+关注按钮 | 热门/最新/最热）→
 * 文章流 li.item > .entry > .content-wrapper >
 * (.content-main[title-row/abstract/entry-footer] + img.thumb)
 * ============================================================ */

.lsj-tag-page {
    width: 100%;
    margin: 0;
    background: #f4f5f5; /* 掘金页面底色，list-header 直接衬在其上 */
}

/* 居中内容列（色带为全宽独立层，不包在列内） */
.lsj-tag-page .tp-wrap {
    width: min(var(--tp-width, 720px), calc(100% - 32px));
    margin: 12px auto 48px;
}

/* ---------- 头部：tag-info-box（与掘金逐条对齐） ---------- */
.lsj-tag-page .tag-info-box {
    position: relative;
    height: 150px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #f1f1f1;
}
.lsj-tag-page .tag-info-box .tag-info {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    color: #666;
    padding: 48px 0; /* 掘金 4rem（根字号 12px）= 48px */
    box-sizing: border-box;
}
.lsj-tag-page .tag-info .title {
    font-size: 25px;
    line-height: 30px;
    font-weight: 700;
    /* 掘金未重置 h1 的 UA 上边距（.67em），仅覆盖下边距 .3rem≈4px */
    margin: .67em 0 4px;
    word-break: break-all;
}
.lsj-tag-page .tag-info .tag-meta {
    font-size: 12px;
    color: #666;
}
.lsj-tag-page .tag-info .tag-meta em {
    font-style: normal;
}

/* ---------- 白色卡片 ---------- */
.tp-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

/* ---------- 顶部条：header.list-header（与掘金逐条对齐；独立于白卡片，衬页面灰底） ---------- */
.lsj-tag-page .list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3.6px; /* 掘金 .3rem（根字号 12px）= 3.6px */
    border-bottom: 1px solid hsla(0, 0%, 59.2%, .1);
    margin-bottom: 12px; /* 与下方白卡片的间距 */
}
.lsj-tag-page .list-header .left {
    display: flex;
    align-items: center;
}
.lsj-tag-page .list-header .tag-icon {
    height: 1.5rem;
    margin-right: 1rem;
}
.lsj-tag-page .subscribe-btn {
    margin: 0 0 0 12px; /* 掘金 1rem */
    padding: 6px 15px;
    font-size: 14px;
    color: #6cbd45;
    background: #fff;
    border: 1px solid #6cbd45;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, opacity .15s;
}
.lsj-tag-page .subscribe-btn:hover {
    background: rgba(108, 189, 69, .06);
}
.lsj-tag-page .subscribe-btn.had {
    color: #909090;
    border-color: #dcdcdc;
}
.lsj-tag-page .subscribe-btn.had:hover {
    background: #f7f8fa;
}
.lsj-tag-page .subscribe-btn.is-loading {
    opacity: .6;
    pointer-events: none;
}

.lsj-tag-page .nav-list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1;
    list-style: none;
    margin: 0;
    padding: 0;
}
.lsj-tag-page .nav-list .nav-item {
    margin-left: 36px; /* 掘金 3rem */
    font-size: 14px;
}
.lsj-tag-page .nav-list .nav-item a {
    color: #909090;
    cursor: pointer;
    transition: color .15s;
}
.lsj-tag-page .nav-list .nav-item a:hover {
    color: var(--tp-primary, #1e80ff);
}
.lsj-tag-page .nav-list .nav-item.active a {
    color: var(--tp-primary, #1e80ff);
    font-weight: 500;
}

/* ---------- 文章流（掘金 entry 层级） ---------- */
.tp-entry-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tp-entry-list > .item {
    /* border-bottom: 1px solid #f1f2f5; */
}
.tp-entry-list > .item:last-child {
    border-bottom: none;
}

.lsj-tag-page .entry {
    cursor: pointer;
    position: relative;
    background: #fff;
    padding: 12px 20px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.lsj-tag-page .entry:hover {
    background: #fafbfc;
}

.lsj-tag-page .content-wrapper {
    display: flex;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(228, 230, 235, 0.5);
        width: 100%;
}
.lsj-tag-page .content-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* 标题行 */
.lsj-tag-page .title-row {
    display: flex;
    margin-bottom: 2px;
}
.lsj-tag-page .title-row .title {
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    color: #252933;
    width: 100%;
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}
.lsj-tag-page .entry:hover .title-row .title {
    /* color: var(--tp-primary, #1e80ff); */
}

/* 摘要行 */
.lsj-tag-page .abstract {
    margin-bottom: 4px;
    font-weight: 400;
}
.lsj-tag-page .abstract a {
    color: #8a919f;
    font-size: 13px;
    line-height: 22px;
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}
.lsj-tag-page .abstract a > div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 底部行：元信息 + 右侧标签 */
.lsj-tag-page .entry-footer {
    display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        flex-wrap: wrap;
        margin-top: auto;
    
}
.lsj-tag-page .action-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: #8a919f;
    min-width: 0;
}
.lsj-tag-page .action-list > .item {
    display: flex;
    align-items: center;
    white-space: nowrap;
}
.lsj-tag-page .action-list svg {
    flex-shrink: 0;
    margin-right: 4px;
}
.lsj-tag-page .action-list .view-icon {
    margin-right: 5px;
}
.lsj-tag-page .user-message {
    color: #515767;
    font-weight: 500;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .15s;
}
.lsj-tag-page .user-message:hover {
    color: var(--tp-primary, #1e80ff);
}
.lsj-tag-page .footer-divider {
    width: 1px;
    height: 14px;
    background: #e4e6eb;
    margin: 0 10px;
    flex-shrink: 0;
}
.lsj-tag-page .action-list > .item.like.is-liked,
.lsj-tag-page .action-list > .item.like.is-liked span {
    color: #1e80ff;
}

/* 竖线只保留在作者、时间后面（掘金同款），浏览/点赞/评论用间距分隔 */
.lsj-tag-page .action-list > .item.like,
.lsj-tag-page .action-list > .item.comment {
    margin-left: 20px;
}
.lsj-tag-page .action-list > .item.like {
    cursor: pointer;
    transition: color .15s;
}
.lsj-tag-page .action-list > .item.like:not(.is-liked):hover,
.lsj-tag-page .action-list > .item.like:not(.is-liked):hover span {
    color: var(--tp-primary, #1e80ff);
}

/* 右侧标签 chips */
.lsj-tag-page .entry-footer-tags {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.lsj-tag-page .footer-tag {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    margin-left: 8px;
    font-size: 12px;
    line-height: 1;
    color: #8a919f;
    background: #f2f3f5;
    border-radius: 2px;
    white-space: nowrap;
    transition: color .15s;
}
.lsj-tag-page .footer-tag.width-limited {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lsj-tag-page .footer-tag:hover {
    color: var(--tp-primary, #1e80ff);
}

/* 右缩略图 */
.lsj-tag-page .thumb {
    flex: 0 0 auto;
    width: 108px;
    height: 72px;
    margin-left: 24px;
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid rgba(228, 230, 235, 0.5);
}

/* ---------- 状态：加载 / 空 / 加载更多 ---------- */
.tp-list-loading,
.tp-empty {
    list-style: none;
    padding: 56px 20px;
    text-align: center;
    font-size: 14px;
    color: #8a919f;
}
.tp-empty .remix-icon {
    display: block;
    font-size: 36px;
    margin-bottom: 10px;
    opacity: .35;
}
.tp-loadmore {
    padding: 16px 20px 20px;
    text-align: center;
}
.tp-loadmore-text {
    font-size: 13px;
    color: #8a919f;
}

/* ---------- 窄屏兜底（PC 模块仅在桌面注入，双屏/小窗自适应） ---------- */
@media (max-width: 768px) {
    .lsj-tag-page .tp-wrap {
        margin-top: 8px;
    }
    .lsj-tag-page .list-header .tag-icon {
        width: 44px;
        height: 44px;
    }
    .lsj-tag-page .nav-list .nav-item {
        margin-left: 20px;
    }
    .lsj-tag-page .entry {
        padding: 12px 14px 0;
    }
    .lsj-tag-page .thumb {
        width: 96px;
        height: 64px;
        margin-left: 12px;
    }
    .lsj-tag-page .entry-footer-tags {
        display: none;
    }
}

/* ===================== 作者悬浮名片（掘金同款，移植自论坛列表模块） ===================== */
.tp-user-card {
    position: fixed;
    z-index: 99999;
    width: 300px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    padding: 16px 16px 0;
    /* 默认在名字上方弹出，从下往上浮现 */
    animation: tp-uc-fade-above 0.15s ease;
}

.tp-user-card.is-below {
    /* 名字贴近屏幕顶部 → 卡片在名字下方，从上往下浮现 */
    animation: tp-uc-fade-below 0.15s ease;
}

@keyframes tp-uc-fade-above {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tp-uc-fade-below {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 指向名字的箭头：默认在卡片底部朝下（卡片在名字上方） */
.tp-user-card::before,
.tp-user-card::after {
    content: '';
    position: absolute;
    left: var(--tp-uc-arrow-x, 50%);
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    transform: translateX(-50%) rotate(45deg);
    pointer-events: none;
}

/* 底层：描边 + 阴影，与卡片边缘衔接 */
.tp-user-card::before {
    bottom: -7px;
    background: #fff;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.06);
}

/* 面层：纯白色块盖住底层与卡片接缝处多余边线 */
.tp-user-card::after {
    bottom: -5px;
    background: #fff;
}

/* 卡片在名字下方时：箭头翻到卡片顶部朝上 */
.tp-user-card.is-below::before {
    bottom: auto;
    top: -7px;
    border: none;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: -6px -6px 12px rgba(0, 0, 0, 0.05);
}

.tp-user-card.is-below::after {
    bottom: auto;
    top: -5px;
}

/* 头部：头像 + 昵称/徽章/简介 */
.tp-user-card .tp-uc-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.tp-user-card .tp-uc-avatar {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    display: block;
    background: #f2f3f5;
}

.tp-user-card .tp-uc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tp-user-card .tp-uc-avatar-empty {
    display: block;
    width: 100%;
    height: 100%;
    background: #e4e6eb;
}

.tp-user-card .tp-uc-main {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.tp-user-card .tp-uc-name-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
}

.tp-user-card .tp-uc-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    color: #252933;
    text-decoration: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-user-card .tp-uc-name:hover {
    color: var(--ls-primary-hover, #1e80ff);
}

/* 昵称 HTML（VIP 变色 font 标签）继承字号字重 */
.tp-user-card .tp-uc-name font,
.tp-user-card .tp-uc-name .nickname {
    font-size: inherit;
    font-weight: inherit;
}

.tp-user-card .tp-uc-badges {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.tp-user-card .tp-uc-badges .ls-mark {
    margin: 0;
    transform: scale(0.92);
    transform-origin: left center;
}

.tp-user-card .tp-uc-desc {
    margin-top: 4px;
    font-size: 13px;
    line-height: 20px;
    color: #8a919f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 关注 / 私信按钮 */
.tp-user-card .tp-uc-actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.tp-user-card .tp-uc-btn {
    flex: 1;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    border-radius: 4px;
    box-sizing: border-box;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tp-user-card .tp-uc-follow {
    border: 1px solid var(--ls-primary-hover, #1e80ff);
    background: var(--ls-primary-hover, #1e80ff);
    color: #fff;
    padding: 0;
}

.tp-user-card .tp-uc-follow:hover {
    opacity: 0.88;
}

.tp-user-card .tp-uc-follow.is-followed {
    background: #f2f3f5;
    border-color: #f2f3f5;
    color: #8a919f;
}

.tp-user-card .tp-uc-follow[disabled] {
    opacity: 0.6;
    cursor: default;
}

.tp-user-card .tp-uc-chat {
    border: 1px solid rgba(30, 128, 255, 0.35);
    background: #fff;
    color: var(--ls-primary-hover, #1e80ff);
}

.tp-user-card .tp-uc-chat:hover {
    border-color: var(--ls-primary-hover, #1e80ff);
    background: rgba(30, 128, 255, 0.06);
}

/* 关注 / 粉丝统计 */
.tp-user-card .tp-uc-stats {
    display: flex;
    margin-top: 14px;
    padding: 10px 0;
    border-top: 1px solid #f1f2f4;
}

.tp-user-card .tp-uc-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
}

.tp-user-card .tp-uc-stat b {
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    color: #252933;
    font-variant-numeric: tabular-nums;
}

.tp-user-card .tp-uc-stat span {
    font-size: 13px;
    line-height: 18px;
    color: #8a919f;
}

.tp-user-card .tp-uc-stat:hover b {
    color: var(--ls-primary-hover, #1e80ff);
}

/* 骨架屏（首次加载） */
.tp-user-card .tp-uc-skel {
    position: relative;
    overflow: hidden;
    background: #f2f3f5;
}

.tp-user-card .tp-uc-skel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    animation: tp-uc-shimmer 1.2s infinite;
}

@keyframes tp-uc-shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.tp-user-card .tp-uc-skel-line {
    display: block;
    height: 14px;
    border-radius: 4px;
    margin: 4px 0;
}

.tp-user-card .tp-uc-btn.tp-uc-skel {
    border: none;
    cursor: default;
}
