/* ==================== 容器 ==================== */
.ls-ai-container {
    max-width: 960px;
    min-height: 600px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ==================== 标题栏 ==================== */
.ls-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ls-ai-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ls-ai-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ls-ai-header h2 i { color: #ef4444; font-size: 22px; }

.ls-ai-total { font-size: 13px; color: #9ca3af; }

.ls-ai-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    transition: all 0.15s;
}

.ls-ai-header-btn:hover { border-color: #d1d5db; background: #f9fafb; }
.ls-ai-header-btn i { font-size: 15px; color: #6b7280; }

/* ==================== 通用卡片 ==================== */
.ls-ai-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 16px;
    overflow: hidden;
}

/* ==================== 控制行 ==================== */
.ls-ai-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f3f4f6;
}

.ls-ai-cron-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
    flex-wrap: wrap;
}

.ls-ai-cron-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.ls-ai-cron-status i { font-size: 16px; }
.ls-ai-cron-on { color: #059669; }
.ls-ai-cron-on i { color: #10b981; }
.ls-ai-cron-off { color: #9ca3af; }
.ls-ai-cron-off i { color: #d1d5db; }

.ls-ai-cron-queue,
.ls-ai-cron-lastrun,
.ls-ai-cron-nextrun { font-size: 12px; color: #9ca3af; }

.ls-ai-control-btns {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* 执行结果 */
.ls-ai-cron-result {
    margin: 0 18px 14px;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    color: #6b7280;
    word-break: break-all;
}

/* ==================== 按钮系统 ==================== */
.ls-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    white-space: nowrap;
    background: #f3f4f6;
    color: #374151;
}

.ls-ai-btn:hover { background: #e5e7eb; }

.ls-ai-btn-primary { background: #3b82f6; color: #fff; }
.ls-ai-btn-primary:hover { background: #2563eb; }

.ls-ai-btn-danger { background: #fee2e2; color: #dc2626; }
.ls-ai-btn-danger:hover { background: #fecaca; }

.ls-ai-btn-ghost { background: transparent; color: #6b7280; border: 1px solid #e5e7eb; }
.ls-ai-btn-ghost:hover { background: #f9fafb; color: #374151; border-color: #d1d5db; }

/* 兼容旧 JS 中的 class 名 */
.ls-ai-cron-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; border: none; transition: all 0.15s; white-space: nowrap; background: #f3f4f6; color: #374151; }
.ls-ai-cron-btn:hover { background: #e5e7eb; }
.ls-ai-cron-btn-start { background: #3b82f6; color: #fff; }
.ls-ai-cron-btn-start:hover { background: #2563eb; }
.ls-ai-cron-btn-stop { background: #fee2e2; color: #dc2626; }
.ls-ai-cron-btn-stop:hover { background: #fecaca; }
.ls-ai-cron-btn-run { background: transparent; color: #6b7280; border: 1px solid #e5e7eb; }
.ls-ai-cron-btn-run:hover { background: #f9fafb; color: #374151; border-color: #d1d5db; }

/* ==================== 统计面板 ==================== */
.ls-ai-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    border-bottom: 1px solid #f3f4f6;
}

.ls-ai-stat-item {
    padding: 16px 12px;
    text-align: center;
    border-right: 1px solid #f3f4f6;
}

.ls-ai-stat-item:last-child { border-right: none; }

.ls-ai-stat-num {
    display: block;
    font-size: 22px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.2;
}

.ls-ai-stat-label {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ==================== 测试连接行 ==================== */
.ls-ai-test-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
}

.ls-ai-test-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.ls-ai-test-info i { font-size: 18px; color: #f59e0b; }

.ls-ai-test-hint {
    font-weight: 400;
    font-size: 12px;
    color: #9ca3af;
    margin-left: 4px;
}

.ls-ai-test-result {
    margin: 0 18px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.7;
    word-break: break-all;
}

.ls-ai-test-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 14px 18px;
}

.ls-ai-test-fail {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 14px 18px;
}

.ls-ai-test-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.ls-ai-test-success .ls-ai-test-status { color: #059669; }
.ls-ai-test-success .ls-ai-test-status i { color: #10b981; font-size: 18px; }
.ls-ai-test-fail .ls-ai-test-status { color: #dc2626; }
.ls-ai-test-fail .ls-ai-test-status i { color: #ef4444; font-size: 18px; }

.ls-ai-test-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.ls-ai-test-reply {
    padding: 10px 12px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #d1fae5;
    font-size: 13px;
    color: #374151;
}

.ls-ai-test-reply strong { color: #059669; margin-right: 4px; }

.ls-ai-test-error {
    padding: 10px 12px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #fecaca;
    font-size: 12px;
    color: #991b1b;
}

/* ==================== 日志卡片 ==================== */
.ls-ai-card-log { padding: 18px; }

/* 日志筛选标签 */
.ls-ai-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ls-ai-filter-tabs {
    display: flex;
    gap: 4px;
}

.ls-ai-clear-logs {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #9ca3af;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.15s;
}

.ls-ai-clear-logs:hover { color: #dc2626; background: #fef2f2; }
.ls-ai-clear-logs i { font-size: 14px; }

.ls-ai-filter-tab {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    background: #f3f4f6;
    transition: all 0.15s;
}

.ls-ai-filter-tab:hover { background: #e5e7eb; color: #374151; }
.ls-ai-filter-tab.active { background: #3b82f6; color: #fff; }

/* ==================== 表格 ==================== */
.ls-ai-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.ls-ai-table th {
    background: #f9fafb;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.ls-ai-table td {
    padding: 10px 14px;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.ls-ai-table tbody tr:hover { background: #f9fafb; }

.ls-ai-cell-summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
}

.ls-ai-cell-time { color: #9ca3af; font-size: 12px; white-space: nowrap; }

/* ==================== 标签 ==================== */
.ls-ai-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    background: #f3f4f6;
    color: #6b7280;
}

.ls-ai-tag-green { background: #d1fae5; color: #065f46; }
.ls-ai-tag-yellow { background: #fef3c7; color: #92400e; }
.ls-ai-tag-blue { background: #dbeafe; color: #1e40af; }
.ls-ai-tag-purple { background: #ede9fe; color: #5b21b6; }
.ls-ai-tag-pink { background: #fce7f3; color: #be185d; }
.ls-ai-tag-amber { background: #fef3c7; color: #d97706; }
.ls-ai-tag-violet { background: #ede9fe; color: #7c3aed; }
.ls-ai-tag-red { background: #fee2e2; color: #dc2626; }

/* ==================== 详情按钮 ==================== */
.ls-ai-detail-btn { color: #3b82f6; font-size: 12px; text-decoration: none; }
.ls-ai-detail-btn:hover { text-decoration: underline; }

/* ==================== 空状态 ==================== */
.ls-ai-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.ls-ai-empty i { font-size: 40px; display: block; margin-bottom: 10px; }
.ls-ai-empty p { margin: 0; font-size: 14px; }

/* ==================== 分页 ==================== */
.ls-ai-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.ls-ai-page-info { font-size: 13px; color: #9ca3af; margin-right: 8px; }

.ls-page-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.ls-page-btn:hover:not(.disabled) { border-color: #3b82f6; color: #3b82f6; }
.ls-page-btn.disabled { opacity: 0.3; cursor: not-allowed; }

/* ==================== 弹窗 ==================== */
.ls-ai-modal-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
}

.ls-ai-modal-body {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 560px;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.ls-ai-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.ls-ai-modal-title { font-size: 15px; font-weight: 600; color: #1f2937; }

.ls-ai-modal-close { color: #9ca3af; font-size: 20px; text-decoration: none; line-height: 1; }
.ls-ai-modal-close:hover { color: #374151; }

.ls-ai-modal-content {
    padding: 20px;
    overflow-y: auto;
    font-size: 13px;
    color: #374151;
    line-height: 1.8;
}

.ls-ai-modal-content .ls-ai-dl {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 8px 12px;
}

.ls-ai-modal-content .ls-ai-dt { color: #9ca3af; font-size: 12px; text-align: right; }
.ls-ai-modal-content .ls-ai-dd { word-break: break-all; }
.ls-ai-modal-content .ls-ai-dd a { color: #3b82f6; text-decoration: none; }
.ls-ai-modal-content .ls-ai-dd a:hover { text-decoration: underline; }

.ls-ai-modal-content .ls-ai-reply-box {
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #cde0ff;
    border-left: 3px solid #3b82f6;
    line-height: 1.7;
}

/* ==================== 队列管理 ==================== */
.ls-ai-queue-title { font-size: 14px; font-weight: 500; color: #374151; display: inline-flex; align-items: center; gap: 6px; }
.ls-ai-queue-title i { font-size: 16px; color: #6b7280; }
.ls-ai-queue-count { color: #9ca3af; font-weight: 400; font-size: 13px; }
.ls-ai-modal-queue .ls-ai-modal-body { width: 820px; max-width: calc(100vw - 40px); }
.ls-ai-modal-queue .ls-ai-modal-content { padding: 0 20px 20px; }

/* 评论/帖子内容在摘要和详情中的呈现 */
.ls-ai-target-content { color: #374151; }
.ls-ai-target-content img.ls-emoji,
.ls-ai-target-content-box img.ls-emoji { width: 18px; height: 18px; vertical-align: -4px; }
.ls-ai-target-content-box {
    background: #f9fafb;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #eef0f3;
    line-height: 1.7;
    word-break: break-all;
}
