/*
 * @Author: iowen
 * @Author URI: https://www.iowen.cn/
 * @Description: 自定义样式
 */

/* ==========================================
 * [NAV] "我的导航" 自定义导航小工具样式
 * ========================================== */

/* --- Overall container --- */
.io-custom-nav.user-custome-style {
    position: relative;
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
}
.io-custom-nav .io-custom-nav-inner {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    padding: 0;
    overflow: hidden;
}
.io-black-mode .io-custom-nav .io-custom-nav-inner {
    background: #2D2E2F;
}

/* --- Header bar --- */
.io-custom-nav-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #edf0f2;
    margin-bottom: 0;
}
.io-custom-nav-header::before {
    display: none;
}
.io-custom-nav-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.io-custom-nav-folder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #22c55e;
    font-size: 16px;
    line-height: 1;
}
.io-custom-nav-title-text {
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

/* --- Category pills --- */
.io-custom-nav-category-pills {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.io-custom-nav-category-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 6px 12px;
    border-radius: 16px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
}
.io-custom-nav-category-pill.is-active {
    background: #15803d;
    color: #fff;
}
.io-custom-nav-category-pill:hover:not(.is-active) {
    background: #e5e7eb;
}

/* --- Action buttons --- */
.io-custom-nav-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}
.io-custom-nav-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 6px 14px;
    border-radius: 16px;
    color: #fff !important;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    text-decoration: none !important;
    box-shadow: none;
    transition: filter 0.15s, transform 0.15s;
    border: none;
}
.io-custom-nav-action-btn:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
}
.io-custom-nav-action-btn.is-green {
    background: #22c55e;
}
.io-custom-nav-action-btn.is-blue {
    background: #3b82f6;
}
.io-custom-nav-action-btn.is-gray {
    background: #6b7280;
}
.io-custom-nav-action-btn.is-red {
    background: #ef4444;
}
.io-custom-nav-edit-only {
    display: none;
}

/* --- Content area --- */
.io-custom-nav .io-custom-nav-sites {
    padding: 20px;
}
.io-custom-nav-sites-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    margin: 0;
}

/* --- Site cards (bookmark items) --- */
.io-custom-nav .io-custom-site {
    width: 168px;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 8px;
    box-shadow: none;
    transform: none;
    position: relative;
}
.io-custom-nav .io-custom-site:hover {
    box-shadow: none;
    transform: none;
}
.io-custom-site-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    text-decoration: none !important;
    overflow: hidden;
    transition: all 0.2s;
}
.io-custom-site-card:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}
.io-custom-nav .io-custom-site.edit-mode .io-custom-site-card {
    border: 2px solid #ef4444;
}

/* --- Site icon --- */
.io-custom-site-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    overflow: hidden;
    border-radius: 6px;
}
.io-custom-site-icon img {
    width: 24px;
    height: 24px;
    object-fit: cover;
}

/* --- Site name --- */
.io-custom-site-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    max-width: 100%;
}

/* --- Delete dot (edit mode) --- */
.io-custom-nav-delete-dot {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    min-width: 20px;
    padding: 0;
    background: #fff;
    color: #ef4444 !important;
    border: 1.5px solid #e5e7eb;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    z-index: 10;
    transition: all 0.15s;
}
.io-custom-nav-delete-dot:hover {
    background: #ef4444;
    color: #fff !important;
    border-color: #ef4444;
}

/* --- Add button (+) --- */
.io-custom-nav .io-custom-nav-add-card {
    width: 168px;
    margin: 0 !important;
    padding: 0 !important;
    align-self: flex-start;
}
.io-custom-nav-add-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    border: 2px dashed #c8c8c8;
    border-radius: 8px;
    background: #fff;
    color: #666;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.2s;
}
.io-custom-nav-add-plus:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

/* --- Edit helper text --- */
.io-custom-nav-edit-helper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 400;
    align-items: center;
}

/* --- Context menu (right-click) --- */
.io-custom-nav-context-menu {
    position: fixed;
    z-index: 99999;
    min-width: 180px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.08);
    padding: 6px 0;
    font-size: 13px;
    animation: ioContextMenuFadeIn 0.15s ease;
}
.io-custom-nav-context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.io-custom-nav-context-menu li {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #333;
    transition: background 0.15s;
}
.io-custom-nav-context-menu li:hover {
    background: rgba(59,130,246,0.08);
    color: #3b82f6;
}
.io-custom-nav-context-menu li.disabled {
    color: #aaa;
    cursor: default;
}
.io-custom-nav-context-menu li.disabled:hover {
    background: transparent;
    color: #aaa;
}
.io-black-mode .io-custom-nav-context-menu {
    background: #2D2E2F;
}
.io-black-mode .io-custom-nav-context-menu li {
    color: #ccc;
}
.io-black-mode .io-custom-nav-context-menu li:hover {
    background: rgba(59,130,246,0.15);
}

/* --- Modal styles --- */
.io-custom-nav-modal .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(22,30,42,0.28);
    overflow: hidden;
}
.io-custom-nav-modal .modal-body {
    padding: 28px 32px 30px;
}
.io-custom-nav-modal .modal-title {
    margin-bottom: 22px;
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
}
.io-custom-nav-modal .text-sm {
    display: inline-block;
    margin-top: 8px;
    color: #9ca3af !important;
    font-size: 13px;
}
.io-custom-nav-modal .form-control {
    height: 48px;
    border: none;
    border-radius: 10px;
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 500;
    font-size: 15px;
    padding: 0 16px;
}
.io-custom-nav-modal .form-control:focus {
    box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
    background: #fff;
}
.io-custom-nav-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    min-height: 36px;
    padding: 8px 24px;
    border: none;
    border-radius: 999px;
    color: #fff !important;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-decoration: none !important;
    transition: filter 0.15s, transform 0.15s;
}
.io-custom-nav-modal-btn:hover {
    filter: brightness(0.94);
    transform: translateY(-1px);
}
.io-custom-nav-modal-save {
    background: #22c55e;
}
.io-custom-nav-modal-cancel {
    background: #ef4444;
}

/* --- Empty state --- */
.io-custom-nav-empty .nothing {
    text-align: center;
    color: #9ca3af;
    padding: 2rem 0;
    font-size: 14px;
}

/* --- Drag state --- */
.io-custom-site.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}
.io-custom-site.drag-over {
    border: 2px dashed #3b82f6;
}

/* --- Responsive (max-width 768px) --- */
@media (max-width: 768px) {
    .io-custom-nav-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .io-custom-nav-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 8px;
    }
    .io-custom-nav .io-custom-site,
    .io-custom-nav .io-custom-nav-add-card {
        width: calc(50% - 8px);
    }
}

/* ==========================================
 * [TAB] 内容模块小工具样式 - 与 onenav-sites-card-resizer 插件完全一致
 * ========================================== */

/* Tab选项卡激活状态背景颜色 */
.slider-tab > .tab-item.active,
.slider-ul > .tab-item.active,
.io-slider-tab > .tab-item.active,
.io-tab-wrap .tab-item.active,
.sites-tab .tab-item.active,
.tab-list .tab-item.active,
.tab-item.active {
    background-color: #ff4d4f !important;
}

/* Tab内容模块小工具样式优化 - 全局边距 */
.oscr-tab-content-widget .tab-sites-widget {
    margin: 0 15px 20px 15px;
}

/* ---------- 移动端默认样式 (<768px) ---------- */
.oscr-tab-content-widget .tab-widget-nav .nav-link {
    width: 50px !important;
    height: 50px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 2px !important;
}
.oscr-tab-content-widget .tab-widget-nav .nav-link i {
    font-size: 1.5rem !important;
}
.oscr-tab-content-widget .tab-widget-nav .nav-link span {
    display: none !important;
}

/* 网址 / APP 区域 - grid 布局 */
.oscr-tab-content-widget .tab-widget-content .widget-item.item-favorites,
.oscr-tab-content-widget .tab-widget-content .widget-item.item-apps {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, 60px) !important;
    grid-gap: 10px !important;
    padding: 5px !important;
}
.oscr-tab-content-widget .icon-btn .img-bg {
    width: 60px !important;
    height: 60px !important;
    padding: 8px !important;
}

/* 确保 widget-item 有正确的网格布局 */
.oscr-tab-content-widget .tab-widget-content .widget-item {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -4px;
}

/* 书籍区域 */
.oscr-tab-content-widget .tab-widget-content .widget-item.item-books {
    display: flex;
    flex-wrap: wrap;
    margin: -5px -4px 0 -4px;
    padding: 0px 5px 5px 5px;
}
.oscr-tab-content-widget .tab-widget-content .widget-item.item-books .tab-card {
    width: 50%;
    padding: 3px 4px;
}

/* 文章 / 分类区域 */
.oscr-tab-content-widget .tab-widget-content .widget-item.item-category {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -4px;
    padding: 5px;
}
.oscr-tab-content-widget .tab-widget-content .widget-item.item-category .tab-card {
    width: 50%;
    padding: 4px;
}

/* 只针对书籍区域修复高度问题 */
.oscr-tab-content-widget .tab-widget-content .widget-item.item-books {
    overflow: visible !important;
    min-height: 200px !important;
}

/* 减少 tab 内容区域的顶部 padding */
.oscr-tab-content-widget .tab-widget-content {
    padding-top: 5px !important;
}

/* 让 tab 内容区域根据实际内容高度自适应 */
.oscr-tab-content-widget .tab-widget-content,
.oscr-tab-content-widget .tab-pane {
    height: auto !important;
    min-height: auto !important;
}

/* ---------- 带/不带侧边栏的布局样式 ---------- */
.oscr-tab-content-widget .tab-sites-body {
    display: flex !important;
    flex-wrap: nowrap !important;
}
.oscr-tab-content-widget .tab-content-main {
    flex: 1 !important;
    display: flex !important;
    width: 100% !important;
}

/* tab-widget-nav 固定宽度左侧导航，占满高度 */
.oscr-tab-content-widget .tab-widget-nav {
    flex-shrink: 0 !important;
    height: 100% !important;
}

/* tab-widget-content 占满剩余宽度 */
.oscr-tab-content-widget .tab-widget-content {
    flex: 1 !important;
    min-width: 0 !important;
}

/* 带侧边栏时，调整整体高度，没有 sidebar时 tab-content-main 不会被忽略 */
.oscr-tab-content-widget .tab-sites-body.has-sidebar {
    display: flex !important;
    flex-wrap: nowrap !important;
}

.oscr-tab-content-widget .tab-widget-sidebar {
    width: 299px !important;
    margin-left: 15px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 侧边栏中小工具的通用样式 */
.oscr-tab-content-widget .tab-widget-sidebar .card.io-sidebar-widget {
    margin-bottom: 0 !important;
    width: 299px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* 小工具内容区域样式 */
.oscr-tab-content-widget .tab-widget-sidebar .card.io-sidebar-widget .card-body {
    flex: 1 !important;
    overflow-y: auto !important;
    max-height: none !important;
}

/* 站点公告小工具特殊处理 - 固定高度 */
.oscr-tab-content-widget .tab-widget-sidebar .card.io-sidebar-widget.oscr-bulletin-widget {
    height: 342px !important;
}
.oscr-tab-content-widget .tab-widget-sidebar .card.io-sidebar-widget.oscr-bulletin-widget .card-body {
    overflow-y: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding-bottom: 0 !important;
}

/* 侧边栏中的 Tab 内容模块小工具特殊处理 */
.oscr-tab-content-widget .tab-widget-sidebar .card.io-sidebar-widget.oscr-tab-content-widget {
    height: auto !important;
    min-height: 200px !important;
    max-height: 400px !important;
}

/* 侧边栏中的 Tab 内容模块样式优化 */
.oscr-tab-content-widget .tab-widget-sidebar .oscr-tab-content-widget .tab-sites-widget {
    margin: 0 !important;
}
.oscr-tab-content-widget .tab-widget-sidebar .oscr-tab-content-widget .tab-widget-nav {
    display: none !important;
}
.oscr-tab-content-widget .tab-widget-sidebar .oscr-tab-content-widget .tab-widget-content {
    margin-left: 0 !important;
    padding: 10px !important;
}
.oscr-tab-content-widget .tab-widget-sidebar .oscr-tab-content-widget .widget-item {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, 60px) !important;
    grid-gap: 10px !important;
    padding: 5px !important;
}
.oscr-tab-content-widget .tab-widget-sidebar .oscr-tab-content-widget .icon-btn .img-bg {
    width: 60px !important;
    height: 60px !important;
    padding: 8px !important;
}

/* ---------- 响应式 - 小屏幕 (<=991px) 下隐藏侧边栏 ---------- */
@media screen and (max-width: 991px) {
    .oscr-tab-content-widget .tab-widget-sidebar {
        display: none !important;
    }
}

/* ---------- 桌面端 (≥992px) - 左侧工具区域与右侧高度一致 ---------- */
@media screen and (min-width: 992px) {
    .has-sidebar .tab-widget-nav {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .has-sidebar .tab-widget-nav .nav {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-around !important;
    }
    .has-sidebar .tab-widget-nav .nav-link {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: auto !important;
    }
    /* 确保整个 tab 内容区域高度自适应 */
    .tab-sites-body.has-sidebar {
        display: flex !important;
        align-items: stretch !important;
    }
}

/* 确保外层容器不会限制高度 */
.oscr-tab-content-widget .tab-sites-body {
    height: auto !important;
}

/* ---------- 卡片标题文字重叠修复 ---------- */
.oscr-tab-content-widget .tab-card .icon-title {
    line-height: 1.4 !important;
    min-height: 1.4em !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    padding-top: 4px !important;
    padding-bottom: 2px !important;
}
.oscr-tab-content-widget .tab-card .icon-title span {
    line-height: 1.4 !important;
    display: block !important;
    height: 1.4em !important;
}

/* ---------- 桌面端样式 (≥768px) ---------- */
@media screen and (min-width: 768px) {
    .oscr-tab-content-widget .tab-widget-nav .nav-link {
        width: 65px !important;
        height: 65px !important;
    }
    .oscr-tab-content-widget .tab-widget-nav .nav-link i {
        font-size: 1.725rem !important;
    }
    .oscr-tab-content-widget .tab-widget-nav .nav-link span {
        display: block !important;
    }
    .oscr-tab-content-widget .tab-widget-content .widget-item.item-favorites,
    .oscr-tab-content-widget .tab-widget-content .widget-item.item-apps {
        grid-template-columns: repeat(auto-fill, 70px) !important;
        grid-gap: 22px !important;
    }
    .oscr-tab-content-widget .icon-btn .img-bg {
        width: 70px !important;
        height: 70px !important;
        padding: 8px !important;
    }
    .oscr-tab-content-widget .tab-widget-content .widget-item.item-books .tab-card {
        width: 16.666667%;
    }
    .oscr-tab-content-widget .tab-widget-content .widget-item.item-category .tab-card {
        width: 33.333333%;
    }
}

/* ---------- 中等屏幕 (992px - 1199px) ---------- */
@media screen and (min-width: 992px) and (max-width: 1199px) {
    .oscr-tab-content-widget .tab-widget-content .widget-item.item-books .tab-card {
        width: 14.285714%;
    }
}

/* ---------- 大屏幕 (≥1200px) ---------- */
@media screen and (min-width: 1200px) {
    .oscr-tab-content-widget .tab-widget-content .widget-item.item-books .tab-card {
        width: 11.111111%;
    }
    .oscr-tab-content-widget .tab-widget-content .widget-item.item-category .tab-card {
        width: 20%;
    }
}

/* ==========================================
 * 公告小工具 - 与 onenav-sites-card-resizer 插件完全一致
 * ========================================== */

/* 站点公告时间线样式 */
.oscr-bulletin-timeline {
    position: relative;
    padding-left: 20px;
    padding-right: 5px;
    padding-bottom: 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
/* 滚动条样式 */
.oscr-bulletin-timeline::-webkit-scrollbar {
    width: 4px;
}
.oscr-bulletin-timeline::-webkit-scrollbar-track {
    background: transparent;
}
.oscr-bulletin-timeline::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}
.io-black-mode .oscr-bulletin-timeline::-webkit-scrollbar-thumb,
body.io-black-mode .oscr-bulletin-timeline::-webkit-scrollbar-thumb {
    background: #555 !important;
}
.oscr-bulletin-item {
    position: relative;
    padding-bottom: 12px;
}
.oscr-bulletin-item:last-child {
    padding-bottom: 0;
}
/* 圆点 */
.oscr-bulletin-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border: 2px solid #999;
    border-radius: 50%;
    background: #fff;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.oscr-bulletin-dot::after {
    content: '';
    width: 4px;
    height: 4px;
    background: #999;
    border-radius: 50%;
}
/* 连接线 - 只在有 has-line 类的项目上显示 */
.oscr-bulletin-item.has-line::after {
    content: '';
    position: absolute;
    left: -15px;
    top: 16px;
    bottom: 0;
    width: 2px;
    background: #ccc;
}

/* 最后一个项目的连接线调整 */
.oscr-bulletin-timeline .oscr-bulletin-item:last-child.has-line::after {
    bottom: 6px;
}
.oscr-bulletin-content {
    position: relative;
}
.oscr-bulletin-title {
    display: block;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    margin-bottom: 3px;
    line-height: 1.4;
}
.oscr-bulletin-title:hover {
    color: #666;
}
.oscr-bulletin-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}
.oscr-bulletin-views {
    display: flex;
    align-items: center;
    gap: 3px;
}
.oscr-bulletin-views i {
    font-size: 12px;
}

/* 夜间模式样式适配 */
.io-black-mode .oscr-bulletin-dot,
body.io-black-mode .oscr-bulletin-dot,
.io-black-mode .oscr-bulletin-timeline .oscr-bulletin-dot {
    border-color: #888 !important;
    background: #2d3748 !important;
}
.io-black-mode .oscr-bulletin-dot::after,
body.io-black-mode .oscr-bulletin-dot::after,
.io-black-mode .oscr-bulletin-timeline .oscr-bulletin-dot::after {
    background: #888 !important;
}
.io-black-mode .oscr-bulletin-item.has-line::after,
body.io-black-mode .oscr-bulletin-item.has-line::after,
.io-black-mode .oscr-bulletin-timeline .oscr-bulletin-item.has-line::after {
    background: #4a5568 !important;
}

/* 夜间模式下最后一个项目的连接线调整 */
.io-black-mode .oscr-bulletin-timeline .oscr-bulletin-item:last-child.has-line::after,
body.io-black-mode .oscr-bulletin-timeline .oscr-bulletin-item:last-child.has-line::after {
    bottom: 6px;
}
.io-black-mode .oscr-bulletin-title,
body.io-black-mode .oscr-bulletin-title,
.io-black-mode .oscr-bulletin-timeline .oscr-bulletin-title {
    color: #e2e8f0 !important;
}
.io-black-mode .oscr-bulletin-title:hover,
body.io-black-mode .oscr-bulletin-title:hover,
.io-black-mode .oscr-bulletin-timeline .oscr-bulletin-title:hover {
    color: #a0aec0 !important;
}
.io-black-mode .oscr-bulletin-meta,
body.io-black-mode .oscr-bulletin-meta,
.io-black-mode .oscr-bulletin-timeline .oscr-bulletin-meta {
    color: #a0aec0 !important;
}

/* 更多按钮容器 */
.oscr-bulletin-more-btn-wrapper {
    text-align: center;
    padding: 10px 0 10px 0;
    margin-left: -14px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

/* 更多按钮样式 */
.oscr-bulletin-more-btn {
    display: block;
    width: 100%;
    min-height: 40px;
    line-height: 38px;
    text-align: center;
    color: #ff4d4f;
    border: 1px solid #ff4d4f;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 14px;
    transition: all 0.3s ease;
    background: transparent;
    box-sizing: border-box;
    overflow: visible;
}

.oscr-bulletin-more-btn:hover {
    background: #ff4d4f;
    color: #fff !important;
}

/* 夜间模式下的按钮样式 */
.io-black-mode .oscr-bulletin-more-btn,
body.io-black-mode .oscr-bulletin-more-btn {
    border-color: #ff4d4f;
    color: #ff4d4f;
}

.io-black-mode .oscr-bulletin-more-btn:hover,
body.io-black-mode .oscr-bulletin-more-btn:hover {
    background: #ff4d4f;
    color: #fff !important;
}

/* ==========================================
 * 悬浮推广卡片 — io-child-promo-card
 * ========================================== */

/* ---------- 外层容器（固定定位 + 阴影） ---------- */
.io-child-promo-card {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 99998;
    width: 280px;
    animation: ioPromoFadeIn 0.4s ease;
    isolation: isolate;
    pointer-events: auto;
}

.io-child-promo-card.io-promo-hide {
    animation: ioPromoFadeOut 0.3s ease forwards !important;
}

@keyframes ioPromoFadeIn {
    from { opacity: 0; transform: translateY(15px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ioPromoFadeOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(15px) scale(0.95); }
}

/* ---------- 内层卡片：半透明 + 圆角 + 玻璃拟态 ---------- */
.io-child-promo-card .promo-card-inner {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15),
                0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* ---------- 顶部图片区 ---------- */
.io-child-promo-card .promo-card-image {
    background: linear-gradient(135deg, #ff7a59 0%, #ff4d4f 50%, #ff1f4b 100%);
    height: 120px;
    text-align: center;
    overflow: hidden;
    position: relative;
}

.io-child-promo-card .promo-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.io-child-promo-card .promo-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.92);
}
.io-child-promo-card .promo-icon-placeholder i {
    font-size: 60px;
    opacity: 0.9;
}

/* ---------- 关闭按钮：提升 z-index + 确保可点击 ---------- */
.io-child-promo-card .promo-card-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff !important;
    border: 2px solid rgba(255, 255, 255, 0.85) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    pointer-events: auto !important;
    transition: background 0.2s ease, transform 0.2s ease;
    padding: 0;
    margin: 0;
    line-height: 1;
    font-size: 20px;
    font-weight: 700;
    font-family: Arial, Helvetica, sans-serif;
    text-decoration: none;
    font-style: normal;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.io-child-promo-card .promo-card-close:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: rotate(90deg) scale(1.05);
    z-index: 99999 !important;
}
.io-child-promo-card .promo-card-close:focus {
    outline: none;
    z-index: 99999 !important;
}
.io-child-promo-card .promo-card-close:active {
    transform: scale(0.95);
    z-index: 99999 !important;
}

/* ---------- 内容区 ---------- */
.io-child-promo-card .promo-card-body {
    padding: 18px 16px 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.io-child-promo-card .promo-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 6px;
    letter-spacing: 1px;
}

.io-child-promo-card .promo-card-subtitle {
    font-size: 13px;
    color: #888;
    margin: 0 0 12px;
    line-height: 1.4;
}

.io-child-promo-card .promo-card-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.io-child-promo-card .promo-price-current {
    color: #ff4d4f;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

.io-child-promo-card .promo-price-old {
    color: #bbb;
    text-decoration: line-through;
    font-size: 14px;
}

/* ---------- 购买按钮 ---------- */
.io-child-promo-card .promo-card-btn {
    display: block;
    width: 100%;
    padding: 11px 0;
    border-radius: 10px;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.3);
}

.io-child-promo-card .promo-card-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 6px 16px rgba(255, 77, 79, 0.4);
}

/* ---------- 暗色模式适配 ---------- */
body.io-black-mode .io-child-promo-card .promo-card-inner {
    background: rgba(45, 46, 47, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4),
                0 2px 6px rgba(0, 0, 0, 0.25);
}

body.io-black-mode .io-child-promo-card .promo-card-title {
    color: #f1f1f1;
}

body.io-black-mode .io-child-promo-card .promo-card-subtitle {
    color: #aaa;
}

body.io-black-mode .io-child-promo-card .promo-price-old {
    color: #888;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .io-child-promo-card {
        width: 220px;
        right: 10px;
        bottom: 20px;
    }
    .io-child-promo-card .promo-card-image {
        height: 90px;
    }
    .io-child-promo-card .promo-icon-placeholder i {
        font-size: 44px;
    }
    .io-child-promo-card .promo-card-title {
        font-size: 17px;
    }
    .io-child-promo-card .promo-price-current {
        font-size: 24px;
    }
}

/* 极小屏幕隐藏（避免遮挡） */
@media (max-width: 480px) {
    .io-child-promo-card {
        display: none;
    }
}

/* ==========================================
 * 文章目录导航小工具 — io-child-toc-widget
 * ========================================== */

/* ---------- 根容器 ---------- */
.io-child-toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
}

.io-child-toc-list * {
    box-sizing: border-box;
}

/* 左侧渐变竖线装饰 */
.io-child-toc-list::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, #4a90e2 0%, #7bb3f0 50%, #e8e8e8 100%);
    border-radius: 2px;
}

body.io-black-mode .io-child-toc-list::before {
    background: linear-gradient(180deg, #4a90e2 0%, #3d7dbd 50%, #4a4a4a 100%);
}

/* ---------- UL 列表 ---------- */
.toc-root,
.toc-root ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.toc-root ul {
    padding-left: 18px;
    margin-top: 2px;
    margin-bottom: 2px;
}

/* ---------- LI 列表项 ---------- */
.toc-item {
    display: block;
    margin: 2px 0;
    position: relative;
}

.toc-item a.toc-link {
    display: flex;
    align-items: center;
    padding: 6px 10px 6px 22px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
    cursor: pointer;
    position: relative;
    word-break: break-word;
}

.toc-item a.toc-link:hover {
    background: rgba(74, 144, 226, 0.08);
    color: #4a90e2;
    padding-left: 26px;
}

/* 层级区分不同颜色 */
.toc-item-1 > a.toc-link {
    font-weight: 600;
    color: #333;
}

.toc-item-2 > a.toc-link {
    color: #555;
}

.toc-item-3 > a.toc-link {
    color: #666;
    font-size: 12px;
}

.toc-item-4 > a.toc-link,
.toc-item-5 > a.toc-link,
.toc-item-6 > a.toc-link {
    color: #777;
    font-size: 12px;
}

/* 圆点指示器（替代数字） */
.toc-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
    margin-right: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.toc-item-1 > a.toc-link .toc-dot {
    background: #4a90e2;
}

.toc-item-2 > a.toc-link .toc-dot {
    background: #7bb3f0;
}

.toc-item-3 > a.toc-link .toc-dot {
    background: #a5c8ee;
}

.toc-item a.toc-link:hover .toc-dot {
    transform: scale(1.4);
    background: #4a90e2;
}

/* ---------- 当前章节高亮 ---------- */
.toc-item.toc-active > a.toc-link {
    background: rgba(74, 144, 226, 0.12);
    color: #4a90e2;
    font-weight: 600;
    padding-left: 26px;
}

.toc-item.toc-active > a.toc-link .toc-dot {
    background: #4a90e2;
    transform: scale(1.4);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

/* ---------- 暗色模式适配 ---------- */
body.io-black-mode .toc-item a.toc-link {
    color: #bbb;
}

body.io-black-mode .toc-item-1 > a.toc-link {
    color: #e0e0e0;
}

body.io-black-mode .toc-item a.toc-link:hover {
    background: rgba(74, 144, 226, 0.18);
    color: #7bb3f0;
}

body.io-black-mode .toc-item.toc-active > a.toc-link {
    background: rgba(74, 144, 226, 0.25);
    color: #7bb3f0;
}

body.io-black-mode .toc-item.toc-active > a.toc-link .toc-dot {
    background: #7bb3f0;
    box-shadow: 0 0 0 3px rgba(123, 179, 240, 0.2);
}

/* ---------- 浮动卡片样式（在文章内容中） ---------- */
.io-child-toc-float-box {
    max-width: 100%;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.io-child-toc-float-box .io-toc-toggle {
    border: 1px solid #e0e0e0;
    background: #fafafa;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.io-child-toc-float-box .io-toc-toggle:hover {
    background: #4a90e2;
    color: #fff;
    border-color: #4a90e2;
}

.io-child-toc-float-box .io-toc-toggle .fa {
    font-size: 12px;
    transition: transform 0.3s ease;
}

/* 收起状态 */
.io-child-toc-float-box.io-toc-collapsed .io-toc-toggle .fa {
    transform: rotate(180deg);
}

.io-child-toc-float-box.io-toc-collapsed .io-toc-float-body {
    display: none;
}

.io-child-toc-float-box .io-toc-float-body {
    max-height: 420px;
    overflow-y: auto;
}

.io-child-toc-float-box .io-toc-float-body::-webkit-scrollbar {
    width: 4px;
}
.io-child-toc-float-box .io-toc-float-body::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 2px;
}
.io-child-toc-float-box .io-toc-float-body::-webkit-scrollbar-track {
    background: transparent;
}

body.io-black-mode .io-child-toc-float-box {
    background: rgba(45, 46, 47, 0.9);
}

body.io-black-mode .io-child-toc-float-box .io-toc-toggle {
    border-color: #555;
    background: #3a3a3a;
    color: #ccc;
}

/* ---------- 响应式（移动端） ---------- */
@media (max-width: 768px) {
    .io-child-toc-float-box .io-toc-float-body {
        max-height: 300px;
    }
    .toc-item a.toc-link {
        font-size: 12px;
        padding: 5px 8px 5px 20px;
    }
}

/* ============================================================
 *  子主题：收藏引导弹窗（与参考截图视觉一致）
 * ============================================================ */

/* ---------- 最外层：悬浮容器 ---------- */
.io-fav-popup {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 40px;
    z-index: 99998;
    display: flex;
    justify-content: center;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ---------- 卡片主体 ---------- */
.io-fav-popup-inner {
    position: relative;
    min-width: 560px;
    max-width: 82vw;
    padding: 16px 24px 14px 22px;
    background: #2a2d39;           /* 深蓝灰（与截图一致） */
    background: linear-gradient(135deg, #2e3140 0%, #252833 100%);
    border: 1px solid #666a78;     /* 浅色圆角边框 */
    border-radius: 12px;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    color: #e8e8ea;
    pointer-events: auto;
    overflow: visible;              /* 允许图片溢出边缘 */
}

/* ---------- 关闭按钮（圆形 + 可见边框） ---------- */
.io-fav-popup-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: 1.5px solid #b4b8c5;    /* 灰色圆形边框 */
    border-radius: 50%;
    background: #2a2d39;
    color: #e8e8ea;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    z-index: 99999;
}
.io-fav-popup-close:hover {
    background: #3a3d4a;
    border-color: #fff;
    color: #fff;
    transform: rotate(90deg);
}
.io-fav-popup-close:active {
    transform: rotate(180deg) scale(0.9);
}

/* ---------- 内容容器：左文字 / 右图片 ---------- */
.io-fav-popup-content {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    min-height: 120px;
}

/* ---------- 左侧文字区（标题部分可延伸到右侧，仅底部避让图片） ---------- */
.io-fav-popup-text {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
    padding-bottom: 4px;
    padding-right: 0;
    position: relative;
    z-index: 2;
}

/* ---------- 标题（下方带细分隔线） ---------- */
.io-fav-popup-title {
    margin: 0 0 10px 0;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    position: relative;
}
.io-fav-popup-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: #5a5d68;           /* 浅灰色细分隔线 */
    opacity: 0.7;
}

/* ---------- 描述文案（底部避让图片） ---------- */
.io-fav-popup-desc {
    margin: 10px 0 12px 0;
    font-size: 14px;
    line-height: 1.75;
    color: #c8cad2;                 /* 亮灰色文字 */
    word-break: break-word;
    padding-right: 140px;
}

/* ---------- 底部链接：圆圈勾选图标 + 文字（避让图片） ---------- */
.io-fav-popup-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e8e8ea;
    font-size: 14px;
    text-decoration: none;
    margin-top: 2px;
    transition: color 0.2s ease;
    padding-right: 140px;
}
.io-fav-popup-link:hover {
    color: #ffffff;
}
.io-fav-popup-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1.5px solid #e8e8ea;   /* 圆形白色边框 */
    border-radius: 50%;
    color: #e8e8ea;
}

/* ---------- 右侧图片（较小尺寸，避免遮挡文字） ---------- */
.io-fav-popup-image {
    position: absolute;
    right: -10px;
    bottom: -4px;
    width: 140px;
    height: auto;
    pointer-events: none;
    z-index: 1;
}
.io-fav-popup-image img {
    width: 100%;
    height: auto;
    max-height: 170px;
    max-width: 100%;
    object-fit: contain;
    display: block;
    border-radius: 6px;
    image-rendering: -webkit-optimize-contrast;
}

/* ---------- 暗色模式：与主题保持一致 ---------- */
body.io-black-mode .io-fav-popup-inner {
    background: linear-gradient(135deg, #2a2d38 0%, #20232c 100%);
    border-color: #5a5d68;
    color: #e8e8ea;
}
body.io-black-mode .io-fav-popup-title {
    color: #ffffff;
}
body.io-black-mode .io-fav-popup-title::after {
    background: #565966;
}
body.io-black-mode .io-fav-popup-desc {
    color: #c0c2cc;
}
body.io-black-mode .io-fav-popup-close {
    border-color: #9095a6;
    background: #2a2d38;
}

/* ---------- 移动端响应式 ---------- */
@media (max-width: 768px) {
    .io-fav-popup {
        bottom: 20px;
    }
    .io-fav-popup-inner {
        min-width: 0;
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
        padding: 14px 20px 14px 18px;
    }
    .io-fav-popup-content {
        gap: 12px;
        min-height: 100px;
    }
    .io-fav-popup-image {
        position: static;
        flex-shrink: 0;
        width: 110px;
        display: flex;
        align-items: center;
    }
    .io-fav-popup-image img {
        max-height: 140px;
    }
    .io-fav-popup-title {
        font-size: 15px;
    }
    .io-fav-popup-desc {
        font-size: 13px;
        line-height: 1.6;
    }
    .io-fav-popup-link {
        font-size: 13px;
    }
}

@media (max-width: 540px) {
    .io-fav-popup-content {
        flex-direction: column;
        gap: 6px;
    }
    .io-fav-popup-image {
        width: 90px;
        align-self: center;
    }
    .io-fav-popup-image img {
        max-height: 110px;
    }
}

/* ==========================================
 * 卡片角标（推荐/热门/新上线等标签）
 * — 与后台 button_set 预览保持严格一致
 *   角标定位在卡片根节点（.posts-item / .tab-card）的边角
 *   padding / font-size / border-radius / top / right / left 等
 *   均与后台 HTML 预览的 inline style 相同
 *
 *   关键调整：卡片设置 overflow:hidden，使丝带型角标只在卡片内部可见，
 *   形成「从卡片斜角穿出」的效果（如参考图2）。
 *   兼容：网址/APP/文章/书籍卡片全部共享 posts-item 根类名。
 * ========================================== */

/* 卡片根节点作为角标的定位父级 */
.posts-item,
.tab-card {
    position: relative;
}

/* 仅对真正有角标的卡片启用 overflow 裁切 —— 避免影响父主题其他卡片布局 */
.io-card-has-badge {
    overflow: hidden !important;
}

/* ---------- 基础角标容器（对应后台预览中角标的通用样式） ---------- */
.io-site-badge {
    position: absolute;
    z-index: 20;
    pointer-events: none;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    white-space: nowrap;
    color: #ffffff;
    background-color: #dc3545;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.4);
}

/* ============================================================
 *  类型1：标签型（label）
 *  后台预览：padding:2px 8px; border-radius:3px; font-size:10px;
 *           font-weight:600; letter-spacing:1px; top:4px; right/left:4px;
 * ============================================================ */
.io-site-badge-label {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    line-height: 1.4;
}

.io-site-badge-label-right {
    top: 4px;
    right: 4px;
}
.io-site-badge-label-left {
    top: 4px;
    left: 4px;
}

/* ============================================================
 *  类型2：丝带型（corner）
 *  后台预览：padding:1px 26px; font-size:9px; font-weight:500;
 *           letter-spacing:1px; box-shadow:0 2px 4px rgba(220,53,69,0.4);
 *           top:6px; right/left:-22px; transform:rotate(±45deg);
 * ============================================================ */
.io-site-badge-corner {
    padding: 1px 26px;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 1.4;
    border-radius: 0;
    transform-origin: center center;
}

.io-site-badge-corner-right {
    top: 6px;
    right: -22px;
    transform: rotate(45deg);
}
.io-site-badge-corner-left {
    top: 6px;
    left: -22px;
    transform: rotate(-45deg);
}

/* ---------- 响应式：小屏下角标缩小以避免遮挡过多内容 ---------- */
@media (max-width: 576px) {
    .io-site-badge-label {
        padding: 2px 6px;
        font-size: 10px;
    }
    .io-site-badge-corner {
        padding: 1px 22px;
        font-size: 9px;
    }
    .io-site-badge-corner-right {
        right: -20px;
        top: 5px;
    }
    .io-site-badge-corner-left {
        left: -20px;
        top: 5px;
    }
}

/* ==========================================
 * 卡片失效（失效网址/APP/文章/书籍）
 *
 * 4 种样式与后台 button_set 预览一致：
 *   style1 - 右侧竖条（高度 100% 文本垂直排列）
 *   style2 - 右上角标签
 *   style3 - 左上角标签
 *   style4 - 中间印章（旋转 -18° 的边框文本）
 *
 * 核心：io-invalid-site 整体降低透明度 + 灰度
 *       io-invalid-overlay 覆盖层仅对点击/选中无感（pointer-events:none）
 * ========================================== */

/* 卡片整体作为失效覆盖层的定位基准 */
.tab-card,
.posts-item {
    position: relative;
}

/* 卡片视觉「失效」标志：降低整体透明度 + 灰度滤镜（不遮挡内容） */
.io-invalid-site {
    opacity: 0.78;
    filter: grayscale(35%);
}

/* 覆盖层容器 —— 禁止点击/选择，避免影响正常交互 */
/* 注意：top/left/right/bottom:0 仅作为 style4 印章式的默认全屏定位；
   style1/2/3 由 inline-style 明确指定边角坐标，避免覆盖整卡 */
.io-invalid-overlay {
    pointer-events: none;
    user-select: none;
    z-index: 10;
    position: absolute;
}

/* ---------- style1：右侧竖条（垂直排列文本） ---------- */
.io-invalid-overlay.io-invalid-style1 {
    /* 实际样式由 inline-style 控制，此处仅增强字体层级 */
    font-weight: 600;
    letter-spacing: 1px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* ---------- style2 & style3：四角角标（小标签） ---------- */
.io-invalid-overlay.io-invalid-style2,
.io-invalid-overlay.io-invalid-style3 {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    font-weight: 600;
    letter-spacing: 1px;
}

/* ---------- style4：中间印章（旋转文本） ---------- */
.io-invalid-overlay.io-invalid-style4 {
    font-family: 'STKaiti', 'KaiTi', 'SimKai', 'serif';
    border-style: solid;
    border-width: 3px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15),
                inset 0 0 0 1px rgba(220, 53, 69, 0.1);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9);
    font-weight: bold;
}

/* ---------- 响应式：小屏下缩小印章与角标 ---------- */
@media (max-width: 768px) {
    .io-invalid-overlay.io-invalid-style4 {
        font-size: 14px;
        padding: 6px 12px;
    }
    .io-invalid-overlay.io-invalid-style1 {
        font-size: 12px;
        width: 24px;
        line-height: 1.2;
        padding: 6px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 0 8px 8px 0;
    }
    .io-invalid-overlay.io-invalid-style2,
    .io-invalid-overlay.io-invalid-style3 {
        font-size: 11px;
        padding: 3px 6px;
    }
}

/* ============================================================
 *  卡片失效（失效网址/APP/文章/书籍）—— tab 内容模块适配
 *  —— 覆盖层位于 .tab-card 卡片根节点，由卡片自身的 overflow:hidden 裁剪
 *  —— 竖条（style1）必须够宽，才能完整显示「已失效」等中文字
 * ============================================================ */

/* ---------- 卡片根节点作为覆盖层的定位基准 ---------- */
.tab-card {
    position: relative !important;
    overflow: visible !important;
    border-radius: 8px;
}

/* 内部内容容器设置overflow:hidden裁切圆角，根节点保持visible以完整显示丝带角标 */
.tab-card > a:first-child {
    border-radius: inherit;
    overflow: hidden;
    display: block;
}

/* ---------- style1：右侧竖条（垂直排列文本）
 *  高度：只覆盖图标区域（60px/70px），不延伸到下方标题区
 *  宽度：足够容纳完整的中文字（22-24px）
 *  文字方向：vertical-lr + upright（文字正向直立，从上到下阅读顺序正确）
 * ----------------------------------------- */
.tab-card .io-invalid-overlay.io-invalid-style1 {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    height: 60px !important;
    width: 24px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    padding: 6px 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    writing-mode: vertical-lr !important;
    text-orientation: upright !important;
    z-index: 10 !important;
    border-radius: 0 8px 8px 0 !important;
    box-shadow: none !important;
    pointer-events: none !important;
    user-select: none !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

/* ---------- style2：右上角标签 ---------- */
.tab-card .io-invalid-overlay.io-invalid-style2 {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    font-size: 11px !important;
    padding: 2px 8px !important;
    border-radius: 3px !important;
    font-weight: 600 !important;
    z-index: 10 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25) !important;
    pointer-events: none !important;
    user-select: none !important;
}

/* ---------- style3：左上角标签 ---------- */
.tab-card .io-invalid-overlay.io-invalid-style3 {
    position: absolute !important;
    top: 4px !important;
    left: 4px !important;
    right: auto !important;
    font-size: 11px !important;
    padding: 2px 8px !important;
    border-radius: 3px !important;
    font-weight: 600 !important;
    z-index: 10 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25) !important;
    pointer-events: none !important;
    user-select: none !important;
}

/* ---------- style4：中间印章（旋转文本）
 *  关键点：使用 translate(-50%, -50%) 让标签的**中心**对齐到目标位置，
 *  而不是让标签的顶部对齐到目标位置。
 *  top: 30px 对应 60px 图片的垂直中心。
 * ----------------------------------------- */
.tab-card .io-invalid-overlay.io-invalid-style4 {
    position: absolute !important;
    top: 30px !important;
    left: 50% !important;
    transform: translate(-50%, -50%) rotate(-18deg) !important;
    font-size: 12px !important;
    font-weight: bold !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    border-style: solid !important;
    border-width: 2px !important;
    opacity: 0.92 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9) !important;
    z-index: 10 !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    user-select: none !important;
}

/* 桌面端（≥768px）图标更大（70px），相应地调整高度与字号 */
@media (min-width: 768px) {
    .tab-card .io-invalid-overlay.io-invalid-style1 {
        height: 70px !important;
        width: 26px !important;
        font-size: 13px !important;
        line-height: 1.2 !important;
        padding: 8px 0 !important;
        border-radius: 0 8px 8px 0 !important;
    }
    .tab-card .io-invalid-overlay.io-invalid-style2,
    .tab-card .io-invalid-overlay.io-invalid-style3 {
        font-size: 12px !important;
        padding: 3px 9px !important;
        top: 5px !important;
        right: 5px !important;
    }
    .tab-card .io-invalid-overlay.io-invalid-style3 {
        left: 5px !important;
        right: auto !important;
    }
    .tab-card .io-invalid-overlay.io-invalid-style4 {
        top: 35px !important;
        font-size: 13px !important;
        padding: 5px 12px !important;
    }
}

/* 卡片整体视觉「失效」标志 —— 降低透明度 + 灰度滤镜（不遮挡内容） */
.tab-card.io-invalid-site {
    opacity: 0.78;
    filter: grayscale(35%);
}

/* ============================================================
 *  通用：父主题首页 / 分类页卡片（.posts-item）的失效标签
 * ============================================================ */

.posts-item {
    position: relative !important;
}

.posts-item.io-invalid-site {
    overflow: hidden !important;
    border-radius: 8px;
}

.posts-item .io-invalid-overlay {
    pointer-events: none !important;
    user-select: none !important;
}

.posts-item .io-invalid-overlay.io-invalid-style1 {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    height: 100% !important;
    width: 26px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    padding: 8px 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    writing-mode: vertical-lr !important;
    text-orientation: upright !important;
    z-index: 10 !important;
    border-radius: 0 8px 8px 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

.posts-item .io-invalid-overlay.io-invalid-style2 {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    font-size: 12px !important;
    padding: 3px 10px !important;
    border-radius: 3px !important;
    font-weight: 600 !important;
    z-index: 10 !important;
}

.posts-item .io-invalid-overlay.io-invalid-style3 {
    position: absolute !important;
    top: 6px !important;
    left: 6px !important;
    font-size: 12px !important;
    padding: 3px 10px !important;
    border-radius: 3px !important;
    font-weight: 600 !important;
    z-index: 10 !important;
}

.posts-item .io-invalid-overlay.io-invalid-style4 {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) rotate(-18deg) !important;
    font-size: 14px !important;
    font-weight: bold !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    border-style: solid !important;
    border-width: 2px !important;
    opacity: 0.92 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15) !important;
    z-index: 10 !important;
    white-space: nowrap !important;
}

/* ============================================================
 *  失效内容链接禁用样式
 * ============================================================ */

/* 失效卡片内的链接：禁用指针样式 + 禁止点击 */
.io-invalid-site a,
.io-invalid-site a.disabled,
.io-invalid-site .icon-btn.disabled {
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* 失效卡片整体：禁止文本选择，鼠标移上显示禁用状态 */
.io-invalid-site {
    cursor: not-allowed;
}

/* 确保 tab-card 类型的失效卡片链接也被正确禁用 */
.tab-card.io-invalid-site a,
.tab-card.io-invalid-site .icon-btn {
    cursor: not-allowed !important;
}

/* 确保 posts-item 类型的失效卡片链接也被正确禁用 */
.posts-item.io-invalid-site a {
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ============================================================
 *  失效内容角标隐藏（彻底解决角标与失效标签先后出现的问题）
 * ============================================================ */

/* 失效卡片内的角标：直接隐藏，避免角标先出现、失效标签后出现的闪烁问题 */
.io-invalid-site .io-site-badge,
.io-invalid-site [data-badge-role="site-badge"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* 失效卡片：移除角标带来的 overflow 裁切效果 */
.io-invalid-site.io-card-has-badge {
    overflow: visible !important;
}

/* 针对 tab-card 的适配 */
.tab-card.io-invalid-site .io-site-badge,
.tab-card.io-invalid-site [data-badge-role="site-badge"] {
    display: none !important;
}

/* 针对 posts-item 的适配 */
.posts-item.io-invalid-site .io-site-badge,
.posts-item.io-invalid-site [data-badge-role="site-badge"] {
    display: none !important;
}

/* ==========================================
 * AI 摘要卡片
 * 设计语言：沿用主题卡片风格 — 无边框、12px圆角、柔和阴影
 * 色彩：以主题红色 #f1404b 为点缀，白色卡片背景
 * ========================================== */

/* 卡片容器 — 模拟主题 .card 样式 */
.io-ai-summary-card {
    margin: 24px 0;
    background: #fff;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.io-ai-summary-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.11);
}

.io-ai-summary-card-inner {
    padding: 22px 24px 18px;
}

/* ---------- 头部 ---------- */
.io-ai-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
}

.io-ai-summary-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 头像 — 红色系圆形 */
.io-ai-summary-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(241,64,75,0.12), rgba(241,64,75,0.06));
    border-radius: 50%;
    color: #f1404b;
    border: 1px solid rgba(241,64,75,0.15);
}

/* 标题 */
.io-ai-summary-title {
    font-size: 15px;
    font-weight: 600;
    color: #484b4f;
    letter-spacing: 0.3px;
}

/* ---------- 分隔线 ---------- */
.io-ai-summary-divider {
    height: 1px;
    margin: 0 0 14px 0;
    background: linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0.02) 80%);
}

/* ---------- 摘要正文 ---------- */
.io-ai-summary-body {
    padding: 2px 0 0 0;
}

.io-ai-summary-text {
    font-size: 14px;
    line-height: 1.85;
    color: #484b4f;
    word-break: break-word;
}

/* ---------- 打字机光标 ---------- */
.io-ai-summary-cursor {
    display: inline-block;
    vertical-align: text-bottom;
    width: 2px;
    height: 1.1em;
    margin-left: 1px;
    background: #f1404b;
    border-radius: 1px;
    animation: io-ai-cursor-blink 0.75s step-end infinite;
}

.io-ai-summary-cursor--done {
    animation: io-ai-cursor-fadeout 0.4s ease forwards;
}

@keyframes io-ai-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes io-ai-cursor-fadeout {
    to { opacity: 0; transform: scaleY(0); }
}

/* ---------- 底部说明 ---------- */
.io-ai-summary-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    font-size: 12px;
    color: #93959a;
    line-height: 1.5;
}

.io-ai-summary-footer svg {
    flex-shrink: 0;
    color: #c0c2c4;
}

/* ---------- 暗色模式 ---------- */
body.io-black-mode .io-ai-summary-card {
    background: #2D2E2F;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
}

body.io-black-mode .io-ai-summary-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}

body.io-black-mode .io-ai-summary-avatar {
    background: linear-gradient(135deg, rgba(241,64,75,0.18), rgba(241,64,75,0.08));
    border-color: rgba(241,64,75,0.25);
}

body.io-black-mode .io-ai-summary-title {
    color: #b4b8bf;
}

body.io-black-mode .io-ai-summary-divider {
    background: linear-gradient(to right, rgba(255,255,255,0.06), rgba(255,255,255,0.01) 80%);
}

body.io-black-mode .io-ai-summary-text {
    color: #b4b8bf;
}

body.io-black-mode .io-ai-summary-cursor {
    background: #f8716a;
}

body.io-black-mode .io-ai-summary-footer {
    background: rgba(255,255,255,0.03);
    color: #73757a;
}

body.io-black-mode .io-ai-summary-footer svg {
    color: #5f6164;
}

/* ---------- 响应式 ---------- */
@media (max-width: 576px) {
    .io-ai-summary-card {
        margin: 16px 0;
    }
    .io-ai-summary-card-inner {
        padding: 16px 16px 14px;
    }
    .io-ai-summary-header {
        padding-bottom: 12px;
    }
    .io-ai-summary-title {
        font-size: 14px;
    }
    .io-ai-summary-text {
        font-size: 13px;
    }
    .io-ai-summary-footer {
        font-size: 11px;
        padding: 8px 10px;
    }
}

/* ==========================================
 * 投稿页 AI 自动识别按钮
 * 网址表单：在「获取 TDK」旁注入「AI 识别」按钮（绝对定位在链接输入框内）
 * 文章/书籍/软件表单：独立的 URL 输入框 + AI 按钮（flex 布局，按钮紧跟输入框）
 * ========================================== */

/* --- 网址表单：输入框右侧留出两个按钮的空间（获取TDK + AI识别） --- */
.tg-sites-url .sites-link {
    padding-right: 152px !important;
}

/* --- 公共按钮样式（不含定位） --- */
.ai-contribute-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.10);
    color: #16a34a !important;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

/* --- 网址表单：AI 按钮绝对定位在链接输入框内（TDK 按钮左侧） --- */
.tg-sites-url .ai-contribute-btn {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
}

/* --- 文章/书籍/软件表单：URL 输入框容器 --- */
.ai-contribute-url-box {
    position: relative;
}
/* 文章/书籍/软件表单：AI 按钮保持 flex 流内（紧跟 URL 输入框右侧） */
.ai-contribute-url-box .ai-contribute-btn {
    position: static;
    flex-shrink: 0;
}

.ai-contribute-btn:hover,
.ai-contribute-btn:focus,
.ai-contribute-btn:active {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px -2px rgba(22, 163, 74, 0.5);
}
.ai-contribute-btn[disabled],
.ai-contribute-btn.disabled,
.ai-contribute-btn.ai-loading {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
    cursor: not-allowed;
    opacity: 1;
    box-shadow: 0 2px 8px -2px rgba(22, 163, 74, 0.5);
}
.ai-contribute-btn .icon {
    line-height: 1;
}
/* 暗色模式适配 */
body.io-black-mode .ai-contribute-btn {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.35);
    color: #86efac !important;
}
body.io-black-mode .ai-contribute-btn:hover,
body.io-black-mode .ai-contribute-btn:focus,
body.io-black-mode .ai-contribute-btn:active {
    background: #22c55e !important;
    border-color: #22c55e !important;
    color: #ffffff !important;
}
body.io-black-mode .ai-contribute-btn[disabled],
body.io-black-mode .ai-contribute-btn.disabled,
body.io-black-mode .ai-contribute-btn.ai-loading {
    background: #22c55e !important;
    border-color: #22c55e !important;
    color: #ffffff !important;
    opacity: 1;
}

/* ==========================================
 * 投稿页面防闪烁（FOUC 修复）
 * 在 TinyMCE 初始化前保持编辑器区域高度，防止布局偏移
 * ========================================== */

/* 编辑器容器最小高度匹配 TinyMCE 初始化后的高度 */
.page-template-template-contribute .wp-editor-container {
    min-height: 560px;
}
@media (max-width: 768px) {
    .page-template-template-contribute .wp-editor-container {
        min-height: 260px;
    }
}

/* TinyMCE 初始化前隐藏编辑器切换按钮组，避免未样式化闪烁 */
.page-template-template-contribute .wp-editor-wrap.html-active .wp-editor-tabs,
.page-template-template-contribute .wp-editor-wrap.html-active .mce-toolbar-grp {
    visibility: hidden;
}
.page-template-template-contribute .wp-editor-wrap.tmce-active .wp-editor-tabs,
.page-template-template-contribute .wp-editor-wrap.tmce-active .mce-toolbar-grp {
    visibility: visible;
}

