/* ========== 增长中心 - 知识库模块样式 ========== */

/* 统计卡片 */
.kb-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.kb-stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}
.kb-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}
.kb-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 筛选栏 */
.kb-filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.kb-filter-bar input[type="text"],
.kb-filter-bar select {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--card-bg);
    color: var(--text);
}
.kb-filter-bar input[type="text"] { min-width: 200px; }
.kb-filter-bar input[type="text"]:focus,
.kb-filter-bar select:focus {
    outline: none;
    border-color: var(--primary);
}

/* 平台标识 */
.kb-platform-stats { margin-bottom: 12px; }
.kb-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-right: 6px;
}
.kb-platform-wechat { background: #07c16020; color: #07c160; }
.kb-platform-xiaohongshu { background: #ff244220; color: #ff2442; }
.kb-platform-zhihu { background: #0066ff20; color: #0066ff; }
.kb-platform-manual { background: #64748b20; color: #64748b; }

/* 文章表格 */
.kb-article-title {
    font-weight: 500;
    color: var(--text);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kb-article-summary {
    font-size: 12px;
    color: var(--text-tertiary);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}
.kb-article-cover {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-light);
}

/* 状态徽章 */
.kb-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}
.kb-badge-draft { background: #f59e0b20; color: #d97706; }
.kb-badge-published { background: #22c55e20; color: #16a34a; }
.kb-badge-pending { background: #3b82f620; color: #2563eb; }
.kb-badge-archived { background: #64748b20; color: #475569; }

/* 编辑器容器 */
.kb-editor-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.kb-editor-container h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: var(--text);
}
.kb-editor-field {
    margin-bottom: 16px;
}
.kb-editor-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.kb-editor-field input[type="text"],
.kb-editor-field textarea,
.kb-editor-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text);
    box-sizing: border-box;
}
.kb-editor-field input:focus,
.kb-editor-field textarea:focus,
.kb-editor-field select:focus {
    outline: none;
    border-color: var(--primary);
}
.kb-editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.kb-editor-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* 标签云 */
.kb-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
}
.kb-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    border: 1px solid;
    cursor: default;
    transition: opacity 0.2s;
}
.kb-tag:hover { opacity: 0.85; }
.kb-tag-count {
    font-size: 11px;
    opacity: 0.7;
}
.kb-tag-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 2px;
    font-size: 14px;
    line-height: 1;
    opacity: 0.5;
    color: inherit;
}
.kb-tag-delete:hover { opacity: 1; }

/* 标签输入 */
.kb-tag-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 16px;
}
.kb-tag-input-row input {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* 编辑器标签选择 */
.kb-selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.kb-selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: var(--primary-light);
    color: var(--primary);
}
.kb-selected-tag button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 14px;
    padding: 0;
    line-height: 1;
}

/* API密钥 */
.kb-api-secret {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: #fef3c7;
    color: #92400e;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    word-break: break-all;
    margin: 8px 0;
}

/* 图片网格 */
.kb-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 8px;
}
.kb-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
}
.kb-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.kb-image-item.is-cover { border-color: var(--primary); }

/* 导入日志 */
.kb-import-log-success { color: var(--success); }
.kb-import-log-skipped { color: var(--warning); }
.kb-import-log-failed { color: var(--error); }

/* 工具栏 */
.kb-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
