/* 星火绑定链接 - 前台样式（与子比主题风格一致的圆角卡片） */

/* ---------- 卡片区块 ---------- */
.xhbl-box {
    margin: 20px 0;
    padding: 16px;
    border-radius: 8px;
    background: var(--main-bg-color, #fff);
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}
.xhbl-box-title {
    font-size: 15px; font-weight: 700; margin-bottom: 12px;
    padding-left: 10px; border-left: 3px solid var(--xhbl-accent, #2563eb);
    line-height: 1.2;
}
.xhbl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.xhbl-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .06);
    background: var(--xhbl-item-bg, #f8fafc);
    cursor: pointer;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.xhbl-item:hover, .xhbl-item:focus-visible {
    border-color: var(--xhbl-accent, #2563eb);
    box-shadow: 0 4px 14px rgba(37, 99, 235, .15);
    transform: translateY(-1px);
    outline: none;
}
.xhbl-avatar { flex: 0 0 40px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.xhbl-avatar img { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid rgba(0,0,0,.05); }
.xhbl-avatar-fallback {
    width: 40px; height: 40px; border-radius: 8px;
    background: var(--xhbl-accent, #2563eb); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
}
.xhbl-meta { min-width: 0; display: flex; flex-direction: column; }
.xhbl-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xhbl-desc { font-size: 12px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* ---------- 悬浮面板 ---------- */
.xhbl-pop {
    position: fixed; z-index: 999999;
    width: 264px; max-width: calc(100vw - 16px);
    padding: 14px; border-radius: 10px;
    background: var(--main-bg-color, #fff);
    border: 1px solid rgba(0, 0, 0, .08);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .16);
    opacity: 0; visibility: hidden; transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    pointer-events: none;
}
.xhbl-pop.is-open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.xhbl-pop-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.xhbl-pop-avatar { width: 36px; height: 36px; flex: 0 0 36px; display: flex; align-items: center; justify-content: center; }
.xhbl-pop-avatar img { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid rgba(0,0,0,.05); }
.xhbl-pop-dot {
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--xhbl-accent, #2563eb); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.xhbl-pop-name { font-size: 15px; font-weight: 700; }
.xhbl-pop-desc { font-size: 12px; line-height: 1.6; opacity: .7; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.xhbl-pop-btns { display: flex; gap: 8px; }
.xhbl-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center;
    height: 32px; border-radius: 6px; font-size: 13px; font-weight: 600;
    text-decoration: none !important; cursor: pointer; transition: filter .15s ease;
}
.xhbl-btn:hover { filter: brightness(1.08); }
.xhbl-btn-go { background: var(--xhbl-accent, #2563eb); color: var(--xhbl-btn-text, #fff) !important; }
.xhbl-btn-intro { background: transparent; color: var(--xhbl-accent, #2563eb) !important; border: 1px solid var(--xhbl-accent, #2563eb); }

/* ---------- 介绍弹窗 ---------- */
.xhbl-modal { position: fixed; inset: 0; z-index: 1000000; display: none; }
.xhbl-modal.is-open { display: block; }
.xhbl-modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.xhbl-modal-card {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 400px; max-width: calc(100vw - 32px);
    padding: 22px; border-radius: 12px;
    background: var(--main-bg-color, #fff);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.xhbl-modal-close {
    position: absolute; top: 8px; right: 12px;
    background: none; border: none; font-size: 24px; line-height: 1;
    cursor: pointer; opacity: .5; padding: 4px;
}
.xhbl-modal-close:hover { opacity: 1; }
.xhbl-modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.xhbl-modal-avatar img { width: 48px; height: 48px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid rgba(0,0,0,.05); }
.xhbl-modal-avatar .xhbl-pop-dot { width: 48px; height: 48px; font-size: 20px; border-radius: 10px; }
.xhbl-modal-name { font-size: 17px; font-weight: 700; }
.xhbl-modal-desc { font-size: 13px; line-height: 1.7; opacity: .75; margin-bottom: 16px; }
.xhbl-modal-btns { display: flex; gap: 10px; }

/* ---------- 正文内被装饰的链接 ---------- */
a.xhbl-hoverable { border-bottom: 1px dashed var(--xhbl-accent, #2563eb); }

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
    .xhbl-grid { grid-template-columns: 1fr 1fr; }
    .xhbl-item { padding: 8px 10px; }
    .xhbl-avatar, .xhbl-avatar img, .xhbl-avatar-fallback { width: 32px; height: 32px; flex-basis: 32px; }
}

/* ---------- 导航卡片原位按钮替换 ---------- */
.xhbl-swap-host { position: relative; }
.xhbl-swap {
    position: absolute; left: 0; right: 0; top: 50%;
    transform: translateY(-50%);
    display: none; align-items: center; gap: 6px; padding-right: 2px;
}
.xhbl-swap-on .xhbl-swap { display: flex; }
.xhbl-swap-on dl { visibility: hidden; }
.xhbl-nav-btn {
    flex: 1; min-width: 0; height: 26px; padding: 0 6px;
    border-radius: 5px; font-size: 12px; font-weight: 600; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; white-space: nowrap;
}
.xhbl-nav-go { background: var(--xhbl-accent, #2563eb); color: var(--xhbl-btn-text, #fff); }
.xhbl-nav-intro { border: 1px solid var(--xhbl-accent, #2563eb); color: var(--xhbl-accent, #2563eb); background: transparent; }
.xhbl-nav-intro.xhbl-nav-solid { background: var(--xhbl-accent, #2563eb); color: var(--xhbl-btn-text, #fff); border-color: var(--xhbl-accent, #2563eb); }
.xhbl-nav-btn:active { filter: brightness(.92); }

/* ---------- 子比深色模式适配（body.dark-theme） ---------- */
body.dark-theme .xhbl-box,
body.dark-theme .xhbl-pop,
body.dark-theme .xhbl-modal-card {
    background: var(--main-bg-color, #1e2126);
    border-color: rgba(255, 255, 255, .08);
}
body.dark-theme .xhbl-item { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .08); }
body.dark-theme .xhbl-item:hover { border-color: var(--xhbl-accent, #2563eb); }
