/**
 * 跨境电商365Agent · 工作台样式
 *
 * 阶段 1 工作台短代码 [aips_workspace] 专用。
 * 旧聊天 UI 样式（v1.4.2 ~2500 行）已删除，CSS 类名前缀仍用 aips-* 保持一致性。
 */

/* ============ 全局容器 ============ */
.aips-workspace {
    max-width: 920px;
    margin: 24px auto;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: #1f2937;
    line-height: 1.6;
}

.aips-workspace * { box-sizing: border-box; }

.aips-notice {
    padding: 16px;
    background: #f3f4f6;
    border-radius: 6px;
    margin: 16px 0;
}
.aips-notice-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* ============ 顶部品牌区 ============ */
.aips-workspace-brand h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 600;
}
.aips-workspace-brand p {
    margin: 0 0 16px;
    color: #6b7280;
    font-size: 14px;
}
.aips-warn-banner {
    background: #fef3c7;
    color: #92400e;
    padding: 10px 14px;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    margin-top: 12px;
    font-size: 13px;
}

/* ============ 表单 ============ */
.aips-stage { margin-top: 24px; }

.aips-form-group { margin-bottom: 20px; }

.aips-form-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #374151;
}
.aips-required { color: #ef4444; }

.aips-form-group select,
.aips-form-group textarea,
.aips-form-group input[type="text"],
.aips-form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    background: #fff;
}
.aips-form-group select:focus,
.aips-form-group textarea:focus,
.aips-form-group input[type="text"]:focus,
.aips-form-group input[type="number"]:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.aips-form-group textarea { resize: vertical; min-height: 70px; }

.aips-form-actions { margin-top: 24px; }

.aips-submit-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    padding: 12px 32px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}
.aips-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.aips-submit-btn:active { transform: translateY(0); }
.aips-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.aips-form-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #991b1b;
    font-size: 13px;
}

/* ============ 拖拽上传区 ============ */
.aips-dropzone {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    min-height: 120px;
}
.aips-dropzone:hover,
.aips-dropzone.aips-dropzone-hover {
    border-color: #4f46e5;
    background: #eef2ff;
}

.aips-dropzone-empty {
    padding: 28px 20px;
    text-align: center;
}
.aips-dropzone-icon {
    font-size: 36px;
    margin-bottom: 8px;
}
.aips-dropzone-text {
    font-size: 15px;
    color: #374151;
    margin-bottom: 4px;
}
.aips-dropzone-text a {
    color: #4f46e5;
    text-decoration: underline;
}
.aips-dropzone-hint {
    font-size: 12px;
    color: #6b7280;
}

.aips-dropzone-filled { padding: 20px; }
.aips-dropzone-file {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}
.aips-file-icon { font-size: 24px; }
.aips-file-name {
    flex: 1;
    font-weight: 500;
    color: #111827;
    word-break: break-all;
}
.aips-file-size { color: #6b7280; font-size: 13px; }
.aips-file-remove {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}
.aips-file-remove:hover { background: #fecaca; }

/* ============ v2.3.2 form 旁返回按钮 ============ */
.aips-back-link-btn {
    display: inline-block;
    margin-left: 12px;
    padding: 12px 24px;
    background: transparent;
    color: #6b7280;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all .15s;
    line-height: 1;
}
.aips-back-link-btn:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: #d1d5db;
}

/* ============ v2.3.1 工作台顶部按钮（v2.4.1 升级为按钮组） ============ */
.aips-workspace-topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
/* v2.11.5：顶部导航按钮(实心填充版)
 * v2.18.2：用户反馈实心橙太浓 → 改成"浅橙底 + 深橙字"软化版,保留橙色品牌但不抢眼
 */
.aips-workspace-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    color: #c2410c;             /* orange-700, 深橙文字 */
    background: #ffedd5;        /* orange-100, 浅橙底 */
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #fed7aa;  /* orange-200, 浅橙描边 */
    border-radius: 8px;
    transition: all .15s ease;
    box-shadow: 0 1px 2px rgba(249, 115, 22, .08);
}
.aips-workspace-back:hover,
.aips-workspace-back:focus,
.aips-workspace-back:visited {
    background: #fed7aa;        /* hover 时略深一档 orange-200 */
    border-color: #fdba74;      /* orange-300 */
    color: #9a3412;             /* orange-800, hover 时文字更深以保对比 */
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(249, 115, 22, .15);
    text-decoration: none;
}
/* "返回亚马逊广告" 单独白底变体 — 和"切换工作台"那组主操作区分 */
.aips-workspace-topnav > .aips-workspace-back:first-child {
    background: #fff;
    color: #c2410c;
    border-color: #fed7aa;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.aips-workspace-topnav > .aips-workspace-back:first-child:hover {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fdba74;
    box-shadow: 0 2px 6px rgba(249, 115, 22, .12);
}

/* ============ v2.3.0 多文件列表（dropzone 内）============ */
.aips-dropzone-multi-filled { padding: 16px; }
.aips-files-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.aips-files-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin-bottom: 8px;
}
.aips-files-item:last-child { margin-bottom: 0; }
.aips-files-item .aips-file-name { flex: 1; min-width: 0; word-break: break-all; }
.aips-file-type {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    background: #f3f4f6;
    color: #6b7280;
}
.aips-file-type-campaign     { background: #dbeafe; color: #1e40af; }
.aips-file-type-search-term  { background: #dcfce7; color: #15803d; }
.aips-file-type-targeting    { background: #fef3c7; color: #92400e; }
.aips-file-type-product      { background: #fef3c7; color: #92400e; }
.aips-file-type-unknown      { background: #f3f4f6; color: #6b7280; }
.aips-files-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e5e7eb;
}
.aips-files-add {
    color: #2E75B6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.aips-files-add:hover { text-decoration: underline; }
.aips-files-summary  { color: #6b7280; font-size: 13px; }

/* ============ 进度条 + 任务元信息 ============ */
.aips-task-meta { margin-bottom: 16px; }
.aips-task-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
    color: #6b7280;
}
.aips-task-info code {
    background: #e5e7eb;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
}
.aips-badge-mock {
    background: #f59e0b;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.aips-progress-wrap { margin: 20px 0; }
.aips-progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}
.aips-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    width: 0%;
    transition: width 0.5s ease;
}
.aips-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.aips-action-bar { margin: 12px 0 24px; }
.aips-cancel-btn {
    background: #fff;
    color: #6b7280;
    border: 1px solid #d1d5db;
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
}
.aips-cancel-btn:hover {
    color: #ef4444;
    border-color: #ef4444;
}

/* ============ 章节卡片(v2.6.5 升级)============ */
.aips-chapter {
    margin: 24px 0;
    padding: 24px 28px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #4f46e5;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.02);
    transition: box-shadow .2s ease;
}
.aips-chapter:hover {
    box-shadow: 0 4px 12px rgba(79,70,229,.08), 0 2px 4px rgba(0,0,0,.03);
}
/* 章节标题加图标徽章感 */
.aips-chapter-title {
    margin: 0 0 18px 0;
    padding: 10px 16px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #3730a3;
    display: inline-block;
}
.aips-chapter-fadein {
    animation: aipsFadeIn 0.5s ease;
}
@keyframes aipsFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aips-chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}
.aips-chapter-header h3 {
    margin: 0;
    font-size: 18px;
    color: #111827;
}
.aips-chapter-time {
    font-size: 12px;
    color: #9ca3af;
}

/* ============ Markdown 章节内容样式(v2.6.5 升级)
 *
 * 兼容两套 DOM:
 *   - .aips-chapter-content(ads / listing 工作台)
 *   - .aips-md(keyword / selection 工作台,通常带 .aips-chapter-body 父级)
 * 全部规则同时作用于这两个 selector,保证 4 个工作台视觉一致。
 * ============ */

.aips-chapter-content,
.aips-md {
    font-size: 14.5px;
    color: #374151;
    line-height: 1.75;
}

/* 标题层级 + 左侧色块 */
.aips-chapter-content h2,
.aips-md h2 {
    font-size: 19px;
    color: #1f2937;
    margin: 24px 0 12px;
    padding-left: 12px;
    border-left: 4px solid #4f46e5;
    font-weight: 700;
    line-height: 1.4;
}
.aips-chapter-content h3,
.aips-md h3 {
    font-size: 16px;
    color: #1f2937;
    margin: 20px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e5e7eb;
    font-weight: 600;
}
.aips-chapter-content h4,
.aips-md h4 {
    font-size: 15px;
    color: #4f46e5;
    margin: 16px 0 8px;
    font-weight: 600;
}

/* 段落 / 列表 */
.aips-chapter-content p,
.aips-md p { margin: 10px 0; }

.aips-chapter-content ul,
.aips-chapter-content ol,
.aips-md ul,
.aips-md ol {
    padding-left: 24px;
    margin: 10px 0;
}
.aips-chapter-content li,
.aips-md li { margin: 6px 0; }
.aips-chapter-content ul li::marker,
.aips-md ul li::marker { color: #4f46e5; }

/* 加粗 / 强调 */
.aips-chapter-content strong,
.aips-md strong {
    color: #111827;
    font-weight: 700;
}
.aips-chapter-content em,
.aips-md em {
    color: #4338ca;
    font-style: normal;
    background: #eef2ff;
    padding: 0 4px;
    border-radius: 3px;
}

/* 代码 */
.aips-chapter-content code,
.aips-md code {
    background: #f3f4f6;
    color: #be185d;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 13px;
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    border: 1px solid #e5e7eb;
}
.aips-chapter-content pre,
.aips-md pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 14px 18px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.6;
}
.aips-chapter-content pre code,
.aips-md pre code {
    background: transparent;
    color: inherit;
    border: none;
    padding: 0;
}

/* 引用块 — 浅色卡片化 */
.aips-chapter-content blockquote,
.aips-md blockquote {
    border-left: 4px solid #4f46e5;
    background: #eef2ff;
    padding: 12px 18px;
    margin: 14px 0;
    color: #3730a3;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
}
.aips-chapter-content blockquote p,
.aips-md blockquote p { margin: 4px 0; }

/* 分隔线 */
.aips-chapter-content hr,
.aips-md hr {
    border: none;
    border-top: 1px dashed #d1d5db;
    margin: 24px 0;
}

/* 链接 */
.aips-chapter-content a,
.aips-md a {
    color: #4f46e5;
    text-decoration: none;
    border-bottom: 1px dotted #4f46e5;
}
.aips-chapter-content a:hover,
.aips-md a:hover { color: #3730a3; border-bottom-style: solid; }

/* ============ 表格 — 重点美化 ============ */
.aips-chapter-content table,
.aips-md table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13.5px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    border: 1px solid #e5e7eb;
}
.aips-chapter-content thead,
.aips-md thead {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
}
.aips-chapter-content th,
.aips-md th {
    padding: 11px 14px;
    color: #fff !important;
    text-align: left;
    font-weight: 600;
    border: none !important;
    font-size: 13px;
    letter-spacing: 0.3px;
}
.aips-chapter-content td,
.aips-md td {
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
    vertical-align: top;
    color: #374151;
}
/* 斑马纹 */
.aips-chapter-content tbody tr:nth-child(even),
.aips-md tbody tr:nth-child(even) { background: #fafbfc; }
.aips-chapter-content tbody tr:hover,
.aips-md tbody tr:hover { background: #eef2ff; transition: background .15s; }
.aips-chapter-content tbody tr:last-child td,
.aips-md tbody tr:last-child td { border-bottom: none; }

/* 表格里的代码 / 加粗适配深色表头 */
.aips-chapter-content th code,
.aips-md th code {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

/* ============ Emoji 视觉强化(v2.6.5 新增)============
 *
 * 把行内的 ✅ ⚠️ ❌ 📊 📌 等 emoji 略微放大,提高可读性。
 * 不影响正常 emoji 显示,只是字号略增。
 * （CSS 没法精准选 emoji,这里用兜底:.aips-emoji 类需 AI/JS 配合;
 *   退而求其次,仅放大 H 标签开头的 emoji 通过 first-letter 自然变大）
 */
.aips-md h2:first-letter,
.aips-chapter-content h2:first-letter { font-size: 1.15em; }
.aips-md h3:first-letter,
.aips-chapter-content h3:first-letter { font-size: 1.1em; }

/* ============ 数据徽章(可由 prompt 引导 AI 输出特定 HTML)============ */
.aips-md .badge,
.aips-chapter-content .badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin: 0 4px;
    background: #e0e7ff;
    color: #3730a3;
}
.aips-md .badge-green,    .aips-chapter-content .badge-green    { background: #dcfce7; color: #166534; }
.aips-md .badge-red,      .aips-chapter-content .badge-red      { background: #fee2e2; color: #991b1b; }
.aips-md .badge-yellow,   .aips-chapter-content .badge-yellow   { background: #fef3c7; color: #92400e; }
.aips-md .badge-blue,     .aips-chapter-content .badge-blue     { background: #dbeafe; color: #1e40af; }

/* ============ 错误 ============ */
.aips-error {
    margin: 16px 0;
    padding: 14px 18px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #991b1b;
    font-size: 14px;
}

/* ============ 完成 banner ============ */
.aips-completed-banner { margin-bottom: 24px; }
.aips-completed-card {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
}
.aips-completed-card h3 {
    margin: 0 0 6px;
    font-size: 22px;
}
.aips-completed-card p { margin: 0; font-size: 14px; opacity: 0.95; }

.aips-completed-actions {
    margin-top: 24px;
    text-align: center;
}
.aips-new-btn {
    background: #4f46e5;
    color: #fff;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}
.aips-new-btn:hover { background: #4338ca; }

/* ============ v2.2.4 完成页 toolbar（复制全部 + 导出 Excel + 新分析） ============ */
.aips-completed-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin: -8px 0 24px;
}
.aips-toolbar-btn {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.aips-toolbar-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.aips-toolbar-btn:active { transform: translateY(1px); }
.aips-toolbar-btn-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    font-weight: 500;
}
.aips-toolbar-btn-primary:hover {
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* ============ v2.2.4 章节内复制按钮 ============ */
.aips-chapter-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.aips-chapter-copy-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #9ca3af;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.15s;
}
.aips-chapter-copy-btn:hover {
    background: #f3f4f6;
    color: #4f46e5;
    border-color: #d1d5db;
}
.aips-chapter-copy-btn:active {
    background: #e5e7eb;
    transform: scale(0.95);
}

/* ============ v2.2.4 全局 toast ============ */
.aips-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #10b981;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}
.aips-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.aips-toast-error    { background: #ef4444; }
.aips-toast-info     { background: #3b82f6; }
.aips-toast-success  { background: #10b981; }

/* ============ Listing 工作台专属（[aips_listing_workspace]） ============ */

/* 表单分组 fieldset */
.aips-listing-fieldset {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px 22px 6px;
    margin: 0 0 22px;
    background: #fff;
}
.aips-listing-fieldset legend {
    padding: 2px 10px;
    font-size: 14px;
    font-weight: 600;
    color: #4f46e5;
    background: transparent;
}

/* 2 列网格（品牌+产品名 / 受众+档位） */
.aips-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.aips-form-grid-2 .aips-form-group { margin-bottom: 14px; }

/* Listing 警告条（任务 meta 区 + AI 自报 warnings） */
.aips-listing-warnings {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e5e9f0;
    border-radius: 6px;
}
.aips-listing-warnings-head {
    font-size: 12.5px;
    color: #475569;
    font-weight: 700;
    margin-bottom: 5px;
}
.aips-listing-warning-item {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
}
.aips-listing-warning-item + .aips-listing-warning-item {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #fde68a;
}

/* 字符 / 字节数徽章网格 */
.aips-listing-badges {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}
.aips-listing-badge {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid;
    background: #fff;
    text-align: center;
}
.aips-listing-badge-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
}
.aips-listing-badge-value {
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.aips-listing-badge-ok {
    border-color: #a7f3d0;
    background: #ecfdf5;
}
.aips-listing-badge-ok .aips-listing-badge-value { color: #047857; }

.aips-listing-badge-warn {
    border-color: #fde68a;
    background: #fffbeb;
}
.aips-listing-badge-warn .aips-listing-badge-value { color: #b45309; }

.aips-listing-badge-over {
    border-color: #fca5a5;
    background: #fef2f2;
}
.aips-listing-badge-over .aips-listing-badge-value { color: #b91c1c; }

/* 关键词覆盖率徽章 */
.aips-listing-coverage {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 16px;
    padding: 10px 14px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    font-size: 14px;
}
.aips-listing-coverage-label { color: #4338ca; font-weight: 500; }
.aips-listing-coverage-value {
    font-size: 18px;
    font-weight: 700;
    color: #4f46e5;
    font-variant-numeric: tabular-nums;
}
.aips-listing-coverage-detail { color: #6366f1; font-size: 13px; }

/* 结果容器 */
.aips-listing-result { margin-top: 8px; }
.aips-listing-content {
    border-left-color: #10b981; /* 区别于 ads 工作台的紫色侧边线 */
}

/* 完成卡片警告变体（任务完成但内容缺失） */
.aips-completed-card-warn {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* ============ v2.4.3 AI 推断产品信息（按钮 + 结果卡片） ============ */
.aips-listing-infer-wrap {
    margin-top: 16px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #faf5ff, #eef2ff);
    border: 1px dashed #c4b5fd;
    border-radius: 8px;
}
.aips-listing-infer-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 22px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    cursor: pointer;
    transition: opacity .15s, transform .05s;
    text-shadow: none !important;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3) !important;
}
.aips-listing-infer-btn:hover {
    opacity: 0.92;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4) !important;
}
.aips-listing-infer-btn:active { transform: translateY(1px); }
.aips-listing-infer-btn:disabled,
.aips-listing-infer-btn-loading {
    opacity: 0.7 !important;
    cursor: wait !important;
}
.aips-listing-infer-btn-loading .aips-listing-infer-btn-icon {
    animation: aipsSpin 1.2s linear infinite;
    display: inline-block;
}
@keyframes aipsSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.aips-listing-infer-hint {
    margin-top: 10px;
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.6;
}
/* 推断结果卡片 */
.aips-listing-infer-result { margin-top: 14px; }
.aips-listing-infer-card {
    padding: 14px 18px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #8b5cf6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.aips-listing-infer-card-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 13.5px;
}
.aips-listing-infer-card-label { color: #6b7280; flex-shrink: 0; }
.aips-listing-infer-card strong { color: #111827; font-size: 15px; }
.aips-listing-infer-reasoning {
    color: #4b5563;
    line-height: 1.6;
    font-size: 13px;
    flex: 1;
}
.aips-listing-infer-card-tip {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
    color: #047857;
    font-size: 12.5px;
    line-height: 1.6;
}
/* 置信度变体（侧边线颜色） */
.aips-listing-infer-conf-high   { border-left-color: #10b981; }
.aips-listing-infer-conf-medium { border-left-color: #f59e0b; }
.aips-listing-infer-conf-low    { border-left-color: #ef4444; }
.aips-listing-infer-conf-badge {
    margin-left: auto;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.aips-listing-infer-conf-high .aips-listing-infer-conf-badge   { background: #d1fae5; color: #065f46; }
.aips-listing-infer-conf-medium .aips-listing-infer-conf-badge { background: #fef3c7; color: #92400e; }
.aips-listing-infer-conf-low .aips-listing-infer-conf-badge    { background: #fee2e2; color: #991b1b; }

/* "🎁 一键填入全部示例" 按钮（fieldset 工具条） */
.aips-listing-fieldset-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 12px;
}
/* 用 !important 覆盖某些主题对全局 button 的深色样式（v2.4.1 实测） */
.aips-fill-all-examples-btn {
    background: #fff !important;
    color: #6366f1 !important;
    border: 1px dashed #c7d2fe !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-size: 12.5px !important;
    line-height: 1.3 !important;
    cursor: pointer;
    transition: all .15s;
    text-shadow: none !important;
    box-shadow: none !important;
}
.aips-fill-all-examples-btn:hover {
    background: #eef2ff !important;
    border-style: solid !important;
    border-color: #818cf8 !important;
}

/* 单字段"用示例 / 不用示例"链接（label 右侧 / 无 label 时单独成行） */
.aips-form-label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.aips-form-label-only-action {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 6px;
}
.aips-form-example-link {
    font-size: 12px;
    color: #6366f1;
    text-decoration: none;
    font-weight: 400;
    padding: 1px 6px;
    border-radius: 3px;
    transition: background .15s;
    flex-shrink: 0;
    margin-left: 4px;
}
.aips-form-example-link:hover {
    background: #eef2ff;
    text-decoration: underline;
}
.aips-form-example-link::before { content: '📋 '; }

.aips-form-clear-link {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: none;
    font-weight: 400;
    padding: 1px 6px;
    border-radius: 3px;
    transition: background .15s, color .15s;
    flex-shrink: 0;
    margin-left: 4px;
}
.aips-form-clear-link:hover {
    background: #fee2e2;
    color: #b91c1c;
    text-decoration: underline;
}
.aips-form-clear-link::before { content: '✕ '; }

/* "🧹 一键取消全部示例" 按钮（fieldset 工具条，与"一键填入"并排） */
.aips-clear-all-fields-btn {
    background: #fff !important;
    color: #b91c1c !important;
    border: 1px dashed #fecaca !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-size: 12.5px !important;
    line-height: 1.3 !important;
    cursor: pointer;
    transition: all .15s;
    margin-left: 8px;
    text-shadow: none !important;
    box-shadow: none !important;
}
.aips-clear-all-fields-btn:hover {
    background: #fef2f2 !important;
    border-style: solid !important;
    border-color: #fca5a5 !important;
}

/* v2.4.9：listing 工作台 form actions 改 flex 布局，"返回"自动靠最右 */
.aips-workspace-listing .aips-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
/* "返回"按钮的橙色突出样式（v2.4.9 新增 accent 变体；只影响 listing 工作台的返回，ads 工作台不受影响） */
.aips-back-link-btn-accent {
    margin-left: auto !important;   /* flex 布局下推到最右 */
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    color: #fff !important;
    border: 1px solid #f97316 !important;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25) !important;
    font-weight: 500 !important;
}
.aips-back-link-btn-accent:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c) !important;
    border-color: #ea580c !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4) !important;
}

/* "保存草稿"按钮（位于表单底部，与提交/返回并排） */
.aips-listing-draft-btn {
    display: inline-block;
    margin-left: 12px;
    padding: 11px 18px;
    background: #fff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
    line-height: 1;
    min-width: 130px;
    text-align: center;
}
.aips-listing-draft-btn:hover {
    background: #eef2ff;
    border-color: #818cf8;
}
.aips-listing-draft-btn:active { transform: translateY(1px); }
/* 自动保存状态：输入中（黄）/ 已保存（绿）— 都不点击不响应 hover */
.aips-listing-draft-btn-typing {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}
.aips-listing-draft-btn-saved {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

/* v2.4.16：强制刷新提示（醒目突出版） */
.aips-listing-refresh-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 18px;
    padding: 14px 18px;
    background: linear-gradient(to right, #fff7ed, #fffbeb);
    border: 2px solid #f59e0b;
    border-left: 6px solid #d97706;
    border-radius: 8px;
    font-size: 14px;
    color: #78350f;
    line-height: 1.75;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.22);
}
.aips-listing-refresh-tip-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
    animation: aipsRefreshPulse 2s ease-in-out infinite;
}
@keyframes aipsRefreshPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}
.aips-listing-refresh-tip-text { flex: 1; }
.aips-listing-refresh-tip strong {
    color: #b45309;
    font-weight: 700;
}
.aips-listing-refresh-tip kbd {
    display: inline-block;
    padding: 2px 9px;
    background: #fff;
    border: 1.5px solid #f59e0b;
    border-bottom-width: 3px;
    border-radius: 5px;
    font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
    font-size: 12.5px;
    color: #92400e;
    box-shadow: 0 1px 0 rgba(146, 64, 14, 0.2);
    margin: 0 2px;
    font-weight: 700;
}

/* 草稿恢复横幅（放在表单顶部） */
.aips-listing-draft-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 10px 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    font-size: 13px;
    color: #065f46;
}
.aips-listing-draft-banner-text { flex: 1; }
.aips-listing-draft-banner-clear {
    flex-shrink: 0;
    color: #047857;
    text-decoration: underline;
    font-size: 13px;
}
.aips-listing-draft-banner-clear:hover { color: #065f46; }

/* ============ 响应式 ============ */
@media (max-width: 640px) {
    .aips-workspace { padding: 16px; margin: 12px; }
    .aips-workspace-brand h2 { font-size: 20px; }
    .aips-task-info { flex-direction: column; gap: 6px; }
    .aips-chapter { padding: 16px; }
    .aips-progress-meta { flex-direction: column; gap: 4px; }

    /* Listing 工作台移动端 */
    .aips-form-grid-2 { grid-template-columns: 1fr; gap: 0; }
    .aips-listing-fieldset { padding: 14px 16px 4px; }
    .aips-listing-badges { grid-template-columns: repeat(2, 1fr); }
    .aips-listing-coverage {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* =====================================================================
 * AI选品榜单（v2.31.0）—— [aips_selection_ranking] 前端
 * ===================================================================== */

.aips-rk-app { margin-top: 20px; }

/* 加载 / 空态 */
.aips-rk-loading { text-align: center; padding: 60px 20px; color: #6b7280; }
.aips-rk-spinner {
    width: 36px; height: 36px; margin: 0 auto 14px;
    border: 3px solid #e5e7eb; border-top-color: #4f46e5;
    border-radius: 50%; animation: aips-rk-spin 0.8s linear infinite;
}
@keyframes aips-rk-spin { to { transform: rotate(360deg); } }
.aips-rk-empty {
    text-align: center; padding: 48px 20px; color: #6b7280;
    background: #f9fafb; border: 1px dashed #d1d5db;
    border-radius: 8px; margin-top: 16px;
}

/* 工具栏（日期 / 类目下拉 / 返回） */
.aips-rk-toolbar {
    display: flex; flex-wrap: wrap; gap: 12px;
    align-items: center; margin-bottom: 18px;
}
.aips-rk-datebox, .aips-rk-catbox { font-size: 13px; color: #6b7280; }
.aips-rk-toolbar select,
.aips-rk-filterbar select {
    font-size: 13px; padding: 6px 10px; margin-left: 4px;
    border: 1px solid #d1d5db; border-radius: 6px;
    background: #fff; color: #1f2937; cursor: pointer;
}
/* ASIN 文本筛选框：跟 select 同款外观 + 等宽字体 + 自动大写显示 */
.aips-rk-asin-input {
    font-size: 13px; padding: 6px 12px; margin-left: 4px;
    border: 1px solid #d1d5db; border-radius: 6px;
    background: #fff; color: #1f2937;
    min-width: 168px; max-width: 200px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.aips-rk-asin-input::placeholder { text-transform: none; letter-spacing: 0; color: #9ca3af; font-family: inherit; }
.aips-rk-asin-input:focus {
    outline: none; border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.aips-rk-hub-summary { font-size: 13px; color: #6b7280; }
.aips-rk-back {
    font: inherit; font-size: 13px; cursor: pointer;
    background: #f3f4f6; border: 1px solid #e5e7eb;
    border-radius: 6px; padding: 7px 14px; color: #4f46e5;
}
.aips-rk-back:hover { background: #eef2ff; }

/* 类目卡片网格（hub） */
.aips-rk-cat-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.aips-rk-cat-card {
    font: inherit; width: 100%; text-align: left; cursor: pointer;
    display: flex; flex-direction: column; gap: 8px;
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 10px; padding: 16px 18px;
    transition: transform .1s, box-shadow .2s, border-color .2s;
}
.aips-rk-cat-card:hover {
    transform: translateY(-2px); border-color: #c7d2fe;
    box-shadow: 0 6px 18px rgba(79, 70, 229, .12);
}
.aips-rk-cat-name { font-size: 15px; font-weight: 600; color: #1f2937; }
.aips-rk-cat-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.aips-rk-cat-count, .aips-rk-cat-score {
    font-size: 12px; padding: 2px 8px; border-radius: 4px;
}
.aips-rk-cat-count { background: #eef2ff; color: #4338ca; }
.aips-rk-cat-score { background: #f0fdf4; color: #15803d; }
.aips-rk-cat-src { font-size: 12px; color: #9ca3af; }
.aips-rk-cat-tip { font-size: 12px; color: #b45309; }

/* 付费墙横幅 */
.aips-rk-paywall-banner {
    display: flex; flex-wrap: wrap; gap: 12px;
    align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, #eef2ff, #faf5ff);
    border: 1px solid #c7d2fe; border-radius: 8px;
    padding: 14px 18px; margin-bottom: 18px;
}
.aips-rk-paywall-text { font-size: 13px; color: #3730a3; }
.aips-rk-paywall-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff !important; text-decoration: none;
    padding: 9px 20px; border-radius: 6px;
    font-size: 13px; font-weight: 600; white-space: nowrap;
}
.aips-rk-paywall-btn:hover { box-shadow: 0 4px 12px rgba(79, 70, 229, .3); }

/* 类目标题 / 选品解读 */
.aips-rk-cat-title { font-size: 18px; font-weight: 600; margin: 4px 0 14px; }
.aips-rk-cat-title-count { font-size: 13px; font-weight: 400; color: #9ca3af; }
.aips-rk-commentary {
    background: #fffbeb; border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b; border-radius: 6px;
    padding: 12px 16px; margin-bottom: 16px;
}
.aips-rk-commentary strong { font-size: 13px; color: #92400e; }
.aips-rk-commentary p {
    margin: 6px 0 0; font-size: 13px; color: #78350f;
    white-space: pre-wrap; line-height: 1.7;
}
.aips-rk-commentary-locked { font-size: 13px; color: #92400e; }

/* 筛选 / 排序栏 */
.aips-rk-filterbar {
    display: flex; flex-wrap: wrap; gap: 12px;
    align-items: center; justify-content: space-between;
    background: #f9fafb; border: 1px solid #e5e7eb;
    border-radius: 8px; padding: 12px 14px; margin-bottom: 16px;
}
.aips-rk-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.aips-rk-sort { font-size: 13px; color: #6b7280; white-space: nowrap; }

/* 产品卡片 */
.aips-rk-product-list { display: flex; flex-direction: column; gap: 12px; }
.aips-rk-product-card {
    display: grid; gap: 8px 14px; align-items: start;
    grid-template-columns: 36px 72px minmax(0, 1fr) auto;
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 10px; padding: 14px 16px;
    transition: border-color .15s, box-shadow .15s;
}
.aips-rk-product-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 3px 14px rgba(79, 70, 229, .09);
}
.aips-rk-rank {
    font-size: 14px; font-weight: 700; color: #4f46e5;
    background: #eef2ff; border-radius: 6px;
    padding: 4px 0; text-align: center;
}
.aips-rk-img {
    width: 72px; height: 72px; object-fit: contain;
    border: 1px solid #f3f4f6; border-radius: 6px; background: #fff;
}
.aips-rk-img-locked, .aips-rk-img-empty {
    display: flex; align-items: center; justify-content: center;
    color: #9ca3af; background: #f3f4f6;
}
.aips-rk-img-empty { font-size: 12px; }
.aips-rk-img-locked { font-size: 24px; }
.aips-rk-pinfo { min-width: 0; }
.aips-rk-ptitle {
    font-size: 14px; font-weight: 600; color: #1f2937; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.aips-rk-pbrand { font-size: 12px; color: #9ca3af; margin-top: 3px; }
.aips-rk-pmeta {
    display: flex; flex-wrap: wrap; gap: 10px;
    align-items: center; margin-top: 6px;
}
.aips-rk-asin {
    font-size: 12px; color: #4f46e5; text-decoration: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.aips-rk-asin:hover { text-decoration: underline; }
.aips-rk-asin-locked, .aips-rk-locked-val { font-size: 12px; color: #9ca3af; }
.aips-rk-pprice { font-size: 13px; color: #1f2937; }
.aips-rk-pstats { display: flex; flex-wrap: wrap; gap: 14px; }
.aips-rk-stat { text-align: center; min-width: 50px; }
.aips-rk-stat-v { display: block; font-size: 14px; font-weight: 700; color: #1f2937; }
.aips-rk-stat-l { display: block; font-size: 11px; color: #9ca3af; margin-top: 2px; }
.aips-rk-stat-score .aips-rk-stat-v { color: #4f46e5; }

/* 6 维评分明细 */
.aips-rk-detail { grid-column: 1 / -1; margin-top: 4px; }
.aips-rk-detail summary {
    cursor: pointer; font-size: 12px; color: #4f46e5;
    padding: 6px 0; user-select: none;
}
.aips-rk-dims {
    display: flex; flex-direction: column; gap: 6px; padding: 8px 0 4px;
}
.aips-rk-dim { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.aips-rk-dim-l { width: 64px; flex-shrink: 0; color: #6b7280; }
.aips-rk-dim-bar {
    flex: 1; height: 8px; background: #f3f4f6;
    border-radius: 4px; overflow: hidden;
}
.aips-rk-dim-bar i {
    display: block; height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7);
}
.aips-rk-dim-v {
    width: 38px; flex-shrink: 0; text-align: right;
    font-weight: 600; color: #1f2937;
}

/* 一级类目分区（hub） */
.aips-rk-l1-section { margin-bottom: 26px; }
.aips-rk-l1-title {
    font-size: 16px; font-weight: 700; color: #1f2937;
    margin: 0 0 12px; padding-bottom: 6px;
    border-bottom: 2px solid #eef2ff;
    display: flex; align-items: baseline; gap: 10px;
}
.aips-rk-l1-count { font-size: 12px; font-weight: 400; color: #9ca3af; }

/* 产品卡「更多数据」键值行 */
.aips-rk-kvs {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4px 18px; padding: 8px 0 4px;
}
.aips-rk-kv { display: flex; gap: 10px; font-size: 12px; }
.aips-rk-kv-k { width: 78px; flex-shrink: 0; color: #9ca3af; }
.aips-rk-kv-v { color: #1f2937; min-width: 0; word-break: break-word; }

/* 月份切换条 */
.aips-rk-monthbar {
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap; margin-bottom: 16px;
}
.aips-rk-monthbar-label { font-size: 13px; color: #6b7280; flex-shrink: 0; }
.aips-rk-month-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.aips-rk-month-btn {
    font-size: 13px; cursor: pointer; user-select: none;
    padding: 7px 16px; border-radius: 6px;
    background: #f3f4f6; border: 1px solid #e5e7eb; color: #4b5563;
    transition: background .15s, color .15s, border-color .15s;
}
.aips-rk-month-btn:hover { background: #eef2ff; color: #4f46e5; }
.aips-rk-month-btn.is-active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff; border-color: transparent; font-weight: 600;
}
.aips-rk-list-head { font-size: 13px; color: #6b7280; margin-bottom: 14px; }
.aips-rk-list-head strong { color: #4f46e5; font-weight: 700; }

/* 类目分块 —— 一级 ▸ 二级 ▸ 三级 面包屑标题条 + 产品卡列表 */
.aips-rk-cat-block { margin-bottom: 26px; }
.aips-rk-cat-block:last-child { margin-bottom: 0; }
.aips-rk-cat-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 4px 14px;
    background: linear-gradient(135deg, #eef2ff, #faf5ff);
    border: 1px solid #e0e7ff; border-left: 4px solid #6366f1;
    border-radius: 8px; padding: 11px 16px; margin-bottom: 12px;
}
.aips-rk-cat-crumb {
    margin: 0; font-size: 15px; font-weight: 700; color: #312e81;
    display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
    line-height: 1.45;
}
.aips-rk-crumb-sep { color: #a5b4fc; font-weight: 400; font-size: 11px; }
.aips-rk-cat-head-meta {
    font-size: 12px; font-weight: 600; color: #4f46e5;
    background: rgba(255, 255, 255, .78);
    border-radius: 999px; padding: 3px 12px; white-space: nowrap;
}

/* Top-3 名次徽章配色（金 / 银 / 铜） */
.aips-rk-product-list .aips-rk-product-card:nth-child(1) .aips-rk-rank {
    background: linear-gradient(135deg, #fcd34d, #f59e0b); color: #78350f;
}
.aips-rk-product-list .aips-rk-product-card:nth-child(2) .aips-rk-rank {
    background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937;
}
.aips-rk-product-list .aips-rk-product-card:nth-child(3) .aips-rk-rank {
    background: linear-gradient(135deg, #fbbf77, #c2843a); color: #fff;
}

/* 产品卡黑马指标徽章 */
.aips-rk-pbadges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.aips-rk-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 600; line-height: 1.6;
    padding: 2px 9px; border-radius: 999px;
}
.aips-rk-badge-growth { background: #fef3c7; color: #b45309; }
.aips-rk-badge-new { background: #dcfce7; color: #15803d; }

/* 「更多数据」长文本字段整行展示（流量词 / 痛点 / 卖点） */
.aips-rk-kv-wide { grid-column: 1 / -1; }
.aips-rk-kv-wide .aips-rk-kv-v { line-height: 1.6; }
.aips-rk-locked-text { font-size: 13px; color: #9ca3af; }
.aips-rk-pcat {
    display: inline-block; font-size: 11px; color: #4338ca;
    background: #eef2ff; border-radius: 3px; padding: 1px 7px;
}

/* 复制 ASIN 按钮 */
.aips-rk-asin-copy {
    display: inline-block; cursor: pointer; user-select: none;
    font-size: 11px; color: #4f46e5; margin-left: 6px;
    padding: 1px 7px; border: 1px solid #c7d2fe; border-radius: 4px;
    background: #eef2ff;
}
.aips-rk-asin-copy:hover { background: #e0e7ff; }

/* 主图点击放大：点击在原位置就地放大（toggleZoom 用内联样式控制） */
img.aips-rk-img, img.aips-rk-dp-img { cursor: zoom-in; }

/* 移动端 */
@media (max-width: 600px) {
    .aips-rk-cat-grid { grid-template-columns: 1fr 1fr; }
    .aips-rk-product-card { grid-template-columns: 32px 56px minmax(0, 1fr); }
    .aips-rk-pstats { grid-column: 2 / -1; }
    .aips-rk-img { width: 56px; height: 56px; }
    .aips-rk-paywall-banner { flex-direction: column; align-items: flex-start; }
    .aips-rk-filterbar { flex-direction: column; align-items: flex-start; }
}

/* =====================================================================
 * AI选品榜单 —— 产品详情报告页（v2.40.0）
 * ===================================================================== */

/* 产品卡底部「查看详情报告」按钮 */
.aips-rk-card-actions { grid-column: 1 / -1; margin-top: 2px; }
.aips-rk-report-btn {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12.5px; font-weight: 600; text-decoration: none;
    color: #4f46e5; background: #eef2ff;
    border: 1px solid #c7d2fe; border-radius: 7px; padding: 6px 14px;
    transition: background .15s, box-shadow .15s;
}
.aips-rk-report-btn:hover { background: #e0e7ff; box-shadow: 0 2px 8px rgba(79, 70, 229, .15); }

/* 详情页容器 + 返回链接 */
.aips-rk-detailpage { margin-top: 4px; }
.aips-rk-detail-back {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; color: #4f46e5; text-decoration: none;
    background: #f3f4f6; border: 1px solid #e5e7eb;
    border-radius: 7px; padding: 7px 14px; margin-bottom: 16px;
}
.aips-rk-detail-back:hover { background: #eef2ff; }

/* 头部 hero */
.aips-rk-dp-hero {
    display: grid; gap: 24px; align-items: center;
    grid-template-columns: 168px minmax(0, 1fr) 168px;
    background: linear-gradient(135deg, #ffffff, #f5f3ff);
    border: 1px solid #e0e7ff; border-radius: 14px;
    padding: 22px 26px; margin-bottom: 18px;
}
.aips-rk-dp-heroimg { display: flex; align-items: center; justify-content: center; }
.aips-rk-dp-img {
    width: 168px; height: 168px; object-fit: contain;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
}
.aips-rk-dp-img-ph {
    display: flex; align-items: center; justify-content: center;
    font-size: 40px; color: #c4b5fd; background: #f5f3ff;
}
.aips-rk-dp-heromain { min-width: 0; }
.aips-rk-dp-crumb {
    font-size: 12px; color: #6366f1; font-weight: 600;
    display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 6px;
}
.aips-rk-dp-title {
    font-size: 19px; font-weight: 700; color: #1f2937;
    line-height: 1.45; margin: 0 0 10px;
}
.aips-rk-dp-metaline {
    display: flex; flex-wrap: wrap; gap: 8px 18px;
    align-items: center; font-size: 13px; color: #6b7280;
}
.aips-rk-dp-brand strong { color: #1f2937; }
.aips-rk-dp-asinbox { display: inline-flex; align-items: center; }
.aips-rk-dp-pricerow {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px;
}
.aips-rk-dp-price { font-size: 26px; font-weight: 800; color: #4f46e5; }
.aips-rk-dp-rankpill {
    font-size: 12px; font-weight: 600; color: #b45309;
    background: #fef3c7; border-radius: 999px; padding: 4px 12px;
}
.aips-rk-dp-herogauge { display: flex; align-items: center; justify-content: center; }

/* 环形仪表盘 */
.aips-rk-donut { width: 128px; height: 128px; display: block; }
.aips-rk-donut-big { font-size: 30px; font-weight: 800; fill: #1f2937; }
.aips-rk-donut-lbl { font-size: 13px; fill: #9ca3af; }

/* 详情区块 */
.aips-rk-dp-section {
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 12px; padding: 20px 22px; margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.aips-rk-dp-h3 {
    font-size: 15px; font-weight: 700; color: #1f2937;
    margin: 0 0 16px; padding-left: 11px;
    border-left: 4px solid #6366f1; line-height: 1.3;
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px;
}
.aips-rk-dp-h3-extra { font-size: 12px; font-weight: 600; color: #6366f1; }

/* 核心指标网格 */
.aips-rk-dp-metrics {
    display: grid; gap: 14px; grid-template-columns: repeat(5, 1fr);
}
.aips-rk-dp-metric {
    display: flex; flex-direction: column; align-items: center;
    gap: 3px; text-align: center;
    background: #fbfbfe; border: 1px solid #eef0f6;
    border-radius: 12px; padding: 16px 8px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.aips-rk-dp-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, .12);
    border-color: #c7d2fe;
}
.aips-rk-dp-metric-ic {
    font-size: 18px; line-height: 1; margin-bottom: 6px;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #eef2ff; border-radius: 11px;
}
.aips-rk-dp-metric-v { font-size: 17px; font-weight: 800; color: #312e81; word-break: break-word; }
.aips-rk-dp-metric-l { font-size: 11px; color: #9ca3af; }

/* 销量曲线 */
.aips-rk-dp-curvebox { padding: 4px 2px 0; }
.aips-rk-dp-curvesvg { width: 100%; height: auto; display: block; }
/* 柱顶数值标签：用 HTML flex 行（不再用 SVG <text>，避免被主题 CSS 吞掉） */
.aips-rk-dp-barvalues { display: flex; margin-bottom: 6px; }
.aips-rk-dp-barvalues span {
    flex: 1; text-align: center;
    font-size: 13px; font-weight: 700; color: #4f46e5;
    min-height: 17px; line-height: 1.3; white-space: nowrap;
}
/* 峰值月份数值上色金色，跟 SVG 里峰值柱的金色渐变呼应 */
.aips-rk-dp-barvalues span.is-max { color: #b45309; }
/* 柱子 hover 时变深一点，强化「这根能 hover」的可点击感（SVG title 自带 tooltip） */
.aips-rk-dp-curvesvg rect { transition: opacity .15s ease; }
.aips-rk-dp-curvesvg rect:hover { opacity: 0.85; }
.aips-rk-dp-curvecap {
    display: flex; justify-content: space-between;
    font-size: 11px; color: #9ca3af; margin-top: 6px;
}
.aips-rk-dp-curvemonths { display: flex; margin-top: 8px; }
.aips-rk-dp-cm {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; line-height: 1.3;
}
.aips-rk-dp-cm i { font-size: 10px; font-style: normal; color: #9ca3af; }
.aips-rk-dp-cm b { font-size: 12px; font-weight: 700; color: #4b5563; }

/* 评分构成 */
.aips-rk-dp-scorelist { display: flex; flex-direction: column; gap: 10px; }
.aips-rk-dp-scorerow { display: flex; align-items: center; gap: 12px; }
.aips-rk-dp-scorelbl { width: 92px; flex-shrink: 0; font-size: 13px; color: #6b7280; }
.aips-rk-dp-scorebar {
    flex: 1; height: 10px; background: #f3f4f6;
    border-radius: 999px; overflow: hidden;
}
.aips-rk-dp-scorebar i {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #818cf8, #4f46e5);
}
.aips-rk-dp-scoreval {
    width: 44px; flex-shrink: 0; text-align: right;
    font-weight: 700; color: #1f2937; font-size: 13px;
}

/* 流量词 */
.aips-rk-dp-kw { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.aips-rk-dp-kwleft { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 14px; }
.aips-rk-dp-kwcap {
    display: block; font-size: 11px; font-weight: 600;
    color: #9ca3af; margin-bottom: 5px; letter-spacing: .3px;
}
.aips-rk-dp-kwtop1 {
    background: linear-gradient(135deg, #eef2ff, #faf5ff);
    border: 1px solid #e0e7ff; border-radius: 9px; padding: 12px 14px;
}
.aips-rk-dp-kwword { font-size: 16px; font-weight: 700; color: #4338ca; word-break: break-word; }
.aips-rk-dp-kwchipwrap { display: flex; flex-wrap: wrap; gap: 7px; }
.aips-rk-dp-kwchip {
    font-size: 12px; color: #3730a3; background: #eef2ff;
    border: 1px solid #e0e7ff; border-radius: 6px; padding: 4px 10px;
}
.aips-rk-dp-kwshare { flex-shrink: 0; }
.aips-rk-dp-kwshare .aips-rk-donut { width: 116px; height: 116px; }

/* 痛点 / 卖点 */
.aips-rk-dp-proscons { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.aips-rk-dp-pc { border-radius: 10px; padding: 14px 16px; border: 1px solid; }
.aips-rk-dp-pc h4 { margin: 0 0 6px; font-size: 13px; font-weight: 700; }
.aips-rk-dp-pc p { margin: 0; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.aips-rk-dp-pc-pain { background: #fff7ed; border-color: #fed7aa; }
.aips-rk-dp-pc-pain h4 { color: #c2410c; }
.aips-rk-dp-pc-pain p { color: #7c2d12; }
.aips-rk-dp-pc-sell { background: #f0fdf4; border-color: #bbf7d0; }
.aips-rk-dp-pc-sell h4 { color: #15803d; }
.aips-rk-dp-pc-sell p { color: #14532d; }
.aips-rk-dp-pc ul { margin: 0; padding-left: 18px; }
.aips-rk-dp-pc li { font-size: 13px; line-height: 1.7; margin-bottom: 3px; }
.aips-rk-dp-pc-pain li { color: #7c2d12; }
.aips-rk-dp-pc-sell li { color: #14532d; }
.aips-rk-dp-pc-empty { margin: 0; font-size: 13px; color: #9ca3af; }

/* 父体 / 子体数据 */
.aips-rk-dp-kvgrid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.aips-rk-dp-kvcell {
    display: flex; justify-content: space-between; align-items: center;
    background: #f9fafb; border: 1px solid #f0f1f3;
    border-radius: 8px; padding: 10px 14px;
}
.aips-rk-dp-kvcell span { font-size: 12.5px; color: #9ca3af; }
.aips-rk-dp-kvcell strong { font-size: 13.5px; color: #1f2937; font-weight: 700; text-align: right; }

/* v6.5 属性徽章（hero 里：标品类型 / 抛货 / BSR 红利 / 侵权风险 / 季节类型） */
.aips-rk-dp-attrs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.aips-rk-dp-attr {
    font-size: 12px; font-weight: 600; color: #3730a3;
    background: #eef2ff; border: 1px solid #e0e7ff;
    border-radius: 999px; padding: 3px 11px; white-space: nowrap;
    cursor: help;
}
.aips-rk-dp-attrs-toggle {
    font-size: 11px; color: #6366f1; background: none; border: none;
    cursor: pointer; padding: 0 4px; text-decoration: underline; align-self: center;
}
.aips-rk-dp-attrs-toggle:hover { color: #4338ca; }
.aips-rk-dp-attrs-legend {
    display: none; list-style: none; margin: 8px 0 0; padding: 12px 16px;
    background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px;
    font-size: 12.5px; color: #475569; line-height: 1.75;
}
.aips-rk-dp-attrs-legend.is-open { display: block; }
.aips-rk-dp-attrs-legend li { margin: 0 0 5px; }
.aips-rk-dp-attrs-legend li:last-child { margin-bottom: 0; }
.aips-rk-dp-attrs-legend strong { color: #1f2937; }
/* v6.5 AI 推广策略 / 广告策略 文本框 */
.aips-rk-dp-strat {
    background: #f5f3ff; border: 1px solid #e0e7ff;
    border-left: 4px solid #7c3aed; border-radius: 8px;
    padding: 12px 16px; margin-top: 12px;
}
.aips-rk-dp-strat h4 { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: #6d28d9; }
.aips-rk-dp-strat p { margin: 0; font-size: 13px; line-height: 1.7; color: #3730a3; white-space: pre-wrap; }
/* v6.5 非会员锁定钩子 */
.aips-rk-dp-locked { background: #fffbeb; border-color: #fde68a; text-align: center; }
.aips-rk-dp-lockedtext { font-size: 13.5px; color: #92400e; line-height: 1.7; margin: 0 0 14px; }

/* v6.5 流量关键词明细表 */
.aips-rk-kwt-wrap { overflow-x: auto; }
.aips-rk-kwt { width: 100%; border-collapse: collapse; font-size: 13px; }
.aips-rk-kwt th {
    text-align: left; font-size: 12px; color: #6b7280; font-weight: 600;
    padding: 8px 10px; border-bottom: 2px solid #eef2ff; white-space: nowrap;
}
.aips-rk-kwt td { padding: 9px 10px; border-bottom: 1px solid #f3f4f6; color: #374151; white-space: nowrap; }
.aips-rk-kwt-word { font-weight: 600; color: #1f2937; white-space: normal; min-width: 150px; }
.aips-rk-kwt-link { color: #4f46e5; text-decoration: none; }
.aips-rk-kwt-link:hover { text-decoration: underline; color: #4338ca; }
.aips-rk-kwt-ext { font-size: 11px; color: #9ca3af; }
.aips-rk-kwt tbody tr:hover { background: #fafaff; }
.aips-rk-kwt-tier { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.aips-rk-kwt-tier.is-head { background: #dcfce7; color: #15803d; }
.aips-rk-kwt-tier.is-mid { background: #fef3c7; color: #b45309; }
.aips-rk-kwt-tier.is-tail { background: #f3f4f6; color: #6b7280; }

/* v6.5 关键词「流量份额」迷你条形 */
.aips-rk-kwt-barcell { min-width: 120px; }
.aips-rk-kwt-bar { position: relative; height: 18px; background: #eef0f6; border-radius: 5px; overflow: hidden; }
.aips-rk-kwt-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #a5b4fc, #6366f1); border-radius: 5px; }
.aips-rk-kwt-bar span { position: relative; z-index: 1; display: block; text-align: center; line-height: 18px; font-size: 11px; font-weight: 700; color: #1f2937; }

/* v6.5 侵权风险等级配色 */
.aips-rk-dp-risk { display: inline-block; padding: 2px 11px; border-radius: 999px; font-weight: 700; }
.aips-rk-dp-risk.risk-low { background: #dcfce7; color: #15803d; }
.aips-rk-dp-risk.risk-mid { background: #fef3c7; color: #b45309; }
.aips-rk-dp-risk.risk-high { background: #fee2e2; color: #b91c1c; }


/* 详情页移动端 */
@media (max-width: 760px) {
    .aips-rk-dp-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .aips-rk-dp-heromain { width: 100%; }
    .aips-rk-dp-crumb, .aips-rk-dp-metaline,
    .aips-rk-dp-pricerow, .aips-rk-detailpage .aips-rk-pbadges { justify-content: center; }
    .aips-rk-dp-metrics { grid-template-columns: repeat(3, 1fr); }
    .aips-rk-dp-proscons { grid-template-columns: 1fr; }
    .aips-rk-dp-kw { justify-content: center; }
}
@media (max-width: 460px) {
    .aips-rk-dp-metrics { grid-template-columns: repeat(2, 1fr); }
}
