/* Keep both exporters on the opposite edge from editing and remote publishing. */
body #wechat-export-button.social-export-button,
body #xiaohongshu-export-button.social-export-button {
    --social-sticker-angle: 1deg;
    --social-sticker-shape: polygon(0 12%, 12% 0, 100% 16%, 100% 82%, 88% 100%, 3% 91%);
    position: fixed; left: 0; right: auto; bottom: auto;
    width: 48px; height: 44px; padding: 0; border: 0; border-radius: 0;
    box-sizing: border-box; min-height: 0; box-shadow: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--detail-database-color, #a33842); color: #fff;
    clip-path: var(--social-sticker-shape);
    transform: translateX(calc(-100% + 9px)) rotate(var(--social-sticker-angle));
    transform-origin: left center; z-index: 9997; cursor: pointer;
    transition: transform 0.3s ease, background-color 0.18s ease, filter 0.18s ease;
    font-size: 17px;
}
body #wechat-export-button.social-export-button { top: 146px; }
body #xiaohongshu-export-button.social-export-button {
    top: 196px;
    --social-sticker-angle: -1.2deg;
    --social-sticker-shape: polygon(6% 6%, 93% 0, 96% 16%, 100% 34%, 93% 55%, 100% 73%, 98% 88%, 14% 100%, 3% 91%, 0 29%);
}
body #wechat-export-button.social-export-button:is(:hover, :focus-visible),
body #xiaohongshu-export-button.social-export-button:is(:hover, :focus-visible) {
    transform: translateX(0) rotate(var(--social-sticker-angle));
    background: color-mix(in srgb, var(--detail-database-color, #a33842) 82%, #000 18%);
    filter: saturate(1.08);
}
body #wechat-export-button.social-export-button::before,
body #xiaohongshu-export-button.social-export-button > i {
    opacity: 0;
    transition: opacity 0.18s ease 0.06s;
}
body #wechat-export-button.social-export-button:is(:hover, :focus-visible)::before,
body #xiaohongshu-export-button.social-export-button:is(:hover, :focus-visible) > i { opacity: 1; }
body .social-export-button[hidden] { display: none !important; }
body .social-export-button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
@media (prefers-reduced-motion: reduce) {
    body #wechat-export-button.social-export-button,
    body #xiaohongshu-export-button.social-export-button,
    body #wechat-export-button.social-export-button::before,
    body #xiaohongshu-export-button.social-export-button > i { transition: none; }
}
.xhs-dialog { width: min(1240px,96vw); max-width: 96vw; height: 92vh; max-height: 94vh; padding: 0; border: 1px solid #ccd4ce; border-radius: 6px; background: #f0f3f1; color: #25352c; }
.xhs-dialog::backdrop { background: #0008; }
.xhs-dialog .xhs-toolbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px; background: #fff; border-bottom: 1px solid #cdd6d0; }
.xhs-title { margin-right: auto; font-size: 17px; }
.xhs-dialog button,.xhs-dialog select { font: inherit; font-size: 14px; color: #25352c; background: #fff; border: 1px solid #b9c9be; border-radius: 4px; padding: 8px 12px; cursor: pointer; }
.xhs-dialog button:disabled { opacity: .4; cursor: default; }
.xhs-dialog button:focus-visible,.xhs-dialog select:focus-visible { outline: 2px solid #3e756b; outline-offset: 2px; }
.xhs-dialog .xhs-icon { width: 34px; height: 34px; padding: 0; flex-shrink: 0; }
.xhs-status { margin: 12px 16px; font-size: 14px; overflow-wrap: anywhere; }
.xhs-grid { padding: 0 16px 24px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.xhs-card { margin: 0; min-width: 0; border: 2px solid transparent; border-radius: 4px; background: #fff; overflow: hidden; }
.xhs-card.is-selected { border-color: #3e756b; }
.xhs-card[hidden] { display: none; }
.xhs-card label { display: flex; gap: 8px; align-items: center; padding: 10px; font-size: 13px; min-height: 55px; overflow-wrap: anywhere; }
.xhs-card input { width: 17px; height: 17px; flex-shrink: 0; accent-color: #3e756b; }
.xhs-card .xhs-picture { padding: 0; display: block; border: 0; border-radius: 0; width: 100%; background: #121615; aspect-ratio: 3/4; overflow: hidden; }
.xhs-picture img { display: block; width: 100%; height: 100%; object-fit: contain; }
.xhs-card footer { display: flex; padding: 8px; gap: 6px; align-items: center; border-top: 1px solid #e1e7e3; }
.xhs-order { margin-right: auto; font-size: 13px; }
.xhs-lightbox { width: min(900px,96vw); max-height: 92vh; border: 1px solid #ccd4ce; border-radius: 4px; padding: 12px; background: #edf1ee; }
.xhs-lightbox::backdrop { background: #000b; }
.xhs-lightbox button { position: sticky; top: 0; float: right; padding: 10px; cursor: pointer; }
.xhs-lightbox img { width: 100%; display: block; height: auto; }
@media(max-width:760px) { .xhs-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 0 10px 16px; } .xhs-dialog .xhs-toolbar { gap: 7px; padding: 10px; } .xhs-title { flex-basis: calc(100% - 50px); } .xhs-card label { padding: 7px; } }

/* Shared export workspace chrome; exported artwork keeps its own palette. */
.social-export-dialog {
    --export-accent: var(--detail-database-color, #a33842);
    --export-surface: #fff;
    --export-canvas: #f1f3f4;
    --export-ink: #292d31;
    --export-muted: #68717a;
    --export-line: #dce1e5;
    width: min(1240px, 96vw); max-width: 96vw;
    height: 92vh; height: 92dvh; max-height: 94dvh;
    padding: 0; border: 1px solid var(--export-line); border-radius: 8px;
    background: var(--export-surface); color: var(--export-ink);
    box-shadow: 0 20px 70px #0003;
    font: 14px/1.5 Arial, "Microsoft YaHei", sans-serif;
    letter-spacing: 0; overflow: hidden;
}
.social-export-dialog[open] { display: flex; flex-direction: column; }
.social-export-dialog.wechat-dialog { width: min(1000px, 96vw); }
.social-export-dialog::backdrop { background: #11182080; backdrop-filter: blur(3px); }
.social-export-dialog .export-header {
    display: flex; align-items: flex-start; gap: 16px; flex: 0 0 auto;
    padding: 20px 24px 16px; border-top: 3px solid var(--export-accent);
}
.export-heading { flex: 1; min-width: 0; }
.export-heading strong { display: flex; align-items: center; gap: 10px; font-size: 19px; line-height: 1.4; }
.export-heading strong i { color: var(--export-accent); font-size: 20px; }
.social-export-dialog .export-note-title { margin: 5px 0 0; color: var(--export-muted); font-size: 12px; overflow-wrap: anywhere; max-height: 36px; overflow: auto; }
.social-export-dialog .export-toolbar {
    position: static; display: flex; align-items: flex-end; flex-wrap: wrap;
    gap: 12px; flex: 0 0 auto; padding: 0 24px 16px;
    background: var(--export-surface); border-bottom: 1px solid var(--export-line);
}
.export-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; max-width: 100%; margin: 0; }
.export-field > span { color: var(--export-muted); font-size: 12px; }
.social-export-dialog .export-field select { width: 180px; max-width: 100%; }
.social-export-dialog .export-field select, .social-export-dialog .xhs-chapter-picker summary {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23778089' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    padding-right: 32px;
}
.social-export-dialog select:hover { border-color: var(--export-accent); }
.xhs-chapters { flex: 0 0 auto; padding: 12px 24px; border-bottom: 1px solid var(--export-line); }
.xhs-chapter-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 144px; overflow: auto; }
.xhs-chapter { display: flex; align-items: center; gap: 5px; border: 1px solid color-mix(in srgb, var(--chapter-tint) 40%, var(--export-line)); border-radius: 12px; padding: 4px 6px; background: transparent; max-width: 100%; cursor: grab; }
.social-export-dialog button.xhs-chapter-name { background: var(--chapter-tint); color: #182426; border: 0; border-radius: 20px; padding: 5px 12px; min-height: 30px; font-size: 13px; font-weight: 400; cursor: grab; overflow-wrap: anywhere; }
.social-export-dialog button.xhs-chapter-name:hover:not(:disabled) { background: var(--chapter-tint); filter: brightness(1.03); }
.social-export-dialog button.xhs-page-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 3px; min-height: 26px; border: 0; background: transparent; color: var(--export-muted); font-size: 11px; white-space: nowrap; }
.social-export-dialog .xhs-page-badge i { margin: 0; font-size: 8px; }
.xhs-page-menu { position: fixed; z-index: 10; width: 128px; padding: 5px; box-sizing: border-box; background: var(--export-surface); border: 1px solid var(--export-line); border-radius: 6px; box-shadow: 0 6px 20px #0002; }
.social-export-dialog .xhs-page-menu button { display: block; width: 100%; border: 0; text-align: left; min-height: 30px; padding: 4px 8px; font-size: 12px; }
.social-export-dialog .xhs-page-menu button[aria-pressed="true"] { color: var(--export-accent); background: var(--export-canvas); font-weight: 600; }
.xhs-page-menu input { box-sizing: border-box; width: 100%; min-height: 30px; margin-top: 4px; padding: 4px 8px; color: var(--export-ink); background: var(--export-canvas); border: 1px solid var(--export-line); border-radius: 3px; font: inherit; font-size: 12px; }
.social-export-dialog .xhs-chapter-remove { width: 20px; height: 20px; min-height: 20px; padding: 0; line-height: 18px; border-radius: 50%; flex: 0 0 20px; color: var(--export-accent); border: 1px solid color-mix(in srgb, var(--export-accent) 40%, var(--export-line)); background: transparent; }
.social-export-dialog .xhs-chapter-remove i { margin: 0; font-size: 10px; }
.social-export-dialog .xhs-chapter-remove:hover { color: #cf4646; border-color: #cf4646; }
.xhs-chapter-picker { position: relative; width: 180px; max-width: 100%; }
.xhs-chapter-picker summary { display: block; box-sizing: border-box; cursor: pointer; list-style: none; height: 36px; margin: 0; padding: 7px 32px 7px 12px; font: inherit; font-weight: 400; line-height: 20px; color: var(--export-ink); border: 1px solid var(--export-line); border-radius: 4px; background-color: var(--export-surface); }
.xhs-chapter-picker summary::-webkit-details-marker { display: none; }
.xhs-chapter-picker summary::after { content: none; }
.xhs-chapter-picker[open] summary { border-color: var(--export-accent); }
.xhs-chapter-menu { position: absolute; z-index: 5; left: 0; top: calc(100% + 5px); width: 240px; box-sizing: border-box; padding: 5px; border: 1px solid var(--export-line); border-radius: 6px; background: var(--export-surface); box-shadow: 0 6px 20px #0002; }
.xhs-chapter-rows { max-height: none; overflow: visible; }
.xhs-chapter-row { display: flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 3px; }
.xhs-chapter-row:hover { background: var(--export-canvas); }
.social-export-dialog button.xhs-chapter-row-name { flex: 0 1 auto; min-width: 0; min-height: 30px; padding: 3px 0; border: 0; background: transparent; font-size: 13px; font-weight: 400; text-align: left; cursor: pointer; }
.xhs-chapter-moves { display: flex; flex: 0 0 auto; margin-left: auto; gap: 2px; }
.social-export-dialog .xhs-chapter-moves button { width: 20px; height: 28px; min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--export-muted); }
.social-export-dialog .xhs-chapter-moves button i { margin: 0; font-size: 10px; }
.social-export-dialog .xhs-chapter-moves button:not(:disabled) { cursor: pointer; }
.social-export-dialog .xhs-chapter-moves button:not(:disabled):active { cursor: grabbing; }
.social-export-dialog button.xhs-chapter-reset { display: block; width: 100%; padding: 6px 8px; border: 0; border-bottom: 1px solid var(--export-line); border-radius: 0; margin-bottom: 4px; min-height: 32px; text-align: left; font-size: 12px; color: var(--export-muted); }
@media(max-width:760px) { .xhs-chapter-menu { left: auto; right: 0; width: 220px; } }
.xhs-chapter-menu label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px 8px; font-size: 13px; cursor: pointer; border-radius: 3px; }
.xhs-chapter-menu label:hover { background: var(--export-canvas); }
.xhs-chapter-menu input { accent-color: var(--export-accent); width: 16px; height: 16px; flex: 0 0 16px; }
.social-export-dialog .xhs-style[hidden] { display: none; }
.xhs-style-menu label { min-height: 36px; box-sizing: border-box; font-weight: 400; }
.xhs-style-menu input[type="radio"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.xhs-style-menu label:has(input:focus-visible) { outline: 2px solid var(--export-accent); outline-offset: -2px; }
.xhs-style-menu label:has(input:checked) { background: color-mix(in srgb, var(--export-accent) 10%, var(--export-surface)); color: var(--export-accent); }
.xhs-style-picker .xhs-style-menu { left: 0; right: auto; }
.xhs-chapter-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@media(max-width:760px) { .xhs-chapters { padding: 10px; } .xhs-chapter-list { max-height: 116px; } }
.export-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.social-export-dialog button, .social-export-dialog select {
    box-sizing: border-box; min-height: 36px; padding: 7px 12px;
    border: 1px solid var(--export-line); border-radius: 4px;
    font: inherit; line-height: 20px; color: var(--export-ink);
    background: var(--export-surface); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.social-export-dialog button i { margin-right: 5px; }
.social-export-dialog button:hover:not(:disabled) { border-color: var(--export-accent); background: color-mix(in srgb, var(--export-accent) 8%, var(--export-surface)); }
.social-export-dialog button.export-primary { background: var(--export-accent); border-color: transparent; color: var(--export-button-ink, #fff); }
.social-export-dialog button.export-primary:hover:not(:disabled) { background: var(--export-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--export-accent) 15%, transparent); }
.social-export-dialog button:disabled { opacity: .45; cursor: not-allowed; }
.social-export-dialog :is(button, select, input):focus-visible { outline: 2px solid var(--export-accent); outline-offset: 3px; }
.social-export-dialog .export-field select:focus,
.social-export-dialog .xhs-chapter-picker summary:focus,
.social-export-dialog .xhs-chapter-picker[open] summary {
    outline: none;
    border-color: var(--export-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--export-accent) 10%, transparent);
}
.social-export-dialog :is(.export-icon, .xhs-icon) { width: 36px; height: 36px; padding: 0; flex: 0 0 36px; }
.social-export-dialog :is(.export-icon, .xhs-icon) i { margin: 0; }
.social-export-dialog .export-status { flex: 0 0 auto; margin: 0; padding: 10px 24px; font-size: 12px; line-height: 1.6; color: var(--export-muted); background: var(--export-canvas); overflow-wrap: anywhere; max-height: 88px; overflow: auto; }
.wechat-preview-area { flex: 1; min-height: 0; display: flex; justify-content: center; padding: 8px 24px 20px; background: var(--export-canvas); }
.wechat-preview-area iframe { display: block; width: min(510px, 100%); height: 100%; border: 1px solid var(--export-line); background: #fff; box-shadow: 0 3px 14px #0001; }
.social-export-dialog .xhs-grid { flex: 1; min-height: 0; overflow: auto; grid-auto-rows: max-content; align-items: start; align-content: start; padding: 8px 24px 24px; gap: 16px; background: var(--export-canvas); }
.social-export-dialog .xhs-count { font-size: 12px; color: var(--export-muted); white-space: nowrap; }
.social-export-dialog .xhs-card { border: 2px solid var(--export-line); background: var(--export-surface); }
.social-export-dialog .xhs-card.is-selected { border-color: var(--export-accent); }
.social-export-dialog .xhs-card label { min-height: 54px; font-size: 13px; color: var(--export-ink); margin: 0; }
.social-export-dialog .xhs-card input { accent-color: var(--export-accent); }
.social-export-dialog .xhs-card footer { border-color: var(--export-line); align-items: center; }
.social-export-dialog .xhs-order { color: var(--export-muted); font-size: 12px; }
.social-export-dialog .xhs-card.is-selected .xhs-order { color: var(--export-accent); font-weight: 600; }
.social-export-dialog .xhs-picture { padding: 0; border: 0; border-radius: 0; }
:root:not([data-theme="light"]) .social-export-dialog {
    --export-surface: #242527; --export-canvas: #191a1c; --export-ink: #ededee;
    --export-muted: #b1b5bb; --export-line: #404348; color-scheme: dark;
}
@media(max-width:760px) {
    .social-export-dialog .export-header { padding: 14px 14px 12px; }
    .social-export-dialog .export-toolbar { padding: 0 14px 12px; gap: 10px; }
    .social-export-dialog .export-field { flex: 1 1 120px; }
    .social-export-dialog .export-field select, .social-export-dialog .xhs-chapter-picker { width: 100%; }
    .social-export-dialog .export-actions { width: 100%; justify-content: flex-end; }
    .social-export-dialog .export-status { padding: 8px 14px; }
    .wechat-preview-area { padding: 4px 8px 12px; }
    .social-export-dialog .xhs-grid { padding: 4px 10px 16px; gap: 10px; }
    .social-export-dialog .xhs-card footer { flex-wrap: wrap; }
    .social-export-dialog .xhs-order { flex-basis: 100%; }
}
