/**
 * 子比资讯聚合卡片 - 精致美化样式 v2.1
 * 左右两栏布局，继承子比主题背景，更加精致
 * 
 * @version 2.1.0
 */

/* ============================================
   双栏容器
   ============================================ */
.zibll-info-dual-container {
    display: flex;
    gap: 0;
    padding: 0;
}

/* ============================================
   栏目列样式
   ============================================ */
.zibll-info-column {
    flex: 1;
    min-width: 0;
}

.column-left {
    border-right: 1px solid var(--border-color, #e8e8e8);
    padding: 12px 16px 0;
}

.column-right {
    padding: 12px 16px 0;
}

/* ============================================
   栏目头部
   ============================================ */
.zibll-column-header {
    display: flex;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 8px;
    position: relative;
}

.column-left .zibll-column-header {
    border-bottom: 2px solid #667eea;
}

.column-right .zibll-column-header {
    border-bottom: 2px solid #10b981;
}

.zibll-column-title {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.column-left .zibll-column-title {
    color: #667eea;
}

.column-right .zibll-column-title {
    color: #10b981;
}

.zibll-column-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.column-left .zibll-column-icon {
    color: #667eea;
}

.column-right .zibll-column-icon {
    color: #10b981;
}

.zibll-column-icon svg {
    width: 15px;
    height: 15px;
}

/* ============================================
   文章列表
   ============================================ */
.zibll-info-list {
    padding: 0;
}

.zibll-info-item {
    display: flex;
    align-items: flex-start;
    padding: 6px 0;
    position: relative;
    transition: all 0.2s ease;
}

.zibll-info-item:hover {
    background: transparent;
}

.zibll-info-item:not(:last-child) {
    border-bottom: 1px dashed var(--border-color, #e8e8e8);
}

/* 左侧装饰线 */
.zibll-info-item::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    border-radius: 0 2px 2px 0;
    transition: height 0.25s ease;
}

.column-left .zibll-info-item::before {
    background: linear-gradient(180deg, #667eea, #764ba2);
}

.column-right .zibll-info-item::before {
    background: linear-gradient(180deg, #10b981, #059669);
}

.zibll-info-item:hover::before {
    height: 60%;
}

/* ============================================
   序号/图标
   ============================================ */
.zibll-info-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    margin-top: 2px;
}

.zibll-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    background: #f0f0f0;
    border-radius: 4px;
    font-family: 'DIN Alternate', -apple-system, BlinkMacSystemFont, sans-serif;
}

.zibll-info-item:nth-child(1) .zibll-num-badge {
    background: linear-gradient(135deg, #ff7875 0%, #ff4d4f 100%);
    color: #fff;
}

.zibll-info-item:nth-child(2) .zibll-num-badge {
    background: linear-gradient(135deg, #ffa940 0%, #fa8c16 100%);
    color: #fff;
}

.zibll-info-item:nth-child(3) .zibll-num-badge {
    background: linear-gradient(135deg, #40a9ff 0%, #1890ff 100%);
    color: #fff;
}

.zibll-info-item:nth-child(n+4) .zibll-num-badge {
    background: #f5f5f5;
    color: #999;
}

/* 图标前缀 */
.zibll-prefix-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.column-right .zibll-prefix-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.zibll-prefix-icon svg {
    width: 12px;
    height: 12px;
}

/* ============================================
   文章内容
   ============================================ */
.zibll-info-content {
    flex: 1;
    min-width: 0;
}

.zibll-info-title {
    display: inline;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color, #555);
    line-height: 1.6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.zibll-info-title:hover {
    color: #667eea;
}

.column-right .zibll-info-title:hover {
    color: #10b981;
}

/* 标题后的时间 */
.zibll-info-time {
    display: inline;
    font-size: 11px;
    color: #bbb;
    margin-left: 8px;
    font-weight: 400;
}

.zibll-info-time::before {
    content: '•';
    margin-right: 8px;
    color: #ddd;
}

/* ============================================
   空状态
   ============================================ */
.zibll-info-empty {
    padding: 20px 0;
    text-align: center;
    color: #bbb;
    font-size: 13px;
}

/* ============================================
   入场动画
   ============================================ */
@keyframes nitFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.zibll-info-item {
    animation: nitFadeIn 0.25s ease forwards;
}

.zibll-info-item:nth-child(1) { animation-delay: 0s; }
.zibll-info-item:nth-child(2) { animation-delay: 0.04s; }
.zibll-info-item:nth-child(3) { animation-delay: 0.08s; }
.zibll-info-item:nth-child(4) { animation-delay: 0.12s; }
.zibll-info-item:nth-child(5) { animation-delay: 0.16s; }

/* ============================================
   响应式适配
   ============================================ */
@media (max-width: 768px) {
    .zibll-info-dual-container {
        flex-direction: column;
    }
    
    .column-left {
        border-right: none;
        border-bottom: 1px solid var(--border-color, #e8e8e8);
        padding: 12px;
    }
    
    .column-right {
        padding: 12px;
    }
    
    .zibll-info-title {
        font-size: 13px;
    }
    
    .zibll-info-time {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .column-left,
    .column-right {
        padding: 10px;
    }
    
    .zibll-column-title {
        font-size: 13px;
    }
    
    .zibll-info-num {
        width: 24px;
        height: 24px;
        margin-right: 8px;
    }
    
    .zibll-num-badge {
        min-width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* ============================================
   暗色模式
   ============================================ */
.dark-theme .column-left {
    border-right-color: var(--border-color, #2a2a2a);
}

.dark-theme .column-left .zibll-column-header {
    border-bottom-color: #667eea;
}

.dark-theme .column-right .zibll-column-header {
    border-bottom-color: #10b981;
}

.dark-theme .zibll-info-item:not(:last-child) {
    border-bottom-color: var(--border-color, #2a2a2a);
}

.dark-theme .zibll-info-title {
    color: var(--muted-2-color, #ccc);
}

.dark-theme .zibll-info-title:hover {
    color: #818cf8;
}

.dark-theme .column-right .zibll-info-title:hover {
    color: #34d399;
}

.dark-theme .zibll-info-time {
    color: #666;
}

.dark-theme .zibll-num-badge {
    background: #333;
    color: #888;
}

.dark-theme .zibll-info-item:nth-child(1) .zibll-num-badge {
    background: linear-gradient(135deg, #ff7875 0%, #ff4d4f 100%);
}

.dark-theme .zibll-info-item:nth-child(2) .zibll-num-badge {
    background: linear-gradient(135deg, #ffa940 0%, #fa8c16 100%);
}

.dark-theme .zibll-info-item:nth-child(3) .zibll-num-badge {
    background: linear-gradient(135deg, #40a9ff 0%, #1890ff 100%);
}

.dark-theme .zibll-info-item:nth-child(n+4) .zibll-num-badge {
    background: #333;
    color: #666;
}

.dark-theme .zibll-prefix-icon {
    background: rgba(129, 140, 248, 0.15);
    color: #818cf8;
}

.dark-theme .column-right .zibll-prefix-icon {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.dark-theme .zibll-info-empty {
    color: #555;
}
.dark-theme .zibll-list-more {
    background: rgba(129, 140, 248, 0.15);
    color: #818cf8;
}
.dark-theme .zibll-list-more:hover {
    background: rgba(129, 140, 248, 0.3);
    color: #818cf8;
}

/* ============================================
   子比主题适配
   ============================================ */
.zibll-info-tabs-widget {
    /* 继承子比主题背景，不使用自定义背景 */
}

.zibll-info-tabs-widget .box-body {
    padding: 0;
}

.zibll-info-tabs-widget .title-theme {
    font-size: 15px;
    font-weight: 600;
}

.zibll-info-tabs-widget .title-theme a {
    transition: color 0.2s ease;
}

.zibll-info-tabs-widget .title-theme a:hover {
    color: #667eea;
}

.zibll-info-tabs-widget .pull-right a:hover {
    color: #667eea !important;
}

/* ============================================
   右栏标题（活动）
   ============================================ */
.zibll-column-title-right {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
}

.zibll-slider-more {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    text-decoration: none;
    transition: background 0.2s;
    flex-shrink: 0;
}
.zibll-slider-more:hover {
    background: rgba(16, 185, 129, 0.22);
    color: #10b981;
}
.zibll-slider-more svg {
    display: block;
}

/* 左栏更多链接（紫色系） */
.zibll-list-more {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    text-decoration: none;
    transition: background 0.2s;
    flex-shrink: 0;
}
.zibll-list-more:hover {
    background: rgba(102, 126, 234, 0.22);
    color: #667eea;
}
.zibll-list-more svg {
    display: block;
}

/* ============================================
   幻灯片容器
   ============================================ */
.zibll-slider {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
    /* 默认按比例 16:9，自定义高度由内联 style 覆盖 */
    aspect-ratio: 16 / 9;
    width: 100%;
    user-select: none;
}
/* 固定高度时覆盖 aspect-ratio */
.zibll-slider[style*="height"] {
    aspect-ratio: unset;
}

/* 图片轨道 */
.zibll-slider-track {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 每一张幻灯片 */
.zibll-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.zibll-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.zibll-slide-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.zibll-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

/* 无图占位 */
.zibll-slide-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #a5d6a7;
    border-radius: 8px;
}

/* 标题遮罩层 */
.zibll-slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 10px 8px;
    background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 100%);
    border-radius: 0 0 8px 8px;
}
.zibll-slide-caption span {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* ============================================
   导航点
   ============================================ */
.zibll-slider-dots {
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}
.zibll-slider-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.zibll-slider-dot.active {
    background: #fff;
    width: 14px;
    border-radius: 3px;
}

/* ============================================
   左右箭头
   ============================================ */
.zibll-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,.35);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.25s, background 0.2s;
    z-index: 10;
    padding: 0;
    line-height: 1;
}
.zibll-slider-arrow svg { display: block; }
.zibll-slider-prev { left: 6px; }
.zibll-slider-next { right: 6px; }

.zibll-slider:hover .zibll-slider-arrow {
    opacity: 1;
}
.zibll-slider-arrow:hover {
    background: rgba(16, 185, 129, .7);
}

/* ============================================
   幻灯片过渡效果（由 JS 添加 class）
   ============================================ */

/* --- fade --- */
@keyframes effFadeIn  { from { opacity:0 } to { opacity:1 } }
@keyframes effFadeOut { from { opacity:1 } to { opacity:0 } }
.eff-fade-in  { animation: effFadeIn  0.5s ease forwards; }
.eff-fade-out { animation: effFadeOut 0.5s ease forwards; }

/* --- slide --- */
@keyframes effSlideInL { from { transform:translateX(100%); opacity:0 } to { transform:translateX(0); opacity:1 } }
@keyframes effSlideInR { from { transform:translateX(-100%); opacity:0 } to { transform:translateX(0); opacity:1 } }
@keyframes effSlideOutL { from { transform:translateX(0); opacity:1 } to { transform:translateX(-100%); opacity:0 } }
@keyframes effSlideOutR { from { transform:translateX(0); opacity:1 } to { transform:translateX(100%); opacity:0 } }

/* JS 根据方向添加 in/out class，同一方向都用 translateX(100%)/-100% */
.eff-slide-in  { animation: effSlideInL 0.5s ease forwards; }
.eff-slide-out { animation: effSlideOutL 0.5s ease forwards; }

/* --- zoom --- */
@keyframes effZoomIn  { from { transform:scale(0.85); opacity:0 } to { transform:scale(1); opacity:1 } }
@keyframes effZoomOut { from { transform:scale(1); opacity:1 } to { transform:scale(1.15); opacity:0 } }
.eff-zoom-in  { animation: effZoomIn  0.5s ease forwards; }
.eff-zoom-out { animation: effZoomOut 0.5s ease forwards; }

/* --- flip --- */
@keyframes effFlipIn  { from { transform:perspective(600px) rotateY(90deg); opacity:0 } to { transform:perspective(600px) rotateY(0deg); opacity:1 } }
@keyframes effFlipOut { from { transform:perspective(600px) rotateY(0deg); opacity:1 } to { transform:perspective(600px) rotateY(-90deg); opacity:0 } }
.eff-flip-in  { animation: effFlipIn  0.6s ease forwards; }
.eff-flip-out { animation: effFlipOut 0.6s ease forwards; }

/* ============================================
   幻灯片尺寸控制（JS 动态设置 style）
   ============================================ */
.zibll-slider[data-ratio="4-3"]  { aspect-ratio: 4  / 3; }
.zibll-slider[data-ratio="3-2"]  { aspect-ratio: 3  / 2; }
.zibll-slider[data-ratio="16-9"] { aspect-ratio: 16 / 9; }
.zibll-slider[data-ratio="21-9"] { aspect-ratio: 21 / 9; }
.zibll-slider[data-ratio="1-1"]  { aspect-ratio: 1  / 1; }
.zibll-slider[data-ratio="9-16"] { aspect-ratio: 9  / 16; }

/* ============================================
   布局二：图上文下（上方幻灯片 + 下方文章列表）
   ============================================ */
.zibll-layout-img-top .zibll-info-dual-container {
    flex-direction: column;
}
.zibll-layout-img-top .column-right {
    border-right: none;
    border-top: 1px solid var(--border-color, #e8e8e8);
}
.zibll-layout-img-top .column-right .zibll-column-header {
    border-bottom: none;
}
.zibll-layout-img-top .zibll-info-list .zibll-info-item {
    padding: 7px 0;
}

/* ============================================
   右栏文章列表模式（替代幻灯片）
   ============================================ */
.zibll-right-list .zibll-info-empty {
    padding: 12px 0;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 768px) {
    .zibll-slider { border-radius: 6px; }
}

/* ============================================
   暗色模式
   ============================================ */
.dark-theme .zibll-slider { background: #222; }
.dark-theme .zibll-slide-placeholder {
    background: linear-gradient(135deg, #1a2a1a 0%, #1e3a1e 100%);
    color: #3a6a3a;
}

/* ============================================
   新增布局：文章列表在上 + 幻灯片在下
   ============================================ */
.zibll-layout-list-top .zibll-info-dual-container {
    flex-direction: column;
}
.zibll-layout-list-top .column-right {
    border-right: none;
    border-top: 1px solid var(--border-color, #e8e8e8);
}
.zibll-layout-list-top .column-right .zibll-column-header {
    border-bottom: none;
}
.zibll-layout-list-top .zibll-slider {
    border-radius: 0 0 8px 8px;
    margin-top: 8px;
}

/* ============================================
   新增布局：左右分割（左侧幻灯片 + 右侧文章列表）
   ============================================ */
.zibll-layout-split .column-right {
    border-right: none;
    border-top: none;
}
.zibll-layout-split .zibll-column-content {
    display: flex;
    gap: 12px;
    padding-top: 0;
}
.zibll-split-slider {
    flex: 1;
    min-width: 0;
}
.zibll-split-slider .zibll-slider {
    height: 100%;
    aspect-ratio: auto;
    min-height: 120px;
}
.zibll-split-list {
    flex: 1;
    min-width: 0;
    border-left: 1px dashed var(--border-color, #e8e8e8);
    padding-left: 12px;
}
.zibll-split-list .zibll-info-list {
    padding-top: 0;
}
.zibll-split-list .zibll-info-item {
    padding: 5px 0;
}
/* 分割模式右侧：标题和时间不换行 */
.zibll-split-list .zibll-info-content {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0;
    overflow: hidden;
}
.zibll-split-list .zibll-info-title {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    flex-shrink: 1;
}
.zibll-split-list .zibll-info-time {
    flex-shrink: 0;
    margin-left: 6px;
}
.zibll-split-list .zibll-info-time::before {
    content: '';
    margin-right: 0;
}
.zibll-split-list .zibll-info-empty {
    padding: 20px 0;
}

/* 响应式 - 分割布局在小屏幕上改为纵向 */
@media (max-width: 768px) {
    .zibll-layout-split .zibll-column-content {
        flex-direction: column;
    }
    .zibll-split-slider .zibll-slider {
        min-height: 160px;
    }
    .zibll-split-list {
        border-left: none;
        border-top: 1px dashed var(--border-color, #e8e8e8);
        padding-left: 0;
        padding-top: 10px;
    }
    /* 移动端允许换行 */
    .zibll-split-list .zibll-info-content {
        flex-wrap: wrap;
    }
    .zibll-split-list .zibll-info-title {
        white-space: normal;
        max-width: 100%;
    }
}

/* 暗色模式适配 */
.dark-theme .zibll-layout-list-top .column-right {
    border-top-color: var(--border-color, #2a2a2a);
}
.dark-theme .zibll-split-list {
    border-left-color: var(--border-color, #2a2a2a);
}
.dark-theme .zibll-layout-split .zibll-split-list {
    border-top-color: var(--border-color, #2a2a2a);
}
@media (max-width: 768px) {
    .dark-theme .zibll-split-list {
        border-top-color: var(--border-color, #2a2a2a);
    }
}
