/* =========================================================
   B2 主题 · 网址导航 V2（首页重构 + 详情内页重构）
   ========================================================= */

/* ---------- 首页 Hero：标题 + 搜索框 + 轮播图 ---------- */
.links-hero {
    padding: 26px 30px;
    margin-bottom: 20px;
    overflow: hidden;
}

.links-hero-title {
    font-size: 24px;
    margin: 0 0 6px;
    text-align: center;
}

.links-hero-sub {
    text-align: center;
    color: #98a2b3;
    font-size: 13px;
    margin: 0 0 18px;
}

.links-hero-actions {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

/* 搜索框 */
.links-search {
    max-width: 720px;
    margin: 0 auto;
}

.links-search-box {
    display: flex;
    align-items: center;
    background: #f7f8fa;
    border: 2px solid transparent;
    height: 52px;
    padding: 0 6px 0 20px;
    transition: all .2s ease;
}

.links-search-box:focus-within {
    border-color: var(--b2color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--b2color-rgb, 67, 97, 238), .08);
}

.links-search-box input {
    flex: 1;
    border: 0;
    outline: none;
    background: none;
    font-size: 15px;
    height: 100%;
    color: #333;
}

.links-search-box button {
    width: 62px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: var(--b2color);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .2s;
}

.links-search-box button:hover {
    opacity: .88;
}

.links-search-engines {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

.links-engine {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 999px;
    background: #f4f5f7;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s ease;
    user-select: none;
}

.links-engine:hover {
    color: var(--b2color);
    background: rgba(var(--b2color-rgb, 67, 97, 238), .08);
}

.links-engine.active {
    background: var(--b2color);
    color: #fff;
}

/* 轮播图（样式参考首页幻灯模块） */
.links-slider {
    max-width: 100%;
    margin: 20px auto 0;
    position: relative;
}

.links-slider .links-slider-cell {
    width: 100%;
    position: relative;
}

.links-slider .links-slider-cell a {
    display: block;
    width: 100%;
    height: 0;
    padding-top: 30%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.links-slider .links-slider-cell img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.links-slider .links-slider-title {
    position: absolute;
    left: 24px;
    bottom: 20px;
    max-width: 70%;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 15px;
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.links-slider .flickity-page-dots {
    bottom: 10px;
}

.links-slider .flickity-page-dots .dot {
    background: #fff;
    opacity: .5;
}

.links-slider .flickity-page-dots .dot.is-selected {
    opacity: 1;
}

/* ---------- 首页 热门推荐卡片网格 ---------- */
.link-hot-grid ul {
    display: flex;
    flex-wrap: wrap;
}

.link-hot-grid li {
    width: 20%;
    padding: 0;
}

.link-hot-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 14px 14px;
    margin: 0 8px 16px;
    min-height: 150px;
    transition: transform .25s ease, box-shadow .25s ease;
}

.link-hot-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .1);
}

.link-hot-item .link-img {
    width: 46px;
    height: 46px;
    object-fit: cover;
    margin-bottom: 10px;
}

.link-hot-item h3 {
    font-size: 14px;
    margin: 0 0 6px;
    font-weight: 600;
}

.link-hot-item .link-desc {
    font-size: 12px;
    color: #98a2b3;
    line-height: 1.6;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-hot-footer {
    margin-top: auto;
}

.link-hot-footer span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #b0b7c3;
}

/* ---------- 详情内页 V2 ---------- */
.slv-top {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.slv-main {
    flex: 1;
    min-width: 0;
}

.slv-side {
    width: 380px;
    flex: none;
}

.slv-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.slv-icon-box {
    width: 72px;
    height: 72px;
    flex: none;
    overflow: hidden;
    background: #f7f8fa;
}

.slv-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slv-title-box {
    flex: 1;
    min-width: 0;
}

.slv-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slv-title-row h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.3;
}

.slv-actions {
    margin-left: auto;
    flex: none;
}

.slv-subtitle {
    margin: 6px 0 0;
    color: #8590a6;
    font-size: 13px;
}

/* 评分 */
.slv-rating {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 4px;
    padding: 12px 16px;
    background: #fafbfc;
    border-radius: 10px;
}

.slv-rating-label {
    font-size: 13px;
    color: #666;
}

.slv-stars {
    display: inline-flex;
    gap: 2px;
}

.slv-stars i {
    font-size: 20px;
    color: #dfe3e8;
    cursor: pointer;
    transition: transform .12s ease, color .15s ease;
}

.slv-stars i:hover {
    transform: scale(1.15);
}

.slv-stars i.on {
    color: #ffb800;
}

.slv-rating-num {
    font-size: 14px;
    font-weight: 700;
    color: #ff9800;
}

.slv-rating-count {
    font-size: 12px;
    color: #98a2b3;
}

.slv-rating-count b {
    color: #ff9800;
}

.slv-rating-mine {
    font-size: 12px;
    color: var(--b2color);
    margin-left: auto;
}

/* 信息表格 */
.slv-info {
    margin: 14px 0;
    padding: 4px 16px;
    background: #fafbfc;
    font-size: 13px;
}

.slv-info-row {
    display: flex;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px dashed #e8ebf0;
    line-height: 1.5;
}

.slv-info-row:last-child {
    border-bottom: 0;
}

.slv-info-key {
    color: #98a2b3;
    width: 76px;
    flex: none;
}

.slv-info-row a {
    color: var(--b2color);
}

.slv-info-link {
    word-break: break-all;
}

.slv-like-btn button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
}

.slv-like-btn button.hasup {
    color: var(--b2color);
}

/* 权重 */
.slv-weight {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: 14px 0;
    padding: 12px 16px;
    background: #fafbfc;
}

.slv-weight-title {
    font-size: 13px;
    color: #98a2b3;
}

.slv-weight-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.slv-weight-item > b {
    font-weight: 600;
    color: #4a4f57;
}

.slv-weight-badge {
    font-style: normal;
    display: inline-block;
    min-width: 44px;
    text-align: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--wc, #98a2b3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}

.slv-weight-badge.none {
    background: #c3c9d2;
    font-weight: 400;
}

/* 标签 */
.slv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.slv-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(var(--b2color-rgb, 67, 97, 238), .07);
    color: var(--b2color);
    font-size: 12px;
    transition: all .2s;
}

.slv-tag:hover {
    background: var(--b2color);
    color: #fff;
}

/* 介绍 */
.slv-desc {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.9;
}

.slv-desc p {
    margin: 0 0 10px;
}

/* 右侧预览图 */
.slv-preview {
    padding: 14px;
    position: sticky;
    top: 90px;
}

.slv-preview-img {
    position: relative;
    height: 0;
    padding-top: 70%;
    overflow: hidden;
    border-radius: 8px;
    background: #f4f5f7 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="%23d0d5dd"><path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/></svg>') center no-repeat;
}

.slv-preview-img a {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.slv-preview-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.slv-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 46px;
    margin-top: 14px;
    background: var(--b2color);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    transition: opacity .2s, transform .2s;
}

.slv-open-btn:hover {
    opacity: .88;
    color: #fff;
    transform: translateY(-1px);
}

.slv-copy-btn {
    width: 100%;
    height: 34px;
    margin-top: 8px;
    color: #8590a6;
}

/* ---------- 入驻页一键获取 ---------- */
.link-url-row {
    display: flex;
    gap: 8px;
}

.link-url-row input {
    flex: 1;
    min-width: 0;
}

.link-fetch-btn {
    flex: none;
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--b2color);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: opacity .2s;
}

.link-fetch-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.link-fetch-tips {
    font-size: 12px;
    color: #98a2b3;
    margin: 10px 0;
    padding: 10px 14px;
    background: rgba(var(--b2color-rgb, 67, 97, 238), .05);
    border-radius: 8px;
}

/* ---------- 响应式 ---------- */
@media screen and (max-width: 768px) {
    .links-hero {
        padding: 20px 16px;
    }

    .links-hero-title {
        font-size: 20px;
    }

    .link-hot-grid li {
        width: 50%;
    }

    .slv-top {
        flex-direction: column;
    }

    .slv-side {
        width: 100%;
        order: -1;
    }

    .slv-preview {
        position: static;
    }

    .slv-preview-img {
        padding-top: 56%;
    }

    .slv-title-row {
        flex-wrap: wrap;
    }
}

/* ---------- 暗黑模式 ---------- */
.b2dark .links-search-box {
    background: #24262b;
}

.b2dark .links-search-box input {
    color: #d5d9df;
}

.b2dark .links-engine {
    background: #24262b;
    color: #a8b0ba;
}

.b2dark .slv-rating,
.b2dark .slv-info,
.b2dark .slv-weight {
    background: #1e2025;
}

.b2dark .slv-info-row {
    border-color: #2c2f36;
}

.b2dark .slv-weight-item > b {
    color: #c3c9d2;
}

.b2dark .slv-icon-box,
.b2dark .slv-preview-img {
    background-color: #24262b;
}

.b2dark .link-hot-item {
    background: #24262b;
}
