/* ============================================================
   文件生成/编辑 + 应用生成（Harness 风格卡片）样式
   由 public/craft.js 使用；独立于主站 CSS 变量，保持浅色一致
   ============================================================ */

/* ---- 输入区工具条 ---- */
.craft-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 2px 6px;
    flex-wrap: wrap;
}

.craft-chip {
    border: 1px solid var(--border-light, #e5e7eb);
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1a1a1a);
    border-radius: var(--radius-full, 9999px);
    padding: 3px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition, 0.2s);
    line-height: 1.5;
}
.craft-chip:hover {
    border-color: var(--accent, #4d6bfe);
    background: var(--accent-light, #eef0ff);
}
.craft-note {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    margin-left: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 55%;
}

/* ---- 应用/文件卡片 ---- */
.craft-card {
    background: var(--bg-secondary, #f7f8fa);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    margin: 2px 0;
    font-size: 13px;
    line-height: 1.6;
    min-width: 0;
}

.craft-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-primary, #fff);
    border-bottom: 1px solid var(--border-light, #e5e7eb);
    flex-wrap: wrap;
}

.craft-kind-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: var(--radius-full, 9999px);
    flex-shrink: 0;
}
.craft-kind-badge.app { background: #e8f3ff; color: #1d6fd6; }
.craft-kind-badge.file { background: #fdf0e3; color: #c4701a; }

.craft-card-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary, #1a1a1a);
    word-break: break-all;
    min-width: 0;
    flex: 1;
}

.craft-src-badge {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    border: 1px dashed var(--border-light, #d1d5db);
    border-radius: var(--radius-sm, 8px);
    padding: 0 7px;
    flex-shrink: 0;
}
.craft-src-badge.custom {
    color: #0e7a3c;
    border-color: #9fd9b4;
    background: #eefaf1;
}

.craft-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 0;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
}

.craft-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-top: 1px dashed var(--border-light, #e5e7eb);
    flex-wrap: wrap;
}

.craft-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
    cursor: pointer;
    padding: 3px 9px;
    border-radius: var(--radius-sm, 8px);
    transition: background var(--transition, 0.2s);
    line-height: 1.5;
}
.craft-btn:hover { background: var(--bg-hover, #eaeaee); color: var(--accent, #4d6bfe); }
.craft-btn.primary {
    background: var(--accent-light, #eef0ff);
    color: var(--accent, #4d6bfe);
    font-weight: 600;
}
.craft-btn.danger:hover { color: #c62828; }

.craft-code-wrap {
    position: relative;
    background: #1e1f29;
    color: #e2e2ec;
}
.craft-code {
    margin: 0;
    padding: 10px 12px;
    max-height: 300px;
    overflow: auto;
    font-family: Consolas, "SF Mono", Menlo, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre;
    word-break: normal;
    tab-size: 4;
}
.craft-code:hover::-webkit-scrollbar, .craft-code::-webkit-scrollbar { width: 6px; height: 6px; }
.craft-code::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 3px; }

.craft-preview {
    display: none;
    background: #fff;
}
.craft-preview iframe {
    width: 100%;
    height: 420px;
    border: 0;
    display: block;
    background: #fff;
}
.craft-preview .craft-preview-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 11px;
    color: #6b7280;
    background: #f0f1f3;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}
.craft-card.view-preview .craft-code-wrap { display: none; }
.craft-card.view-preview .craft-preview { display: block; }
.craft-card.view-code .craft-preview { display: none; }
.craft-card.view-code .craft-code-wrap { display: block; }

/* 修改面板 */
.craft-edit-panel { display: none; padding: 8px 12px; border-top: 1px dashed var(--border-light, #e5e7eb); }
.craft-edit-panel.open { display: block; }
.craft-edit-panel textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 58px;
    color: var(--text-primary, #1a1a1a);
    background: var(--bg-primary, #fff);
}
.craft-edit-actions { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.craft-edit-tip { font-size: 11px; color: var(--text-muted, #9ca3af); margin-left: auto; }

.craft-card-foot {
    padding: 4px 12px 8px;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    line-height: 1.7;
}
.craft-card-foot .craft-paid-note { color: #b26a00; }

/* ---- 生成中占位 ---- */
.craft-pending {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    color: var(--text-secondary, #6b7280);
    font-size: 13px;
}
.craft-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--accent-light, #eef0ff);
    border-top-color: var(--accent, #4d6bfe);
    border-radius: 50%;
    animation: craftSpin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes craftSpin { to { transform: rotate(360deg); } }

/* ---- 弹窗（生成 / API 设置） ---- */
.craft-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.craft-modal {
    background: var(--bg-primary, #fff);
    border-radius: var(--radius-lg, 16px);
    width: 520px;
    max-width: 96vw;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}
.craft-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light, #e5e7eb);
    font-weight: 600;
    font-size: 15px;
}
.craft-x {
    border: none;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted, #9ca3af);
    padding: 2px 8px;
    border-radius: 8px;
}
.craft-x:hover { background: var(--bg-hover, #eaeaee); color: var(--text-primary, #1a1a1a); }
.craft-modal-body { padding: 14px 18px 18px; }

.craft-kind-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.craft-kind-row label {
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
}
.craft-kind-row label:has(input:checked) {
    border-color: var(--accent, #4d6bfe);
    background: var(--accent-light, #eef0ff);
    color: var(--accent, #4d6bfe);
    font-weight: 600;
}
.craft-tip {
    background: var(--bg-secondary, #f7f8fa);
    border: 1px dashed var(--border-light, #d1d5db);
    border-radius: var(--radius-sm, 8px);
    padding: 7px 10px;
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 10px;
    line-height: 1.7;
}
.craft-modal-body textarea#craftSpec {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    color: var(--text-primary, #1a1a1a);
}
.craft-modal-body textarea#craftSpec:focus {
    outline: none;
    border-color: var(--accent, #4d6bfe);
}

/* ---- 文件模式：上传本地文件修改 ---- */
.craft-fmode {
    margin-bottom: 4px;
}
.craft-upload {
    border: 1px dashed var(--border-light, #d1d5db);
    border-radius: var(--radius-sm, 8px);
    padding: 10px;
    background: var(--bg-secondary, #fafbfc);
}
.craft-upload-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.craft-file-meta {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    word-break: break-all;
    flex: 1;
    min-width: 140px;
}
.craft-modal-body textarea.craft-ta {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    margin-top: 10px;
    color: var(--text-primary, #1a1a1a);
}
.craft-modal-body textarea.craft-ta:focus {
    outline: none;
    border-color: var(--accent, #4d6bfe);
}
.craft-upload .btn.primary-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.craft-act-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.craft-hint { font-size: 11px; color: var(--text-muted, #9ca3af); }
.craft-error { margin-top: 8px; font-size: 12px; color: #c62828; white-space: pre-wrap; }
.craft-ok { margin-top: 8px; font-size: 12px; color: #2e7d32; }

/* 示例快捷输入 */
.craft-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.craft-example {
    border: 1px solid var(--border-light, #e5e7eb);
    background: var(--bg-secondary, #f7f8fa);
    color: var(--text-secondary, #6b7280);
    border-radius: var(--radius-full, 9999px);
    padding: 3px 11px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition, 0.2s);
}
.craft-example:hover {
    border-color: var(--accent, #4d6bfe);
    color: var(--accent, #4d6bfe);
    background: var(--accent-light, #eef0ff);
}

/* API 设置 */
.craft-api-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.craft-api-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
}
.craft-api-row label:has(input:checked) {
    border-color: var(--accent, #4d6bfe);
    background: var(--accent-light, #eef0ff);
}
.craft-api-row .api-desc { color: var(--text-muted, #9ca3af); font-size: 12px; }
.craft-field { display: block; margin: 8px 0; font-size: 12px; color: var(--text-secondary, #6b7280); }
.craft-field input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text-primary, #1a1a1a);
}
.craft-field input:focus { outline: none; border-color: var(--accent, #4d6bfe); }
.craft-act-row .btn {
    border: none;
    border-radius: var(--radius-sm, 8px);
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
}
.craft-act-row .btn.primary-btn { background: var(--accent, #4d6bfe); color: #fff; }
.craft-act-row .btn.primary-btn:hover { background: var(--accent-hover, #3b55e0); }
.craft-act-row .btn.ghost-btn { background: var(--bg-secondary, #f0f1f3); color: var(--text-secondary, #6b7280); }
.craft-act-row .btn.ghost-btn:hover { background: var(--bg-hover, #eaeaee); }
.craft-sec-note { margin-top: 10px; font-size: 11px; color: var(--text-muted, #9ca3af); line-height: 1.7; }

/* ---- 深度思考：思考过程（浅色）置顶，输出在其下 ---- */
.reasoning-box {
    background: var(--bg-secondary, #f7f8fa);
    border: 1px dashed #d7dce8;
    border-left: 3px solid #b9c2d4;
    border-radius: var(--radius-sm, 8px);
    padding: 6px 12px 8px;
    margin: 0 0 8px;
    max-width: 100%;
}
.reasoning-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7688;
    padding-bottom: 4px;
}
.reasoning-cost {
    font-size: 11px;
    font-weight: 400;
    color: #a0a9b8;
    margin-left: auto;
    flex-shrink: 0;
}
.reasoning-text {
    font-size: 12.5px;
    line-height: 1.75;
    color: #8a93a6;               /* 浅色思考文字 */
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 340px;
    overflow-y: auto;
}
.reasoning-text::-webkit-scrollbar { width: 6px; }
.reasoning-text::-webkit-scrollbar-thumb { background: #d5dae4; border-radius: 3px; }

/* ---- 自定义 API 的 token 消耗提示 ---- */
.usage-line {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    text-align: right;
    user-select: text;
}

/* ---- 深度思考开关（输入区工具条） ---- */
.craft-chip.dt-on {
    background: var(--accent-light, #eef0ff);
    border-color: var(--accent, #4d6bfe);
    color: var(--accent, #4d6bfe);
    font-weight: 600;
}
.craft-chip.dt-busy { opacity: 0.6; cursor: progress; }

/* ---- 输入框左侧「＋」全部技能 ---- */
.skills-btn {
    color: var(--text-secondary, #6b7280);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}
.skills-btn:hover { color: var(--accent, #4d6bfe); }

.skills-menu {
    position: fixed;
    z-index: 400;
    width: 272px;
    max-width: calc(100vw - 16px);
    box-sizing: border-box;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.skills-menu-title {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    padding: 6px 10px 4px;
    letter-spacing: 0.3px;
}
.skills-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: transparent;
    padding: 9px 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary, #1a1a1a);
    transition: background var(--transition, 0.2s);
}
.skills-item:hover { background: var(--bg-hover, #eaeaee); }
.skills-item-icon { font-size: 16px; line-height: 1.5; width: 24px; text-align: center; flex-shrink: 0; }
.skills-item-main { display: flex; flex-direction: column; line-height: 1.45; min-width: 0; }
.skills-item-name { font-weight: 600; }
.skills-item-desc { font-size: 11px; color: var(--text-muted, #9ca3af); }

/* 触屏设备技能项更大更好点 */
@media (pointer: coarse) {
    .skills-item { min-height: 46px; }
}

/* ============================================================
   视频生成 & 提示词优化
   ============================================================ */
.video-sec-row {
    display: flex;
    gap: 10px;
    margin: 8px 0;
}

/* 模型选择 chips */
.video-model-row { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; }
.video-model-title { font-size: 12px; font-weight: 600; color: var(--text-secondary, #6b7280); }
.video-model-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-light, #e5e7eb);
    background: var(--bg-primary, #fff);
    border-radius: var(--radius-sm, 8px);
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    color: var(--text-primary, #1a1a1a);
    cursor: pointer;
    transition: all var(--transition, 0.2s);
}
.video-model-chip:hover { border-color: var(--accent, #4d6bfe); }
.video-model-chip.on {
    border-color: var(--accent, #4d6bfe);
    background: var(--accent-light, #eef0ff);
    color: var(--accent, #4d6bfe);
    font-weight: 600;
}
.video-model-tag {
    margin-left: auto;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted, #9ca3af);
    border: 1px dashed var(--border-light, #d1d5db);
    border-radius: 9999px;
    padding: 1px 8px;
    flex-shrink: 0;
}
.video-model-chip.on .video-model-tag { color: var(--accent, #4d6bfe); border-color: var(--accent, #4d6bfe); }
#videoImgRow .craft-btn.primary { background: var(--accent, #4d6bfe); color: #fff; }

/* 图生视频：图片上传行（必填时高亮，避免用户找不到） */
.video-img-row {
    border: 1px dashed var(--border-light, #d1d5db);
    border-radius: var(--radius-sm, 8px);
    padding: 8px 10px;
    margin: 6px 0;
    background: var(--bg-secondary, #fafbfc);
}
.video-img-row.need {
    border-color: #e6a23c;
    border-style: solid;
    background: #fff8ec;
}
.video-img-row.need #videoImgBtn {
    background: #e6a23c;
    color: #fff;
}
.video-img-preview {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-light, #e5e7eb);
    flex-shrink: 0;
}

/* ===== 视频解析（无水印下载）===== */
.parse-modal { max-width: 620px; }
.parse-result { margin-top: 10px; }
.parse-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.parse-cover {
    width: 96px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-light, #e5e7eb);
    background: var(--bg-secondary, #f7f8fa);
    flex-shrink: 0;
}
.parse-meta { min-width: 0; }
.parse-platform {
    display: inline-block;
    font-size: 11px;
    color: var(--accent, #4d6bfe);
    border: 1px solid var(--accent, #4d6bfe);
    border-radius: 9999px;
    padding: 0 8px;
    margin-bottom: 4px;
}
.parse-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    line-height: 1.4;
    word-break: break-all;
}
.parse-author { font-size: 12px; color: var(--text-secondary, #6b7280); margin-top: 2px; }
.parse-tier-sub {
    margin-left: auto;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted, #9ca3af);
    flex-shrink: 0;
}
.video-model-chip.on .parse-tier-sub { color: var(--accent, #4d6bfe); }
.parse-preview {
    width: 100%;
    max-height: 260px;
    margin: 8px 0;
    border-radius: 8px;
    background: #000;
    display: block;
}

/* 平台登录 / 人工验证引导 */
.parse-login {
    margin-top: 10px;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    padding: 10px 12px;
    background: var(--bg-secondary, #fafbfc);
}
.parse-platform-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.parse-plat {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    padding: 6px 10px;
    background: var(--bg-primary, #fff);
    font-size: 12px;
}
.parse-plat.on { border-color: var(--accent, #4d6bfe); background: var(--accent-light, #eef0ff); }
.parse-plat-name { font-weight: 600; color: var(--text-primary, #1a1a1a); flex-shrink: 0; }
.parse-plat-state {
    color: var(--text-secondary, #6b7280);
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.parse-verify-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    padding: 8px 10px;
    border: 1px solid #e6a23c;
    border-radius: 8px;
    background: #fff8ec;
}
.parse-steps { margin: 8px 0; }
.parse-step { font-size: 12px; color: var(--text-secondary, #6b7280); line-height: 1.7; }
.parse-step b {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    background: var(--accent, #4d6bfe);
    color: #fff;
    font-size: 11px;
    margin-right: 4px;
}
.parse-step code {
    background: var(--bg-secondary, #f2f3f5);
    border-radius: 4px;
    padding: 0 4px;
    font-size: 11px;
}
.parse-bm-row { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; }
.parse-bm-row code {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    background: var(--bg-secondary, #f2f3f5);
    border-radius: 4px;
    padding: 4px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 站内扫码登录 */
.parse-qr {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 10px 0;
    padding: 12px;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 10px;
    background: var(--bg-primary, #fff);
}
.parse-qr-img {
    position: relative;
    width: 168px;
    height: 168px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.parse-qr-img img { width: 100%; height: 100%; display: block; }
.parse-qr-mask {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--text-secondary, #6b7280);
    font-size: 12px;
    text-align: center;
    padding: 8px;
}
.parse-qr-side { flex: 1 1 auto; min-width: 0; }
.parse-qr-title { font-size: 14px; font-weight: 600; color: var(--text-primary, #1a1a1a); margin-bottom: 8px; }
.parse-qr-steps { font-size: 12px; color: var(--text-secondary, #6b7280); line-height: 1.9; }
.parse-qr-steps b { color: var(--accent, #4d6bfe); }
.parse-qr-state { margin-top: 8px; font-size: 12px; color: var(--accent, #4d6bfe); }
.parse-fallback { margin-top: 8px; border-top: 1px dashed var(--border-light, #e5e7eb); padding-top: 8px; }
.parse-fold {
    background: none;
    border: none;
    color: var(--text-muted, #9ca3af);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 0;
    font-family: inherit;
}
.parse-fold:hover { color: var(--accent, #4d6bfe); }

/* 一键同步登录 */
.parse-sync {
    margin: 8px 0;
    padding: 10px 12px;
    border: 1px solid var(--accent, #4d6bfe);
    border-radius: 8px;
    background: var(--accent-light, #eef0ff);
}
.parse-sync-title { font-size: 13px; font-weight: 600; color: var(--accent, #4d6bfe); margin-bottom: 6px; }
.parse-bm-drag {
    display: inline-block;
    margin: 2px 0 2px 4px;
    padding: 2px 10px;
    border-radius: 6px;
    background: var(--accent, #4d6bfe);
    color: #fff !important;
    font-size: 12px;
    text-decoration: none;
    cursor: grab;
    border: 1px solid var(--accent, #4d6bfe);
}
.parse-bm-drag:active { cursor: grabbing; }

/* 自定义人设 */
.persona-modal { max-width: 560px; }
.persona-opt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin: 8px 0;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    background: var(--bg-primary, #fff);
    transition: all .2s;
}
.persona-opt:hover { border-color: var(--accent, #4d6bfe); }
.persona-opt.on {
    border-color: var(--accent, #4d6bfe);
    background: var(--accent-light, #eef0ff);
}
.persona-opt input { width: auto; margin-top: 3px; flex-shrink: 0; }
.persona-opt-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.persona-opt-main b { font-size: 13px; color: var(--text-primary, #1a1a1a); }
.persona-opt-desc { font-size: 12px; color: var(--text-secondary, #6b7280); line-height: 1.5; }
.persona-opt.on .persona-opt-main b { color: var(--accent, #4d6bfe); }
.video-sec-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    padding: 7px 16px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
}
.video-sec-row label:has(input:checked) {
    border-color: var(--accent, #4d6bfe);
    background: var(--accent-light, #eef0ff);
    color: var(--accent, #4d6bfe);
    font-weight: 600;
}
.craft-modal-body textarea#videoPrompt,
.craft-modal-body textarea#poInput,
.craft-modal-body textarea#poOut {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    color: var(--text-primary, #1a1a1a);
    margin: 4px 0;
}
/* 聊天里的视频气泡 */
.msg-video {
    display: block;
    max-width: 320px;
    width: 100%;
    border-radius: var(--radius-sm, 10px);
    margin-top: 4px;
    background: #000;
}
@media (max-width: 480px) {
    .msg-video { max-width: 240px; }
    .video-sec-row label { flex: 1; justify-content: center; }
}

/* ============================================================
   简历助手（职业模板向导 + 简历卡片）
   ============================================================ */
.resume-tpl-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    margin: 10px 0 6px;
}
.resume-tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
    margin-bottom: 6px;
}
.resume-tpl-chip {
    border: 1px solid var(--border-light, #e5e7eb);
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1a1a1a);
    border-radius: var(--radius-sm, 8px);
    padding: 8px 6px;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition, 0.2s);
    font-family: inherit;
    white-space: normal;
    line-height: 1.35;
}
.resume-tpl-chip:hover { border-color: var(--accent, #4d6bfe); }
.resume-tpl-chip.on {
    border-color: var(--accent, #4d6bfe);
    background: var(--accent-light, #eef0ff);
    color: var(--accent, #4d6bfe);
    font-weight: 600;
}
.resume-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
}
.resume-fields .craft-field:nth-child(n+6) { grid-column: 1 / -1; }
.resume-modal .craft-modal-body { max-height: calc(88vh - 120px); overflow-y: auto; }
.craft-modal-body .resume-fields textarea.craft-ta { margin-top: 4px; }

/* 简历：示例填入行 & 潦草内容选项确认弹窗 */
#resumeExampleState { font-size: 11px; color: var(--text-muted, #9ca3af); word-break: break-all; }
.resume-review .craft-modal-body { max-height: calc(90vh - 140px); overflow-y: auto; }
.rr-q {
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-sm, 10px);
    padding: 10px 12px;
    margin: 10px 0;
}
.rr-q-head {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 6px;
}
.rr-q-orig {
    display: block;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    margin: 2px 0 8px;
    white-space: pre-wrap;
    word-break: break-all;
}
.rr-opt {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    margin: 3px 0;
}
.rr-opt:hover { background: var(--bg-hover, #eaeaee); }
.rr-opt:has(input:checked) {
    border-color: var(--accent, #4d6bfe);
    background: var(--accent-light, #eef0ff);
}
.rr-opt input { margin-top: 3px; flex-shrink: 0; }
.rr-opt-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rr-opt-title { font-size: 12.5px; font-weight: 600; color: var(--accent, #4d6bfe); }
.rr-opt:not(:has(input:checked)) .rr-opt-title { color: var(--text-secondary, #6b7280); }
.rr-opt-content {
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.7;
}
.rr-custom {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 4px 26px;
    max-width: calc(100% - 26px);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary, #1a1a1a);
}
@media (max-width: 560px) {
    .rr-custom { margin-left: 0; max-width: 100%; }
}

/* 简历卡片正文 */
.craft-resume-body {
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    border-top: 1px solid var(--border-light, #e5e7eb);
    border-bottom: 1px solid var(--border-light, #e5e7eb);
    padding: 4px 2px;
}
.craft-resume-body::-webkit-scrollbar { width: 6px; }
.craft-resume-body::-webkit-scrollbar-thumb { background: #d5dae4; border-radius: 3px; }
.resume-sheet {
    padding: 4px 12px 12px;
    font-size: 13px;
    line-height: 1.8;
    color: #333;
}
.resume-sheet h1 {
    font-size: 20px;
    color: #1e293b;
    border-bottom: 2px solid var(--accent, #4d6bfe);
    padding-bottom: 4px;
    margin: 6px 0 10px;
}
.resume-sheet h2 {
    font-size: 14px;
    color: var(--accent, #4d6bfe);
    border-left: 3px solid var(--accent, #4d6bfe);
    padding-left: 8px;
    margin: 14px 0 4px;
}
.resume-sheet p { margin: 4px 0; }
.resume-sheet ul, .resume-sheet ol { margin: 4px 0; padding-left: 20px; }
.resume-sheet li { margin: 2px 0; }
.resume-sheet hr { border: none; border-top: 1px dashed var(--border-light, #d1d5db); margin: 10px 0; }
.craft-card.craft-resume .craft-code-wrap,
.craft-card.craft-resume .craft-preview { display: none; }

@media (max-width: 560px) {
    .resume-fields { grid-template-columns: 1fr; }
    .resume-tpl-grid { grid-template-columns: repeat(auto-fill, minmax(46%, 1fr)); }
    .craft-resume-body { max-height: 340px; }
}

/* 移动端适配 */
@media (max-width: 820px) {
    .craft-note { max-width: 100%; margin-left: 0; width: 100%; }
    .craft-preview iframe { height: 46vh; }
    .craft-card { font-size: 12px; }
}

/* ============================================================
   手机端 / 异形屏 / 不同分辨率适配（窄屏弹窗底部抽屉、防 iOS 缩放、
   更宽触控目标、工具条与卡片排版）
   ============================================================ */
.craft-act-row { flex-wrap: wrap; }

@media (max-width: 820px) {
    /* 生成 / API 设置弹窗：改为底部抽屉，内容可滚动，贴安全区 */
    .craft-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .craft-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 18px 18px 0 0;
        max-height: 90dvh;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    }
    .craft-modal-head { padding: 13px 16px; }
    .craft-modal-body { padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px)); }

    /* 防 iOS 自动放大：弹窗内输入一律 16px */
    .craft-modal-body textarea,
    .craft-modal-body input,
    .craft-field input {
        font-size: 16px;
    }
    .craft-field { margin: 10px 0; }

    .craft-kind-row label,
    .craft-api-row label {
        flex: 1 1 auto;
        min-width: 0;
    }
    .craft-edit-actions { flex-wrap: wrap; }
    .craft-card-meta { flex-wrap: wrap; gap: 4px 10px; }
    .reasoning-text { max-height: 240px; }
}

@media (max-width: 480px) {
    /* 窄屏下分类选项单列，避免挤压 */
    .craft-kind-row { flex-direction: column; align-items: stretch; }
    .craft-kind-row label { width: 100%; box-sizing: border-box; }
    .craft-modal-head { font-size: 14px; }

    /* 工具条芯片等宽换行，状态提示单独占一行 */
    .craft-tools { gap: 6px; }
    .craft-chip { padding: 5px 10px; }

    .craft-example { max-width: 100%; white-space: normal; text-align: left; }
    .craft-upload-bar { align-items: flex-start; }
    .craft-file-meta { min-width: 0; width: 100%; }
    .craft-code { font-size: 11px; max-height: 240px; }
    .craft-preview-bar { flex-wrap: wrap; }
    .craft-act-row .btn { flex: 1 1 auto; text-align: center; }
}

/* 横屏矮屏：预览与弹窗都控制高度 */
@media (max-height: 560px) and (min-width: 481px) {
    .craft-modal { max-height: 94dvh; }
    .craft-preview iframe { height: 44dvh; }
}

/* 大屏 / 高分屏：卡片代码区上限略高，弹窗居中不贴边 */
@media (min-width: 1400px) {
    .craft-preview iframe { height: 560px; }
    .craft-code { max-height: 380px; }
}

/* 触屏设备：按钮/标签最小触控高度，避免误触 */
@media (pointer: coarse) {
    .craft-chip,
    .craft-btn,
    .craft-example,
    .craft-x {
        min-height: 34px;
    }
    .craft-act-row .btn { min-height: 38px; }
}
