/* 超级嵌入插件 - 后台样式 */

.zibll-super-embed-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
}

.zibll-super-embed-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.zibll-super-embed-modal .modal-content {
    background: #fff;
    padding: 0;
    border-radius: 8px;
    width: 580px;
    max-width: 95vw;
    max-height: 85vh;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* 头部 */
.zibll-super-embed-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
}

.zibll-super-embed-modal .modal-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #1d2327;
}

.zibll-super-embed-modal .close-btn {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #646970;
    width: 28px;
    height: 28px;
    line-height: 1;
    border-radius: 4px;
    padding: 0;
    transition: all 0.1s ease;
}

.zibll-super-embed-modal .close-btn:hover {
    background: #f0f0f1;
    color: #1d2327;
}

/* 主体 */
.zibll-super-embed-modal .modal-body {
    padding: 20px;
    max-height: calc(85vh - 130px);
    overflow-y: auto;
}

/* 表单 */
.zibll-super-embed-modal .form-group {
    margin-bottom: 16px;
}

.zibll-super-embed-modal label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1d2327;
    font-size: 14px;
}

.zibll-super-embed-modal input[type="text"],
.zibll-super-embed-modal input[type="number"],
.zibll-super-embed-modal textarea,
.zibll-super-embed-modal select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    background: #fff;
    color: #2c3338;
    min-height: 32px;
}

.zibll-super-embed-modal input[type="text"]:focus,
.zibll-super-embed-modal input[type="number"]:focus,
.zibll-super-embed-modal textarea:focus,
.zibll-super-embed-modal select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.zibll-super-embed-modal textarea {
    min-height: 100px;
    resize: vertical;
}

.zibll-super-embed-modal input[type="checkbox"] {
    margin: 0 4px 0 0;
}

/* 标签按钮容器 */
.tab-buttons-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #c3c4c7;
    position: relative;
}

/* 标签按钮滚动容器 */
.tab-buttons-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
}

.tab-buttons-scroll::-webkit-scrollbar {
    display: none;
}

.tab-buttons-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 标签按钮 */
.tab-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    padding: 0 4px;
}

/* 滚动按钮 */
.tab-scroll-btn {
    width: 28px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    cursor: pointer;
    font-size: 14px;
    color: #50575e;
    transition: all 0.1s ease;
    flex-shrink: 0;
    z-index: 1;
}

.tab-scroll-btn:hover {
    background: #e5e5e5;
    color: #1d2327;
}

.tab-scroll-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.tab-scroll-btn.tab-scroll-left {
    border-right: none;
    border-radius: 4px 0 0 0;
}

.tab-scroll-btn.tab-scroll-right {
    border-left: none;
    border-radius: 0 4px 0 0;
}

.tab-button {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    cursor: pointer;
    margin: 0 -1px -1px 0;
    border-radius: 4px 4px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: #50575e;
    transition: none;
}

.tab-button:hover {
    color: #1d2327;
    background: #f6f7f7;
}

.tab-button.active {
    background: #fff;
    border-color: #c3c4c7;
    border-bottom-color: #fff;
    color: #1d2327;
    box-shadow: none;
    margin-bottom: -1px;
}

/* 标签内容 */
.zibll-super-embed-modal .tab-content {
    margin-top: 0;
}

.zibll-super-embed-modal .tab-panel {
    display: none;
}

.zibll-super-embed-modal .tab-panel.active {
    display: block;
}

/* 按钮组 */
.zibll-super-embed-modal .button-group {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
    text-align: right;
}

.zibll-super-embed-modal .button {
    margin: 0 0 0 8px;
    padding: 6px 14px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: none;
    border: 1px solid;
    display: inline-block;
    text-decoration: none;
    line-height: 2.15384615;
    min-height: 30px;
}

.zibll-super-embed-modal .button.button-secondary {
    background: #f6f7f7;
    border-color: #2271b1;
    color: #2271b1;
}

.zibll-super-embed-modal .button.button-secondary:hover {
    background: #f0f6fc;
    border-color: #135e96;
    color: #135e96;
}

.zibll-super-embed-modal .button.button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.zibll-super-embed-modal .button.button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

/* 剧集模块 */
.zibll-series-module {
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #fff;
    padding: 16px;
    margin-bottom: 0;
    box-sizing: border-box;
    width: 100%;
}

.zibll-series-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e5e5;
}

.zibll-series-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #1d2327;
    display: flex;
    align-items: center;
}

.zibll-series-icon {
    margin-right: 6px;
    font-size: 16px;
}

.zibll-series-desc {
    font-size: 13px;
    color: #646970;
    margin: 0;
    line-height: 1.5;
}

/* 剧集项 */
.series-item {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
    width: 100%;
}

.series-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

.series-item-index {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    color: #d63638;
    font-weight: 600;
    margin-right: 10px;
    font-size: 12px;
    flex-shrink: 0;
}

.series-title {
    flex: 1;
    margin-right: 8px;
    padding: 4px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
    height: 30px;
    min-width: 0;
}

.series-title:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.remove-series-btn {
    background: #f6f7f7;
    border: 1px solid #8c8f94;
    color: #d63638;
    cursor: pointer;
    padding: 0 8px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
    min-width: 30px;
}

.remove-series-btn:hover {
    background: #f0f0f1;
    border-color: #787c82;
}

.series-url {
    padding: 4px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 13px;
    margin: 0;
    width: 100%;
    height: 30px;
    min-width: 0;
}

.series-url:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

#series-items {
    width: 100%;
    box-sizing: border-box;
}

#add-series-btn,
#add-video-series-btn {
    margin-top: 8px;
    margin-bottom: 0;
    padding: 6px 14px;
    background: #2271b1;
    color: #fff;
    border: 1px solid #2271b1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

#add-series-btn:hover,
#add-video-series-btn:hover {
    background: #135e96;
    border-color: #135e96;
}

/* 本地视频按钮 */
.select-video-series-btn {
    background: #2271b1;
    color: #fff;
    border: 1px solid #2271b1;
    padding: 0 12px;
    height: 30px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
}

.select-video-series-btn:hover {
    background: #135e96;
    border-color: #135e96;
}

/* 预览区域 */
.zibll-preview-area {
    margin-top: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-sizing: border-box;
    width: 100%;
}

#embed-preview-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 13px;
}

/* 前端展示 */
.zibll-series-embed {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.zibll-series-content {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    width: 100%;
}

.zibll-series-item {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.zibll-series-item.active {
    display: block;
}

.zibll-series-item iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.zibll-series-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-top: 12px;
    justify-content: flex-start;
    gap: 8px;
    padding: 0;
}

.zibll-series-tab {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: auto;
    justify-content: center;
    color: #333;
    transition: all 0.2s ease;
}

.zibll-series-tab:hover {
    background: #eeeeee;
    border-color: #d0d0d0;
}

.zibll-series-tab.active {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff9770 100%);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
}

.zibll-series-tab::before {
    content: attr(data-index);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.zibll-series-tab.active::before {
    background: rgba(255, 255, 255, 0.3);
}

.zibll-series-tab.active::after {
    content: '▶';
    font-size: 12px;
    line-height: 1;
}

.zibll-super-embed {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.zibll-super-embed-content {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    width: 100%;
}

.zibll-super-embed-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.zibll-video-player {
    margin: 20px 0;
}

/* 剧集视频模块 */
.zibll-video-series {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.zibll-video-series-player {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    width: 100%;
}

.zibll-video-series-item {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.zibll-video-series-item.active {
    display: block;
    position: relative;
}

.zibll-video-series-item video {
    width: 100%;
    height: 100%;
    display: block;
}

.zibll-video-series-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-top: 12px;
    justify-content: flex-start;
    gap: 8px;
    padding: 0;
}

.zibll-video-series-tab {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: auto;
    justify-content: center;
    color: #333;
    transition: all 0.2s ease;
}

.zibll-video-series-tab:hover {
    background: #eeeeee;
    border-color: #d0d0d0;
}

.zibll-video-series-tab.active {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff9770 100%);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
}

.zibll-video-series-tab::before {
    content: attr(data-index);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.zibll-video-series-tab.active::before {
    background: rgba(255, 255, 255, 0.3);
}

.zibll-video-series-tab.active::after {
    content: '▶';
    font-size: 12px;
    line-height: 1;
}

.zibll-video-series video {
    object-fit: contain;
}

/* 页面扩展元框 */
#zibll_super_embed_page_extension {
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

#zibll_super_embed_page_extension .postbox-header {
    border-bottom: 1px solid #c3c4c7;
    background: #f6f7f7;
}

#zibll_super_embed_page_extension h2.hndle {
    padding: 8px 12px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    cursor: default;
    user-select: none;
}

.zibll-page-extension {
    padding: 12px;
}

.zibll-page-extension p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.zibll-extension-section {
    margin-bottom: 15px;
}

.zibll-extension-section:last-child {
    margin-bottom: 0;
}

.zibll-extension-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #646970;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
    margin: 0 0 10px 0;
}

.zibll-extension-section label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    color: #1d2327;
}

.zibll-extension-section label:hover {
    color: #2271b1;
}

.zibll-extension-section label input[type="radio"] {
    margin-right: 8px;
    vertical-align: middle;
}

.zibll-extension-section label span {
    vertical-align: middle;
}

/* 滚动条 */
.zibll-super-embed-modal .modal-body::-webkit-scrollbar {
    width: 10px;
}

.zibll-super-embed-modal .modal-body::-webkit-scrollbar-track {
    background: #f0f0f1;
}

.zibll-super-embed-modal .modal-body::-webkit-scrollbar-thumb {
    background: #c3c4c7;
    border-radius: 5px;
}

.zibll-super-embed-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a7aaad;
}
