/**
 * 子比评论@提及 - 样式
 * 颜色使用子比主题的 CSS 变量，自动适配日间/夜间模式
 */

/* ========== 评论里的 @ 标签 ========== */
.zbat-chip {
    color: var(--focus-color, #2997f7);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

a.zbat-chip:hover {
    opacity: 0.8;
}

.zbat-chip.zbat-gone {
    color: var(--muted-2-color, #999);
    font-weight: normal;
}

/* 头像加载后：头像 + 昵称 */
.zbat-chip.zbat-ready {
    display: inline-block;
    padding: 1px 0.65em 1px 0.2em;
    border-radius: 99px;
    background: rgba(128, 128, 128, 0.12);
    line-height: 1.5;
}

.zbat-chip.zbat-ready::before {
    content: "";
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    margin-right: 0.35em;
    border-radius: 50%;
    vertical-align: middle;
    background: var(--zbat-avatar) center / cover no-repeat, rgba(128, 128, 128, 0.25);
}

/* ========== 搜索面板 ========== */
.zbat-panel {
    position: fixed;
    z-index: 100010;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-height: 360px;
    overflow: hidden;
    border: 1px solid var(--main-border-color, rgba(128, 128, 128, 0.25));
    border-radius: var(--main-radius, 8px);
    background: var(--main-bg-color, #fff);
    color: var(--main-color, #333);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.zbat-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--muted-border-color, rgba(128, 128, 128, 0.2));
    color: var(--muted-2-color, #999);
}

.zbat-input {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
    color: var(--main-color, #333);
    font-size: 14px;
}

.zbat-tip {
    padding: 8px 12px 2px;
    font-size: 12px;
    color: var(--muted-2-color, #999);
}

.zbat-tip.zbat-warn {
    color: #f44336;
}

.zbat-list {
    flex: 1;
    margin: 0;
    padding: 4px;
    overflow-y: auto;
    list-style: none;
}

.zbat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
}

.zbat-item.active {
    background: rgba(128, 128, 128, 0.14);
}

.zbat-avatar {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(128, 128, 128, 0.2);
}

.zbat-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

/* AI 用户（与「子比主题 AI 用户」插件兼容） */
.zbat-ai-tag {
    margin-left: auto;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 16px;
    color: #7c3aed;
    background: rgba(124, 58, 237, .1);
    border: 1px solid rgba(124, 58, 237, .25);
    flex: none;
}
.dark-theme .zbat-ai-tag {
    color: #c4b5fd;
    background: rgba(167, 139, 250, .15);
    border-color: rgba(167, 139, 250, .35);
}

/* 已被对方拉黑：灰显，不能选择 */
.zbat-item.zbat-is-blocked {
    cursor: not-allowed;
}
.zbat-item.zbat-is-blocked .zbat-avatar,
.zbat-item.zbat-is-blocked .zbat-name {
    opacity: .45;
    filter: grayscale(1);
}
.zbat-blocked-tag {
    margin-left: auto;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 16px;
    color: #dc2626;
    background: rgba(220, 38, 38, .08);
    border: 1px solid rgba(220, 38, 38, .25);
    flex: none;
    white-space: nowrap;
}
.zbat-is-ai .zbat-blocked-tag {
    margin-left: 6px;
}
.dark-theme .zbat-blocked-tag {
    color: #fca5a5;
    background: rgba(248, 113, 113, .12);
    border-color: rgba(248, 113, 113, .35);
}

/* 在评论框里输入 @ 打开时：搜索框只显示 @ 后面输入的文字 */
.zbat-input[readonly] { cursor: default; }

/* 手机：16px 避免 iOS 点搜索框时页面自动放大；列表项加大便于点按 */
@media (max-width: 640px) {
    .zbat-input { font-size: 16px; }
    .zbat-search { padding: 10px 12px; }
}
