/*
 * 维修笔记正文增强：图片灯箱 + 正文链接配色。
 * 只作用于 .article-prose（文章详情页正文容器），不影响站内其它 .prose 页面。
 */

/* ---------- 正文链接：默认蓝，悬停红 ---------- */
.article-prose a {
    color: #1a5fb4 !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color .15s ease;
    word-break: break-word;
}
.article-prose a:hover,
.article-prose a:focus-visible {
    color: var(--red) !important;
}

/* ---------- 正文图片：可点击提示 ---------- */
.article-prose img {
    cursor: zoom-in;
}

/* ---------- 灯箱 ---------- */
.lq-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: rgba(8, 11, 18, .9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.lq-lightbox.is-open {
    display: flex;
}

.lq-lightbox__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    touch-action: none;
}

.lq-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 140px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    cursor: zoom-in;
    transition: transform .18s ease;
    transform-origin: center center;
    will-change: transform;
}
.lq-lightbox__img.is-zoomed {
    cursor: zoom-out;
}

/* 关闭按钮 */
.lq-lightbox__close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s;
}
.lq-lightbox__close:hover,
.lq-lightbox__close:focus-visible {
    background: var(--red);
    border-color: var(--red);
    transform: rotate(90deg);
}
.lq-lightbox__close svg { width: 20px; height: 20px; }

/* 放大 / 缩小按钮 */
.lq-lightbox__zoom {
    position: absolute;
    right: 24px;
    bottom: 24px;
    display: flex;
    gap: 8px;
}
.lq-lightbox__zoom button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.lq-lightbox__zoom button:hover,
.lq-lightbox__zoom button:focus-visible {
    background: rgba(255, 255, 255, .2);
    border-color: #fff;
}
.lq-lightbox__zoom svg { width: 18px; height: 18px; }

/* 左右切换按钮 */
.lq-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.lq-lightbox__nav:hover,
.lq-lightbox__nav:focus-visible {
    background: rgba(255, 255, 255, .2);
    border-color: #fff;
}
.lq-lightbox__nav[hidden] { display: none; }
.lq-lightbox__nav--prev { left: 24px; }
.lq-lightbox__nav--next { right: 24px; }
.lq-lightbox__nav svg { width: 22px; height: 22px; }

/* 底部说明：图片说明 + 计数 + 缩放比例 */
.lq-lightbox__caption {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, .85);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    pointer-events: none;
}
.lq-lightbox__caption-text { max-width: 70vw; }
.lq-lightbox__count,
.lq-lightbox__scale {
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, .6);
}

/* 打开时锁滚动 */
body.lq-lightbox-open { overflow: hidden; }

@media (max-width: 600px) {
    /* 手机端上下留白收紧，让 100% 基准图尽量大，缩小后依然可读 */
    .lq-lightbox { padding: 48px 10px; }
    .lq-lightbox__img { max-height: calc(100vh - 160px); }
    .lq-lightbox__close { top: 12px; right: 12px; width: 38px; height: 38px; }
    .lq-lightbox__nav { width: 38px; height: 38px; }
    .lq-lightbox__nav--prev { left: 12px; }
    .lq-lightbox__nav--next { right: 12px; }
    .lq-lightbox__zoom { right: 12px; bottom: 64px; }
    .lq-lightbox__caption { bottom: 12px; font-size: 12px; }
    .lq-lightbox__caption-text { max-width: 80vw; }
}
