/* ========== 文章管理样式 ========== */

/* 容器 */
.articles-container {
    padding: 24px;
}

/* 工具栏 */
.articles-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    gap: 16px;
}

.articles-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.articles-toolbar h3 {
    font-size: 16px;
    color: #202124;
    margin: 0;
}

.articles-count {
    background: rgba(91, 127, 255, 0.1);
    color: var(--business-color, #5B7FFF);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.articles-toolbar-right {
    display: flex;
    gap: 8px;
}

/* 平台筛选栏 */
.platform-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #e8eaed;
    flex-wrap: wrap;
}

.platform-filter-label {
    font-size: 13px;
    color: #5f6368;
    font-weight: 500;
    white-space: nowrap;
}

.platform-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-btn {
    padding: 6px 14px;
    font-size: 13px;
    color: #5f6368;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.platform-btn:hover {
    border-color: var(--business-color, #5B7FFF);
    color: var(--business-color, #5B7FFF);
    background: rgba(91, 127, 255, 0.1);
}

.platform-btn.active {
    background: var(--business-color, #5B7FFF);
    border-color: var(--business-color, #5B7FFF);
    color: white;
}

.platform-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: line-through;
}

.platform-count {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 9px;
}

.platform-btn.active .platform-count {
    background: rgba(255, 255, 255, 0.25);
}

.platform-select-large {
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    width: 100%;
}

/* 表格容器 */
.articles-table-container {
    border: 1px solid #e8eaed;
    border-radius: 12px;
    overflow: hidden;
}

.articles-table {
    width: 100%;
    border-collapse: collapse;
}

.articles-table thead {
    background: #f8f9fa;
}

.articles-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #5f6368;
    border-bottom: 1px solid #e8eaed;
    font-size: 13px;
}

.articles-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f3f4;
    font-size: 14px;
    color: #3c4043;
}

.articles-table tbody tr:hover {
    background: #f8f9fa;
}

/* 表格列宽 */
.articles-table .col-checkbox {
    width: 40px;
    text-align: center;
}

.articles-table .col-id {
    width: 60px;
}

.articles-table .col-title {
    max-width: 400px;
}

.articles-table .col-title span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.articles-table .col-title span:hover {
    color: var(--business-color, #5B7FFF);
}

.articles-table .col-platform {
    width: 100px;
}

.articles-table .col-prompt-type {
    width: 130px;
    text-align: center;
}

.articles-table .col-created-at {
    width: 160px;
    white-space: nowrap;
}

.articles-table .col-actions {
    width: 180px;
}

/* 排序列样式 */
.articles-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.articles-table th.sortable:hover {
    background: #eef1f4;
}

.sort-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 12px;
    color: #9aa0a6;
}

.sort-icon::after {
    content: '↕';
}

.sort-icon.asc::after {
    content: '↑';
    color: var(--business-color, #5B7FFF);
}

.sort-icon.desc::after {
    content: '↓';
    color: var(--business-color, #5B7FFF);
}

/* 创建时间文字样式 */
.created-at-text {
    font-size: 13px;
    color: #5f6368;
}

/* 平台标签 */
.platform-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(91, 127, 255, 0.1);
    color: var(--business-color, #5B7FFF);
}

/* Prompt 类型标签 */
.prompt-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 3px;
}
.prompt-tag:last-child {
    margin-right: 0;
}
.prompt-tag.style-ranking {
    background: #dbeafe;
    color: #1d4ed8;
}
.prompt-tag.style-inventory {
    background: #ede9fe;
    color: #6d28d9;
}
.prompt-tag.variant-standard {
    background: #f3f4f6;
    color: #4b5563;
}
.prompt-tag.variant-emoji {
    background: #fef3c7;
    color: #92400e;
}
.prompt-tag.unknown {
    background: #f3f4f6;
    color: #9ca3af;
}

/* 空状态 */
.articles-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9aa0a6;
    font-size: 14px;
}

/* ========== 分页组件 ========== */
.articles-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 16px;
}

.pagination-info {
    font-size: 14px;
    color: #5f6368;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-pages .page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: none;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-pages .page-btn:hover {
    background: rgba(91, 127, 255, 0.1);
    color: var(--business-color, #5B7FFF);
}

.pagination-pages .page-btn.active {
    background: var(--business-color, #5B7FFF);
    color: white;
}

.pagination-pages .page-ellipsis {
    padding: 0 8px;
    color: #9aa0a6;
}

/* ========== 文章详情弹窗 ========== */
.article-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.article-detail-modal.active {
    display: flex;
}

.article-detail-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow: visible;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.article-detail-body {
    overflow-y: auto;
}

.article-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e8eaed;
}

.article-detail-title {
    font-size: 18px;
    font-weight: 600;
    color: #202124;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 16px;
}

.article-detail-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f3f4;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #5f6368;
    flex-shrink: 0;
}

.article-detail-close:hover {
    background: #e8eaed;
}

.article-detail-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.article-detail-info {
    margin-bottom: 16px;
}

.article-detail-platform {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(91, 127, 255, 0.1);
    color: var(--business-color, #5B7FFF);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.article-detail-prompt-type {
    display: inline-block;
    margin-left: 8px;
}

.article-detail-prompt-type .prompt-tag {
    margin-left: 4px;
}

/* 预设方案标签 */
.article-detail-preset {
    display: inline-block;
    margin-left: 12px;
    padding: 4px 10px;
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* 软件标签区域 */
.article-apps-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    flex-wrap: wrap;
}

.apps-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.apps-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 软件标签 */
.app-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

/* 核心软件：绿色半透明镂空背景 */
.app-tag-core {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* 对比软件：灰色背景 */
.app-tag-compare {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* 列表中的预设方案列 */
.col-preset {
    width: 100px;
    text-align: center;
}

.preset-name {
    font-size: 12px;
    color: #7c3aed;
}

.article-detail-html {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    line-height: 1.8;
    font-size: 14px;
}

.article-detail-html p {
    margin-bottom: 12px;
}

.article-detail-html img {
    max-width: 30%;
    border-radius: 8px;
    margin: 12px 0;
}

/* 内容视图切换按钮 */
.article-view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.view-toggle-btn {
    padding: 6px 16px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.view-toggle-btn:hover {
    border-color: #5B7FFF;
    color: #5B7FFF;
}

.view-toggle-btn.active {
    background: #5B7FFF;
    border-color: #5B7FFF;
    color: #fff;
}

/* 复制内容按钮 */
.btn-copy-content {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.btn-copy-content:hover {
    border-color: #52c41a;
    color: #52c41a;
}

.btn-copy-content.copied {
    border-color: #52c41a;
    background: #f6ffed;
    color: #52c41a;
}

/* 复制调试按钮 */
.btn-copy-debug {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy-debug:hover {
    border-color: #fa8c16;
    color: #fa8c16;
}

.btn-copy-debug.copied {
    border-color: #fa8c16;
    background: #fff7e6;
    color: #fa8c16;
}

/* 原始内容显示区域 */
.article-detail-raw {
    padding: 16px;
    background: #1e1e1e;
    border-radius: 8px;
    max-height: 60vh;
    overflow: auto;
}

.article-detail-raw pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #d4d4d4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.article-detail-footer {
    padding: 16px 24px;
    border-top: 1px solid #e8eaed;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========== 批量修改分类弹窗 ========== */
.batch-platform-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.batch-platform-modal.active {
    display: flex;
}

.batch-platform-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.batch-platform-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e8eaed;
}

.batch-platform-title {
    font-size: 18px;
    font-weight: 600;
    color: #202124;
}

.batch-platform-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f3f4;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #5f6368;
}

.batch-platform-close:hover {
    background: #e8eaed;
}

.batch-platform-body {
    padding: 24px;
}

.batch-platform-body p {
    margin-bottom: 16px;
    color: #5f6368;
}

.batch-platform-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    margin-bottom: 8px;
}

.batch-platform-footer {
    padding: 16px 24px;
    border-top: 1px solid #e8eaed;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========== 文章预览导航按钮（侧边居中） ========== */
.btn-nav-side {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.btn-nav-side svg {
    width: 28px;
    height: 28px;
}

.btn-nav-prev {
    left: -78px;
}

.btn-nav-next {
    right: -78px;
}

.btn-nav-side:hover:not(:disabled) {
    background: white;
    color: var(--business-color, #5B7FFF);
    box-shadow: 0 4px 16px rgba(91, 127, 255, 0.3);
    transform: translateY(-50%) scale(1.08);
}

.btn-nav-side:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-nav-side:disabled:hover {
    transform: translateY(-50%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.article-nav-index {
    font-size: 13px;
    color: #5f6368;
    background: rgba(91, 127, 255, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    margin-right: 12px;
}

/* ========== 文章滚动浮动按钮 ========== */
.article-scroll-buttons {
    position: absolute;
    right: 28px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.btn-scroll {
    width: 40px;
    height: 40px;
    border: 1px solid #dadce0;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-scroll:hover {
    border-color: var(--business-color, #5B7FFF);
    color: var(--business-color, #5B7FFF);
    background: rgba(91, 127, 255, 0.05);
    box-shadow: 0 4px 12px rgba(91, 127, 255, 0.2);
}

/* ========== 标签页切换 ========== */
.articles-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #f1f3f4;
    padding: 4px;
    border-radius: 10px;
    width: fit-content;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #202124;
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
    background: white;
    color: #202124;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 10px;
}

.tab-count-danger {
    background: rgba(234, 67, 53, 0.15);
    color: #d93025;
}

.tab-btn.active .tab-count {
    background: rgba(91, 127, 255, 0.15);
    color: var(--business-color, #5B7FFF);
}

.tab-btn.active .tab-count-danger {
    background: rgba(234, 67, 53, 0.15);
    color: #d93025;
}

/* 标签页内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========== 失败记录表格 ========== */
.failed-table .col-fail-type {
    width: 100px;
}

.failed-table .col-fail-reason {
    max-width: 200px;
}

.failed-table .col-fail-reason span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.failed-table .col-status {
    width: 80px;
}

/* 失败类型徽章 */
.fail-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.fail-type-badge.forbidden_word {
    background: rgba(234, 67, 53, 0.1);
    color: #d93025;
}

.fail-type-badge.cover_missing {
    background: rgba(251, 188, 4, 0.15);
    color: #e37400;
}

.fail-type-badge.app_cover_missing {
    background: rgba(251, 188, 4, 0.15);
    color: #e37400;
}

.fail-type-badge.empty_content {
    background: rgba(95, 99, 104, 0.1);
    color: #5f6368;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-0 {
    background: rgba(234, 67, 53, 0.1);
    color: #d93025;
}

.status-badge.status-1 {
    background: rgba(52, 168, 83, 0.1);
    color: #1e8e3e;
}

.status-badge.status-2 {
    background: rgba(95, 99, 104, 0.1);
    color: #5f6368;
}

/* ========== 失败记录详情弹窗 ========== */
.failed-detail-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.failed-info-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}

.failed-info-row:last-child {
    margin-bottom: 0;
}

.failed-info-label {
    width: 80px;
    flex-shrink: 0;
    font-size: 13px;
    color: #5f6368;
}

.failed-info-value {
    flex: 1;
    font-size: 14px;
    color: #202124;
}

.failed-detail-highlight {
    background: rgba(234, 67, 53, 0.1);
    color: #d93025;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* Markdown 区域 */
.failed-markdown-section {
    border: 1px solid #e8eaed;
    border-radius: 8px;
    overflow: hidden;
}

.failed-markdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8eaed;
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
}

.failed-markdown-content {
    margin: 0;
    padding: 16px;
    font-size: 13px;
    line-height: 1.6;
    background: #fafafa;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

/* HTML 预览区域 */
.failed-html-preview {
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    background: #fff;
    max-height: 400px;
    overflow-y: auto;
    word-break: break-word;
}

.failed-html-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.failed-html-preview p {
    margin: 0 0 12px 0;
}

.failed-html-preview h1,
.failed-html-preview h2,
.failed-html-preview h3,
.failed-html-preview h4 {
    margin: 16px 0 8px 0;
    font-weight: 600;
}

.failed-html-preview ul,
.failed-html-preview ol {
    margin: 8px 0;
    padding-left: 24px;
}

.failed-html-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.failed-html-preview th,
.failed-html-preview td {
    border: 1px solid #e8eaed;
    padding: 8px 12px;
    text-align: left;
}

.failed-html-preview th {
    background: #f8f9fa;
}

/* ========== 重新排版弹窗 ========== */
.reformat-options {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
}

.reformat-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #202124;
    cursor: pointer;
}

.reformat-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--business-color, #5B7FFF);
}

.reformat-preview {
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
}

.reformat-preview-placeholder {
    text-align: center;
    color: #9aa0a6;
    padding: 60px 20px;
}

.reformat-preview-loading {
    text-align: center;
    color: #5f6368;
    padding: 60px 20px;
}

.reformat-preview img {
    max-width: 30%;
    border-radius: 8px;
}

.reformat-save-options {
    margin-top: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Warning 按钮 */
.btn-warning {
    background: #fbbc04;
    color: #202124;
}

.btn-warning:hover {
    background: #f9a825;
}

/* ========== 搜索框 ========== */
.articles-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.articles-search input {
    width: 200px;
    padding: 8px 12px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 13px;
    color: #202124;
    background: white;
    transition: all 0.2s;
}

.articles-search input:focus {
    outline: none;
    border-color: var(--business-color, #5B7FFF);
    box-shadow: 0 0 0 3px rgba(91, 127, 255, 0.1);
}

.articles-search input::placeholder {
    color: #9aa0a6;
}
