.refmedia { box-sizing: border-box; color: #ececf2; font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif; }
.media-custom-count { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4539rem; padding: 0.6809rem; font-size: 0.6875rem; color: #b9bdc8; }
.media-custom-count input { width: 5.1064rem; min-width: 0; padding: 0.3972rem; border: 1px solid #ffffff20; border-radius: 0.3404rem; background: #0003; color: #eee; }
.media-custom-count button { margin-left: auto; padding: 0.3972rem 0.6809rem; border: 1px solid #ffffff20; border-radius: 0.3404rem; color: #eee; background: #ffffff0c; }
body.media-mode #asset-library-open { display: none; }
.refmedia *, .refmedia *::before, .refmedia *::after { box-sizing: border-box; }
.refmedia[hidden], .refmedia [hidden], .refmedia-camera-tags[hidden] { display: none !important; }
.refmedia .refmedia-icon { display: block; width: 1.0213rem; height: 1.0213rem; flex: 0 0 auto; pointer-events: none; }
.refmedia button { font: inherit; -webkit-tap-highlight-color: transparent; }
.refmedia button:disabled { opacity: .4; cursor: not-allowed; }
.refmedia-close { display: grid; place-items: center; width: 1.8746rem; height: 1.8746rem; padding: 0.2837rem; border-radius: 0.4539rem; background: transparent; color: #9395a4; }
.refmedia-close:hover { color: #fff; background: #ffffff0b; }
.refmedia.refmedia-camera.modal { display: flex; flex-direction: column; width: min(1128px,calc(100vw - 1.8156rem)); height: min(55.7704rem,calc(100dvh - 1.8156rem)); padding: 0; overflow: hidden; border: 1px solid #ffffff14; border-radius: 1rem; background: linear-gradient(145deg,#191b24,#12131b); }
.refmedia-camera-head { display: flex; flex: 0 0 3.8067rem; align-items: center; gap: 1rem; height: 3.8067rem; padding: 0.875rem 1.125rem; border-bottom: 1px solid #ffffff0d; }
.refmedia-camera-title { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 0.5rem; white-space: nowrap; }
.refmedia-camera-title .refmedia-icon { width: 0.9078rem; height: 0.9078rem; stroke-width: 3; color: #fb923c; }
.refmedia-camera.modal h2 { margin: 0; font-size: 0.9375rem; font-weight: 600; line-height: 1.5; }
.refmedia-camera-maximum { padding: 1.10156px 0.4375rem; border-radius: 999px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.45); font-size: 0.6875rem; line-height: 1.5; }
.refmedia-camera-head .refmedia-close { flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 0.5rem; background: rgba(255,255,255,.05); }
.refmedia-camera-categories { display: flex; gap: 0.375rem; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.refmedia-camera-categories button { flex: 0 0 auto; height: 1.75rem; padding: 0.3125rem 0.75rem; border: 0; border-radius: 999px; background: transparent; color: rgba(255,255,255,.6); font-size: 0.75rem; line-height: 1.5; white-space: nowrap; }
.refmedia-camera-categories button[aria-selected="true"] { color: rgb(253,186,116); background: rgba(249,115,22,.18); }
.refmedia-camera-body { min-height: 0; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; padding: 1rem 1.125rem; scrollbar-width: thin; }
.refmedia-camera-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0.875rem; }
.refmedia-camera-card { position: relative; min-width: 0; height: 13.1844rem; padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 0.75rem; background: rgba(255,255,255,.03); text-align: left; transition: border-color .2s,box-shadow .2s,transform .2s; }
.refmedia-camera-card:hover { transform: translateY(-0.1135rem); border-color: #f9731655; }
.refmedia-camera-card.is-selected { border-color: #f97316; box-shadow: inset 0 0 0 1px #f9731630; }
.refmedia-camera-image { position: relative; width: 100%; aspect-ratio: 3 / 2; background: #080911; overflow: hidden; }
.refmedia-camera-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.refmedia-camera-category { position: absolute; right: 0.5rem; bottom: 0.5rem; padding: 1.10156px 0.375rem; border-radius: 999px; background: rgba(0,0,0,.55); color: rgba(255,255,255,.8); font-size: 0.625rem; line-height: 1.5; }
.refmedia-camera-check { display: grid; place-items: center; position: absolute; top: 0.5106rem; right: 0.5106rem; width: 1.2482rem; height: 1.2482rem; border: 1px solid #fed7aa; border-radius: 50%; background: #f97316; color: #fff; }
.refmedia-camera-check .refmedia-icon { width: 0.7943rem; height: 0.7943rem; }
.refmedia-camera-copy { padding: 0; }
.refmedia-camera-copy strong { display: block; overflow: hidden; padding: 0.5rem 0.625rem 0.125rem; color: #e6e8f1; font-size: 0.8125rem; font-weight: 600; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.refmedia-camera-copy p { display: block; overflow: hidden; margin: 0; padding: 0 0.625rem 0.625rem; color: rgba(255,255,255,.45); font-size: 0.6875rem; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.refmedia-camera-empty { grid-column: 1 / -1; padding: 3.4043rem 0.5674rem; color: #999aaa; text-align: center; }
.refmedia-camera-footer { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 1rem; flex: 0 0 4.7137rem; height: 4.7137rem; padding: 0.75rem 1.125rem; border-top: 1px solid #ffffff13; background: #12141dec; }
.refmedia-camera-footer-left { min-width: 0; }
.refmedia-camera-selection { display: flex; align-items: center; gap: 0.6809rem; color: #b8bbc9; font-size: 0.75rem; }
.refmedia-camera-selection > span { flex: 0 0 auto; }
.refmedia-camera-selected { display: flex; gap: 0.4539rem; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.refmedia-camera-selected button { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 0.3404rem; max-width: 10.2128rem; padding: 0.1702rem 0.3972rem 0.1702rem 0.1702rem; border: 1px solid #f9731640; border-radius: 0.3404rem; background: #f9731615; color: #fdba74; font-size: 0.6241rem; }
.refmedia-camera-selected img { width: 1.7021rem; height: 1.4184rem; object-fit: cover; border-radius: 0.227rem; }
.refmedia-camera-selected .refmedia-icon { width: 0.6809rem; height: 0.6809rem; }
.refmedia-camera-none { color: rgba(255,255,255,.4); font-size: 0.6875rem; }
.refmedia-camera-tip { margin: 0.3125rem 0 0; color: rgba(255,255,255,.4); font-size: 0.6875rem; line-height: 1.5; }
.refmedia-camera-tip:has(#refmedia-camera-status:not(:empty)) .refmedia-camera-guide { display: none; }
.refmedia-camera-footer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.5106rem; }
#refmedia-camera-status { flex: 1; min-width: 0; color: #e8b066; font-size: 0.6809rem; }
.refmedia-button { min-width: 4.9929rem; height: 2.156rem; padding: 0.4539rem 1.1348rem; border: 1px solid #ffffff1b; border-radius: 0.3972rem; font-size: 0.75rem !important; color: #bfc2d0; }
.refmedia-button.secondary { background: #ffffff08; }
.refmedia-button.primary { border-color: #f9731666; background: #f97316; color: #fff; }

.refmedia.refmedia-scan.modal { display: flex; flex-direction: column; width: min(23rem,calc(100vw - 1.3617rem)); min-height: 29.5532rem; max-height: calc(100dvh - 1.3617rem); padding: 1.25rem; overflow-y: auto; border: 1px solid #ffffff17; border-radius: 1rem; background: linear-gradient(145deg,#1a1c25,#12141c); }
.refmedia-scan-head { display: flex; align-items: flex-start; gap: 0.6241rem; }
.refmedia-scan-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 2.5rem; height: 2.5rem; border: 1px solid #00cae030; border-radius: 0.6241rem; color: #2ccade; background: #00cae015; }
.refmedia-scan-symbol .refmedia-icon { width: 1.4184rem; height: 1.4184rem; }
.refmedia-scan.modal h2 { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.4; }
.refmedia-scan-head p { margin: 0.3972rem 0 0; color: #979dad; font-size: 0.6875rem; line-height: 1.7; }
.refmedia-scan-head .refmedia-close { flex: 0 0 auto; width: 1.5319rem; height: 1.5319rem; margin: -0.3972rem -0.3972rem 0 0; }
.refmedia-scan-frame { display: grid; place-items: center; flex: 0 0 auto; width: min(15.5rem,100%); aspect-ratio: 1; margin: 1.375rem auto 0; padding: 0.75rem; border: 1px solid #ffffff0d; border-radius: 0.6809rem; background: #fff; }
.refmedia-scan-frame.is-ready { background: #fff; }
.refmedia-scan-frame p { max-width: 11.9149rem; margin: 0; font-size: 0.75rem; line-height: 1.7; color: #687287; text-align: center; }
.refmedia-scan-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.refmedia-scan-meta { display: flex; justify-content: space-between; gap: 0.6809rem; margin-top: 0.875rem; color: #9198a8; font-size: 0.6875rem; }
.refmedia-scan-safety { margin: auto 0 0 !important; padding-top: 1.125rem; color: #9096a6; font-size: 0.6875rem; line-height: 1.7; }

/* Inline motion tokens measured in the reference editor. */
.refmedia-prompt-source-hidden { display:none!important; }
.refmedia-rich-input { white-space:pre-wrap; overflow-wrap:break-word; cursor:text; overflow-y:auto; font:inherit; }
.refmedia-rich-input[data-empty="true"]::before { content:attr(data-placeholder); color:#60696e; pointer-events:none; }
.refmedia-rich-input .inline-tag { display:inline-flex; align-items:center; gap:.3125rem; margin:0 .125rem; padding:.0625rem .375rem .0625rem .3125rem; border:1px solid rgba(249,115,22,.45); border-radius:.25rem; background:rgba(249,115,22,.14); color:#fdba74; font-size:.8125rem; line-height:1.5; vertical-align:middle; cursor:pointer; }
.refmedia-rich-input .tag-yunjing-icon { display:block; flex:0 0 auto; width:1.125rem; height:1.125rem; border-radius:.1875rem; color:#fb923c; }
.refmedia-rich-input .tag-yunjing-icon svg { width:12px; height:12px; }
.refmedia-rich-input .tag-content { font-weight:500; }
.refmedia-camera-selected { flex-wrap:wrap; overflow:visible; gap:.375rem; }
.refmedia-selected-chip { display:flex; align-items:center; flex:none; gap:.25rem; padding:.1875rem .375rem .1875rem .5625rem; border:1px solid rgba(249,115,22,.45); border-radius:999px; background:rgba(249,115,22,.16); color:#fdba74; font-size:.75rem; line-height:1.5; }
.refmedia-camera-selected .refmedia-selected-chip button { display:flex; width:auto; height:auto; max-width:none; padding:.0625rem; border:0; border-radius:50%; background:transparent; color:#fdba74; }
.refmedia-selected-chip button .refmedia-icon { width:11px; height:11px; stroke-width:5.236363636363635; }
.refmedia-camera-count { display: grid; place-items: center; position: absolute; top: -0.227rem; right: -0.227rem; min-width: 0.9078rem; height: 0.9078rem; padding: 0 0.1702rem; border: 1px solid #6d42a4; border-radius: 50%; background: #a86be0; color: #fff; font-size: 0.5674rem; font-style: normal; }
.media-extra-action:has(.refmedia-camera-count) { position: relative; }
.media-extra-action.refmedia-tool-button { display: grid; place-items: center; width: 1.75rem !important; height: 1.75rem !important; min-height: 1.75rem; padding: 0 !important; flex: 0 0 1.75rem; }
body.media-mode .media-extra-action.refmedia-tool-button::before { content: none !important; display: none !important; }
.media-extra-action.refmedia-tool-button > .refmedia-icon { display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.media-extra-action.refmedia-tool-button > .refmedia-tool-video { width: 0.7943rem; height: 0.7943rem; stroke-width: 3.0857; }
.media-extra-action.refmedia-tool-button > .refmedia-tool-layers { width: 0.6809rem; height: 0.6809rem; stroke-width: 3.5; }
.media-extra-action.refmedia-tool-button > .refmedia-tool-qr { width: 0.7943rem; height: 0.7943rem; stroke-width: 3.7714; }

/* Reviewed dark image actions share the reference's left-anchored bubble. */
.refmedia-action-tip { position:fixed; z-index:100020; box-sizing:border-box; max-width:16rem; margin:0; padding:.5rem .625rem; border:1px solid rgba(255,255,255,.1); border-radius:.5rem; background:rgba(27,28,33,.95); color:#000; box-shadow:0 .5rem 1.25rem rgba(0,0,0,.4); backdrop-filter:blur(.625rem); font:1rem/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","HarmonyOS Sans","Microsoft YaHei",sans-serif; pointer-events:none; transition:background-color .25s,color .2s,border-color .25s,box-shadow .25s; animation:refmedia-action-tip-enter .16s; }
.refmedia-action-tip[hidden], .refmedia-action-tip [hidden] { display:none!important; }
.refmedia-action-tip-title { margin:0; padding:0; font-size:.8125rem; font-weight:600; line-height:1.35; color:rgba(255,255,255,.9); }
.refmedia-action-tip > div { transition:background-color .25s,color .2s,border-color .25s,box-shadow .25s; }
.refmedia-action-tip-description { margin:.1875rem 0 0; padding:0; font-size:.75rem; font-weight:400; line-height:1.5; color:rgba(255,255,255,.6); word-break:break-word; }
@keyframes refmedia-action-tip-enter { from {opacity:0;} to {opacity:1;} }

@media (max-width:840px) {
  .refmedia.refmedia-camera.modal { width: calc(100vw - 3rem); height: 88dvh; max-height: 88dvh; border-radius: 1rem; background: rgba(22,23,27,.98); }
  .refmedia-camera-head { flex: 0 0 auto; height: auto; }
  .refmedia-camera-title { flex: 0 1 auto; color: rgba(255,255,255,.95); }
  .refmedia-camera-title .refmedia-icon { width: 16px; height: 16px; }
  .refmedia-camera-maximum { font-weight: 400; }
  .refmedia-camera-head .refmedia-close { padding: 0; border: 0; color: rgba(255,255,255,.6); }
  .refmedia-camera-categories { flex: 1 1 0%; gap: .25rem; }
  .refmedia-camera-categories button { height: auto; font-family: Arial,sans-serif; line-height: normal; }
  .refmedia-camera-body { scrollbar-width: auto; }
  .refmedia-camera-body::-webkit-scrollbar { width: 10px; }
  .refmedia-camera-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .refmedia .refmedia-camera-card { height: auto; min-height: 0; font-family: Arial,sans-serif; line-height: normal; }
  .refmedia-camera-category, .refmedia-camera-copy strong, .refmedia-camera-copy p { line-height: normal; }
  .refmedia-camera-footer { gap: .375rem 1rem; flex: 0 0 auto; height: auto; background: transparent; }
  .refmedia-camera-footer-left { display: contents; }
  .refmedia-camera-selection { grid-column: 1; grid-row: 1; flex-wrap: wrap; gap: .375rem; color: rgba(255,255,255,.55); line-height: 1.5; }
  .refmedia-camera-selection > #refmedia-camera-count { margin-right: .125rem; }
  .refmedia-camera-none { font-size: .75rem; color: rgba(255,255,255,.35); }
  .refmedia-camera-selected { display: contents; }
  .refmedia-camera-selected:empty { display: none; }
  .refmedia-camera.modal .refmedia-camera-tip { grid-column: 1; grid-row: 2; margin: 0; color: rgba(255,255,255,.4); font-size: .6875rem; line-height: 1.5; }
  .refmedia-camera-footer-actions { grid-column: 2; grid-row: 1 / 3; gap: .5rem; }
  .refmedia-camera-footer .refmedia-button { min-width: 0; height: 2.125rem; padding: 0 1rem; border: 1px solid transparent; border-radius: .5rem; font: 500 .8125rem Arial,sans-serif !important; }
  .refmedia-camera-footer .refmedia-button.secondary { background: rgba(255,255,255,.06); color: rgba(255,255,255,.8); }
  .refmedia-camera-footer .refmedia-button.primary { background: linear-gradient(135deg,#fb923c,#ea580c); }
  .refmedia.refmedia-scan.modal { min-height: min(29.5532rem,calc(100dvh - 1.3617rem)); padding: 1.0213rem; }
}
@media (prefers-reduced-motion:reduce) { .refmedia-camera-card { transition: none; } }
