/* 2026-07-21 news.php 文章列表样式（参考 news.sample.htmll 风格）
 *
 * 设计目标：
 *   1. 卡片左侧渐变缩略图（用文档标题首字 + 渐变色）
 *   2. 右侧标题 + 摘要 + 元信息（日期/权限/作者）
 *   3. 列表项间细分隔线
 *   4. 适配 4 主题（继承 --lo-* 变量）
 *   5. 响应式：窄屏自动堆叠
 */

.news-channel {
    margin: 28px 0 36px;
    background: var(--lo-card);
    border: 1px solid var(--lo-border);
    border-radius: 16px;
    box-shadow: var(--lo-shadow);
    overflow: hidden;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

/* 分类标题行：左图标 + 中标题 + 右"更多"链接 */
.news-channel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--lo-stat-active-bg);
    border-bottom: 1px solid var(--lo-border);
    transition: background-color 0.2s, border-color 0.2s;
}

.news-channel__header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.news-channel__icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--lo-primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.news-channel__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--lo-text);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-channel__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.news-channel__title a:hover {
    color: var(--lo-primary-600);
}

.news-channel__more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--lo-primary-600);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: background 0.15s;
}

.news-channel__more:hover {
    background: rgba(37, 99, 235, 0.10);
    text-decoration: none;
    color: var(--lo-primary-600);
}

/* 列表容器：单列流式 */
.news-list {
    display: flex;
    flex-direction: column;
}

/* 单个文档行：左缩略图 + 右文字 */
.news-item {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--lo-border);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    position: relative;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background: var(--lo-card-hover-bg);
    text-decoration: none;
    color: inherit;
}

/* 缩略图：渐变背景 + 文档标题首字 */
.news-item__thumb {
    flex: 0 0 88px;
    height: 88px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.95);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    user-select: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-item:hover .news-item__thumb {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

/* 缩略图上的小图标（右上角"文档"标识） */
.news-item__thumb::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    background-color: rgba(255, 255, 255, 0.35);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 18'><path d='M2 1 H10 L14 5 V17 H2 Z' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'/><polyline points='10 1 10 5 14 5' fill='none' stroke='black' stroke-width='1.5'/></svg>") no-repeat center / contain;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 18'><path d='M2 1 H10 L14 5 V17 H2 Z' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'/><polyline points='10 1 10 5 14 5' fill='none' stroke='black' stroke-width='1.5'/></svg>") no-repeat center / contain;
}

/* 8 种不同色系的渐变背景（基于文档 ID 哈希分配） */
.news-item__thumb--c1 { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
.news-item__thumb--c2 { background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%); }
.news-item__thumb--c3 { background: linear-gradient(135deg, #16a34a 0%, #84cc16 100%); }
.news-item__thumb--c4 { background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%); }
.news-item__thumb--c5 { background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%); }
.news-item__thumb--c6 { background: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 100%); }
.news-item__thumb--c7 { background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%); }
.news-item__thumb--c8 { background: linear-gradient(135deg, #f97316 0%, #facc15 100%); }

/* 右侧内容区 */
.news-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.news-item__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--lo-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    transition: color 0.15s;
}

.news-item:hover .news-item__title {
    color: var(--lo-primary-600);
}

.news-item__excerpt {
    font-size: 13px;
    line-height: 1.55;
    color: var(--lo-muted);
    margin: 2px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.news-item__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 4px;
    font-size: 12px;
    color: var(--lo-muted);
}

.news-item__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.news-item__meta-item svg {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

/* 权限徽章（继承 office-badge 颜色，但缩小尺寸适配列表） */
.news-item__badge {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.news-item__badge--public {
    background: rgba(22, 163, 74, 0.10);
    border-color: rgba(22, 163, 74, 0.22);
    color: var(--lo-success);
}

.news-item__badge--private {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.18);
    color: var(--lo-danger);
}

.news-item__badge--member {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.24);
    color: var(--lo-warn);
}

/* 空状态：没有文档 */
.news-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--lo-muted);
    font-size: 13px;
}

.news-empty__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
    border-radius: 14px;
    background: var(--lo-card-hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-empty__icon svg {
    width: 28px;
    height: 28px;
    color: var(--lo-muted);
    opacity: 0.5;
}

/* 响应式：< 768px 缩略图缩小，标题字号减小 */
@media (max-width: 768px) {
    .news-channel__header {
        padding: 12px 14px;
    }
    .news-channel__title {
        font-size: 16px;
    }
    .news-item {
        padding: 12px 14px;
        gap: 12px;
    }
    .news-item__thumb {
        flex: 0 0 60px;
        height: 60px;
        font-size: 22px;
        border-radius: 10px;
    }
    .news-item__title {
        font-size: 14px;
    }
    .news-item__excerpt {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }
    .news-item__meta {
        font-size: 11px;
        gap: 8px;
    }
}
