/**
 * 标题前缀功能样式
 * 一、文字模式前缀徽章（带扫光动画）
 * 二、前台投稿页标题前缀配置界面
 */

/*一、文字前缀徽章*/
.zib_title_prefix {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    border-radius: 5px;
    padding: 5px 4px;
    margin-right: 3px;
    height: 19px;
    font-size: 12px;
    top: -3px;
    color: #fff;
    clip-path: polygon(7% 0, 99% 0, 93% 100%, 0 100%);
}

/*扫光动画*/
.zib_title_prefix:after {
    position: absolute;
    content: " ";
    display: block;
    left: -100%;
    top: -5px;
    width: 15px;
    height: 145%;
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
    animation: zib_title_prefix_sweep 3s ease-in-out infinite;
    transform: rotate(28deg);
}

@keyframes zib_title_prefix_sweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/*二、前台投稿页配置界面*/
.title-prefix-box {
    margin: 12px 0 4px;
    padding: 12px;
    border: 1px solid var(--main-border-color, #f0f0f0);
    border-radius: 8px;
    background: var(--main-bg-color, #f9f9f9);
}

.title-prefix-box .tp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

/*左侧标题（粉色竖线装饰）*/
.title-prefix-box .tp-title {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
}

.title-prefix-box .tp-bar {
    display: inline-block;
    width: 4px;
    height: 16px;
    border-radius: 2px;
    margin-right: 8px;
    background: var(--key-color, #ff5e7e);
}

/*模式切换按钮组（图片/文字）*/
.title-prefix-box .tp-mode-switch {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--main-border-color, #e3e3e3);
}

.title-prefix-box .tp-mode {
    display: inline-flex;
    margin: 0;
    cursor: pointer;
}

.title-prefix-box .tp-mode input {
    display: none;
}

.title-prefix-box .tp-mode span {
    display: inline-flex;
    align-items: center;
    padding: 4px 16px;
    font-size: 13px;
    background: var(--main-bg-color, #f2f2f2);
    color: var(--muted-color, #777);
    transition: all 0.2s;
}

/*选中的模式按钮高亮*/
.title-prefix-box .tp-mode input:checked + span {
    color: #fff;
    background: var(--key-color, #ff5e7e);
}

.title-prefix-box .tp-tip {
    font-size: 12px;
    color: var(--muted-3-color, #999);
    margin-bottom: 8px;
}

/*预设图片多选列表*/
.title-prefix-box .tp-img-list {
    display: flex;
    flex-wrap: wrap;
}

.title-prefix-box .tp-img-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 42px;
    margin: 0 8px 8px 0;
    padding: 5px;
    border: 2px solid var(--main-border-color, #e3e3e3);
    border-radius: 6px;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.2s;
}

.title-prefix-box .tp-img-item input {
    display: none;
}

.title-prefix-box .tp-img-item img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    pointer-events: none;
}

/*选中的图片：高亮边框+右上角对勾角标*/
.title-prefix-box .tp-img-item:has(input:checked) {
    border-color: var(--key-color, #ff5e7e);
}

.title-prefix-box .tp-img-item:has(input:checked):before {
    content: "\2713";
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 26px 26px 0;
    border-color: transparent var(--key-color, #ff5e7e) transparent transparent;
}

.title-prefix-box .tp-img-item:has(input:checked):after {
    content: "\2713";
    position: absolute;
    top: 0;
    right: 0;
    font-size: 12px;
    line-height: 22px;
    width: 26px;
    text-align: center;
    color: #fff;
}

/*文字输入框*/
.title-prefix-box .tp-text-input {
    margin-bottom: 10px;
}

/*背景颜色选择列表*/
.title-prefix-box .tp-color-list {
    display: flex;
    flex-wrap: wrap;
}

.title-prefix-box .tp-color {
    position: relative;
    display: inline-flex;
    margin: 0 8px 8px 0;
    cursor: pointer;
}

.title-prefix-box .tp-color input {
    display: none;
}

.title-prefix-box .tp-color span {
    display: inline-block;
    width: 30px;
    height: 20px;
    border-radius: 4px;
    transition: transform 0.15s;
}

/*选中的颜色块：粉色边框+对勾*/
.title-prefix-box .tp-color:has(input:checked) span {
    outline: 2px solid var(--key-color, #ff5e7e);
    outline-offset: 2px;
}

.title-prefix-box .tp-color:has(input:checked):after {
    content: "\2713";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    color: #fff;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/*侧栏（发布页）内显示时去掉外边距*/
.sidebar .title-prefix-box{margin:0;}
