/**
 * 卡尼奶主题 — 前台投稿页样式（页面自包含）
 */

/* ---------------- 布局 ---------------- */
.knn-newposts-page .newpost-main {
    padding: 24px;
}

.knn-newposts-page .newpost-sider .newpost-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
    margin-bottom: 16px;
    overflow: hidden;
}

.newpost-box-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.newpost-box-body {
    padding: 14px 16px;
}

.newpost-box-desc {
    font-size: 12px;
    line-height: 1.6;
    margin-top: 8px;
}

/* ---------------- 无权限提示盒 ---------------- */
.knn-nocan-box {
    text-align: center;
    padding: 60px 20px;
}

.knn-nocan-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 10px;
}

.knn-nocan-desc {
    color: #888;
    font-size: 13px;
    margin-bottom: 14px;
}

.knn-nocan-btn {
    display: inline-block;
    padding: 8px 28px;
    border-radius: 20px;
    background: var(--theme-color, #2196f3);
    color: #fff !important;
    font-size: 14px;
}

.knn-cap-roles-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.knn-cap-role-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 14px;
    background: rgba(33, 150, 243, .1);
    color: var(--theme-color, #2196f3);
    font-size: 12px;
}

/* ---------------- 草稿提示 ---------------- */
.newpost-draft-tip {
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 152, 0, .08);
    color: #b26a00;
    font-size: 13px;
    margin-bottom: 14px;
}

/* ---------------- 封面编辑盒 ---------------- */
.newpost-featured-box {
    border: 1px dashed rgba(0, 0, 0, .15);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
}

.newpost-featured-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.newpost-featured-tab {
    padding: 5px 14px;
    border-radius: 15px;
    background: rgba(0, 0, 0, .04);
    font-size: 13px;
    color: inherit;
}

.newpost-featured-tab.is-active {
    background: var(--theme-color, #2196f3);
    color: #fff;
}

.newpost-featured-body {
    min-height: 60px;
}

.newpost-featured-img {
    position: relative;
    display: inline-block;
    max-width: 220px;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 8px 8px 0;
    vertical-align: top;
}

.newpost-featured-img img {
    display: block;
    width: 100%;
    height: auto;
}

.newpost-featured-remove,
.newpost-featured-remove-pic {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff !important;
    font-size: 12px;
}

.newpost-featured-upload {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 160px;
    height: 90px;
    border: 1px dashed rgba(0, 0, 0, .2);
    border-radius: 8px;
    color: #999;
    font-size: 13px;
    vertical-align: top;
}

.newpost-featured-upload.is-mini {
    width: 90px;
    height: 90px;
}

.newpost-featured-upload:hover {
    border-color: var(--theme-color, #2196f3);
    color: var(--theme-color, #2196f3);
}

.newpost-featured-video-pic {
    margin-top: 10px;
}

.newpost-featured-empty {
    line-height: 60px;
    text-align: center;
    font-size: 13px;
}

/* ---------------- 标题 ---------------- */
.newpost-title {
    display: block;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    overflow: hidden;
    background: transparent;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.5;
    padding: 6px 0;
    margin-bottom: 10px;
    color: inherit;
}

/* ---------------- 工具条自定义按钮图标（editextend.js 注册，FA6 Solid） ---------------- */
.mce-i-knn-img:before,
.mce-i-knn-video:before,
.mce-i-knn-file:before,
.mce-i-knn-iframe:before,
.mce-i-knn-hide:before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
}

.mce-i-knn-img:before { content: '\f03e'; }
.mce-i-knn-video:before { content: '\f008'; }
.mce-i-knn-file:before { content: '\f0c6'; }
.mce-i-knn-iframe:before { content: '\f121'; }
.mce-i-knn-hide:before { content: '\f070'; }

.newpost-save-date {
    font-size: 12px;
    margin-top: 8px;
    min-height: 18px;
}

/* ---------------- 富文本编辑器（tinymce 外观对齐子比） ---------------- */
.newpost-editor .wp-editor-wrap {
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 8px;
    overflow: hidden;
}

.newpost-editor .wp-editor-container {
    border: 0;
}

.newpost-editor .mce-panel {
    border-color: rgba(0, 0, 0, .06);
    background: #fff;
}

.newpost-editor .mce-toolbar-grp {
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    background: #fff;
    padding: 2px 4px;
}

.newpost-editor .mce-btn {
    background: transparent;
    border-color: transparent;
}

.newpost-editor .mce-btn:hover,
.newpost-editor .mce-btn.mce-active {
    background: rgba(0, 0, 0, .05);
    border-color: transparent;
    box-shadow: none;
}

.newpost-editor .mce-statusbar {
    border-top: 1px solid rgba(0, 0, 0, .06);
}

/* ---------------- 表单元素 ---------------- */
.newpost-input {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 8px;
    font-size: 13px;
    background: transparent;
    color: inherit;
    outline: none;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.newpost-input:focus {
    border-color: var(--theme-color, #2196f3);
}

.newpost-textarea {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 8px;
    font-size: 13px;
    resize: vertical;
    background: transparent;
    color: inherit;
    outline: none;
    box-sizing: border-box;
}

/* ---------------- 分类多选 ---------------- */
.newpost-cat-list {
    max-height: 260px;
    overflow-y: auto;
}

.newpost-cat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 13px;
    cursor: pointer;
}

/* ---------------- 开关 ---------------- */
.newpost-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.newpost-switch input {
    display: none;
}

.newpost-switch i {
    position: absolute;
    inset: 0;
    border-radius: 11px;
    background: rgba(0, 0, 0, .18);
    transition: background .2s;
}

.newpost-switch i::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: left .2s;
}

.newpost-switch input:checked+i {
    background: var(--theme-color, #2196f3);
}

.newpost-switch input:checked+i::after {
    left: 20px;
}

/* ---------------- 付费盒 ---------------- */
.newpost-pay-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.newpost-pay-label {
    flex: 0 0 62px;
    font-size: 13px;
}

.newpost-pay-line .newpost-input {
    flex: 1;
    margin-bottom: 4px;
}

.newpost-pay-download {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0, 0, 0, .1);
}

.newpost-pay-download-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
}

.newpost-pay-download-add {
    color: var(--theme-color, #2196f3);
    font-size: 12px;
}

.newpost-pay-download-row {
    position: relative;
    padding: 10px 30px 2px 10px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 8px;
    margin-bottom: 8px;
}

.newpost-pay-download-del {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #e53935;
    font-size: 13px;
}

/* ---------------- 提交盒 ---------------- */
.newpost-submit-btns {
    display: flex;
    gap: 10px;
}

.newpost-btn {
    flex: 1;
    padding: 9px 0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity .2s;
}

.newpost-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.newpost-btn-draft {
    background: rgba(0, 0, 0, .06);
    color: inherit;
}

.newpost-btn-submit {
    background: var(--theme-color, #2196f3);
    color: #fff;
}

.newpost-btn-submit:hover {
    opacity: .88;
}

/* ---------------- 弹窗 ---------------- */
.newpost-modal-mask {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    padding: 16px;
}

.newpost-modal-mask.is-open {
    display: flex;
}

.newpost-modal {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.newpost-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.newpost-modal-head a {
    color: #999;
}

.newpost-modal-body {
    padding: 16px;
}

.newpost-modal-foot {
    padding: 0 16px 16px;
    display: flex;
}

/* ---------------- 媒体弹窗（我的图片/视频/附件） ---------------- */
.newpost-modal-media {
    max-width: 460px;
    position: relative;
}

.newpost-modal-media > .newpost-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 2;
    color: #bbb;
    font-size: 16px;
}

.newpost-modal-media > .newpost-modal-close:hover {
    color: #666;
}

.newpost-modal-media .newpost-modal-body {
    padding-top: 20px;
}

.newpost-mtabs {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin-bottom: 14px;
}

.newpost-mtabs a {
    padding: 4px 2px;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
}

.newpost-mtabs a.is-active {
    color: var(--theme-color, #2196f3);
    border-bottom-color: var(--theme-color, #2196f3);
    font-weight: 600;
}

.newpost-media-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.newpost-media-bar .newpost-media-search {
    flex: 1;
    background: rgba(0, 0, 0, .04);
    border: 0;
    border-radius: 8px;
}

.newpost-media-upload {
    flex: 0 0 auto;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    background: rgba(33, 150, 243, .12);
    color: var(--theme-color, #2196f3);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
}

.newpost-media-upload:hover {
    background: rgba(33, 150, 243, .2);
}

.newpost-media-lists {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 50vh;
    overflow-y: auto;
    align-content: flex-start;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.newpost-media-lists:hover {
    scrollbar-color: rgba(146, 146, 146, .3) transparent;
}

.newpost-media-lists::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}

.newpost-media-lists::-webkit-scrollbar-track {
    border-radius: 10px;
    background: transparent;
}

.newpost-media-lists::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: rgba(0, 0, 0, 0);
}

.newpost-media-lists:hover::-webkit-scrollbar-thumb {
    background: rgba(146, 146, 146, .3);
}

.newpost-media-lists::-webkit-scrollbar-thumb:hover {
    background: rgba(145, 145, 145, .7);
}

.newpost-media-item {
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
}

.newpost-media-item.is-image {
    width: calc(25% - 4.5px);
    aspect-ratio: 1;
}

.newpost-media-item.is-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.newpost-media-item.is-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, .03);
    font-size: 13px;
}

.newpost-media-item.is-row .newpost-media-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.newpost-media-item.is-row .newpost-media-size {
    color: #999;
    font-size: 12px;
}

.newpost-media-item.is-active {
    border-color: var(--theme-color, #2196f3);
}

.newpost-media-item.is-uploading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .04);
    color: #999;
    cursor: default;
}

.newpost-media-index {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    background: var(--theme-color, #2196f3);
    color: #fff;
    font-size: 12px;
}

.newpost-media-item.is-active .newpost-media-index {
    display: block;
}

.newpost-media-item.is-row .newpost-media-index {
    position: static;
    flex: 0 0 auto;
}

.newpost-media-more {
    width: 100%;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    color: var(--theme-color, #2196f3);
}

.newpost-media-loading,
.newpost-media-empty {
    width: 100%;
    padding: 46px 0;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.newpost-mpane-tip {
    margin: 0 0 8px;
    font-size: 13px;
    color: #666;
}

.newpost-hide-types {
    display: flex;
    gap: 14px;
    margin-bottom: 10px;
    font-size: 13px;
}

.newpost-hide-types.newpost-hide-vips {
    flex-wrap: wrap;
    gap: 10px 16px;
}

.newpost-hide-types label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.newpost-form-tip {
    font-size: 12px;
    color: #999;
}

/* ---------------- 提示条 ---------------- */
.newpost-notice {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translate(-50%, -16px);
    z-index: 10000;
    padding: 9px 22px;
    border-radius: 8px;
    background: #323232;
    color: #fff;
    font-size: 13px;
    opacity: 0;
    visibility: hidden;
    transition: all .25s;
}

.newpost-notice.is-show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.newpost-notice.is-error {
    background: #e53935;
}

/* ---------------- 游客盒 ---------------- */
.newpost-guest-box .newpost-box-desc {
    margin: 0 0 10px;
}

/* ---------------- 移动端 ---------------- */
@media (max-width: 767px) {
    .knn-newposts-page .newpost-main {
        padding: 16px;
    }

    .newpost-title {
        font-size: 19px;
    }

    .newpost-featured-img,
    .newpost-featured-upload {
        max-width: 46%;
    }
}
