/* 图片 / 视频统一创作工作区 */
.cw-control-card .prompt-box textarea{padding-right:118px}
.cw-control-card .prompt-box .prompt-inspire{right:12px}
.cw-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin:2px 0 20px}.cw-page-head h1{margin:8px 0 4px;font-size:29px;line-height:1.2;letter-spacing:-.035em}.cw-page-head p{margin:0;color:var(--muted);font-size:13.5px}.cw-page-badge{flex:none;border:1px solid var(--border);background:var(--bg-mute);color:var(--ink-2);border-radius:999px;padding:6px 11px;font-size:11.5px}.cw-layout{display:grid;grid-template-columns:minmax(340px,400px) minmax(0,1fr);gap:26px;align-items:start}.cw-control,.cw-right-column{min-width:0}.cw-control-card{padding:22px;border-radius:16px;box-shadow:none}.cw-control-card .card-head{flex-wrap:wrap}.cw-control-stack>.card{border-radius:16px;box-shadow:none}.cw-control-stack>.card+.card{margin-top:16px!important}.cw-model-select,.cw-video-model{width:100%;min-width:0;display:flex;align-items:center;gap:11px;padding:11px 12px;border:1px solid var(--border-strong);border-radius:12px;background:var(--surface);color:var(--ink);text-align:left;cursor:pointer;transition:border-color .16s,background .16s}.cw-model-select{flex:1 1 100%;order:3;margin-top:4px}.cw-model-select:hover,.cw-video-model:hover{border-color:var(--ink-2);background:var(--bg-soft)}.cw-model-select>svg,.cw-video-model>svg{width:17px;height:17px;fill:none;stroke:var(--muted);stroke-width:1.8;flex:none}.cw-model-glyph{width:40px;height:40px;display:grid;place-items:center;flex:none;border:1px solid var(--border);border-radius:11px;background:var(--bg-mute);font-size:12px;font-weight:800;letter-spacing:-.02em}.cw-model-select-copy{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1}.cw-model-select-copy small{font-size:10.5px;color:var(--muted);font-weight:400}.cw-model-select-copy b{font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cw-model-select-copy .cap-tags{display:flex;gap:4px;margin-top:4px}.cw-model-select-price{font-size:11px;color:var(--ink-2);white-space:nowrap}.cw-control-card .prompt-box textarea,.cw-control-stack .prompt-box textarea{min-height:150px;resize:vertical}.cw-prompt-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.cw-effect-entry{background:var(--ink);border-color:var(--ink);color:var(--bg)}.cw-effect-entry:hover{background:var(--ink-2)}.cw-feed{min-width:0}.cw-feed-head{display:flex;align-items:center;gap:14px;justify-content:space-between;margin:2px 0 14px}.cw-feed-tabs{display:flex;align-items:center;gap:4px;padding:4px;background:var(--bg-mute);border-radius:11px}.cw-feed-tabs button{display:flex;align-items:center;gap:6px;border:0;background:transparent;color:var(--muted);border-radius:8px;padding:7px 12px;font-size:13px;cursor:pointer}.cw-feed-tabs button.on{background:var(--surface);color:var(--ink);font-weight:650;box-shadow:0 1px 4px rgba(0,0,0,.06)}.cw-feed-tabs svg,.cw-feed-search svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.7}.cw-feed-search{width:170px;display:flex;align-items:center;gap:6px;border-bottom:1px solid var(--border-strong);padding:6px 2px;color:var(--muted)}.cw-feed-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:12px}.cw-feed-categories{display:flex;gap:7px;overflow-x:auto;padding:0 0 12px;scrollbar-width:thin}.cw-feed-categories button,.cw-filter-chips button{flex:none;border:1px solid var(--border);background:var(--surface);color:var(--muted);border-radius:999px;padding:5px 10px;font-size:11.5px;cursor:pointer}.cw-feed-categories button.on,.cw-filter-chips button.on{border-color:var(--ink);background:var(--ink);color:var(--bg)}.cw-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 16px}.cw-media-card{min-width:0}.cw-card-media{position:relative;aspect-ratio:4/3;border-radius:12px;overflow:hidden;background:var(--bg-mute);isolation:isolate}.cw-card-media>img,.cw-card-media>video{width:100%;height:100%;object-fit:cover;display:block;transition:transform .35s ease}.cw-media-card:hover .cw-card-media>img{transform:scale(1.018)}.cw-card-media::after{content:"";position:absolute;inset:45% 0 0;background:linear-gradient(transparent,rgba(0,0,0,.46));opacity:0;transition:opacity .18s;pointer-events:none;z-index:1}.cw-media-card:hover .cw-card-media::after,.cw-media-card:focus-within .cw-card-media::after{opacity:1}.cw-add-ref{position:absolute;z-index:3;right:10px;top:10px;width:32px;height:32px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.65);border-radius:50%;background:rgba(255,255,255,.92);color:#171717;box-shadow:0 3px 12px rgba(0,0,0,.15);cursor:pointer;opacity:0;transform:translateY(-4px);transition:opacity .16s,transform .16s}.cw-add-ref svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8}.cw-media-card:hover .cw-add-ref,.cw-media-card:focus-within .cw-add-ref{opacity:1;transform:none}.cw-card-actions{position:absolute;z-index:2;left:10px;right:10px;bottom:10px;transform:translateY(calc(100% + 15px));transition:transform .2s ease}.cw-media-card:hover .cw-card-actions,.cw-media-card:focus-within .cw-card-actions{transform:translateY(0)}.cw-card-actions button{width:100%;display:flex;align-items:center;justify-content:center;gap:7px;border:0;border-radius:9px;background:rgba(255,255,255,.96);color:#151515;padding:10px 12px;font-weight:650;font-size:12.5px;cursor:pointer;box-shadow:0 4px 18px rgba(0,0,0,.14)}.cw-card-actions svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.6}.cw-play-badge{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.88);color:#111;pointer-events:none;transition:opacity .15s}.cw-play-badge svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6}.is-playing .cw-play-badge{opacity:0}.cw-card-info{padding:9px 2px 0;min-width:0}.cw-card-info>span{font-size:10px;color:var(--muted)}.cw-card-info h3{font-size:13.5px;line-height:1.35;margin:2px 0 3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cw-card-info p{margin:0;color:var(--muted);font-size:11px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.cw-no-media{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--muted);font-size:12px}.cw-no-media svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.5}.cw-empty{min-height:300px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;border:1px dashed var(--border-strong);border-radius:14px;color:var(--muted);padding:30px}.cw-empty>svg{width:32px;height:32px;fill:none;stroke:currentColor;stroke-width:1.3;margin-bottom:12px}.cw-empty b{color:var(--ink-2);font-size:14px;margin-bottom:5px}.cw-empty span{max-width:360px;font-size:12px;line-height:1.7}.cw-empty.compact{min-height:180px;border:0}.cw-empty .btn{margin-top:14px}.cw-feed-loading{min-height:280px;display:flex;align-items:center;justify-content:center;gap:10px;color:var(--muted);font-size:12px}.cw-feed-loading i{width:17px;height:17px;border:1.5px solid var(--border-strong);border-top-color:var(--ink);border-radius:50%;animation:cw-spin .8s linear infinite}.cw-task-drawer{margin-top:20px;border-top:1px solid var(--border);padding-top:12px}.cw-task-drawer summary{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:12px;cursor:pointer;list-style:none}.cw-task-drawer summary::-webkit-details-marker{display:none}.cw-task-drawer summary::after{content:"＋";font-size:15px}.cw-task-drawer[open] summary::after{content:"−"}.cw-task-drawer>div{margin-top:12px}.cw-task-drawer .task-card{box-shadow:none}
/* 独立弹层 */
.cw-layer{position:fixed;inset:0;z-index:1200;display:flex;align-items:center;justify-content:center;padding:24px;opacity:0;transition:opacity .16s}.cw-layer.show{opacity:1}.cw-backdrop{position:absolute;inset:0;background:rgba(15,18,22,.36);backdrop-filter:blur(5px)}.cw-dialog{--cw-dialog-bg:var(--surface);position:relative;width:min(880px,100%);max-height:min(820px,90vh);display:flex;flex-direction:column;background:var(--cw-dialog-bg);color:var(--ink);border:1px solid var(--border);border-radius:18px;box-shadow:0 28px 90px rgba(0,0,0,.2);overflow:hidden;transform:translateY(8px);transition:transform .18s}.cw-layer.show .cw-dialog{transform:none}.cw-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:23px 25px 15px}.cw-dialog-head h2{margin:0;font-size:20px;letter-spacing:-.02em}.cw-dialog-head p{margin:5px 0 0;color:var(--muted);font-size:12px}.cw-icon-btn{width:32px;height:32px;display:grid;place-items:center;flex:none;border:0;border-radius:50%;background:var(--bg-mute);color:var(--ink-2);cursor:pointer}.cw-icon-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7}.cw-model-tools,.cw-effect-tools{padding:0 25px 14px}.cw-search{height:42px;display:flex;align-items:center;gap:9px;border:1px solid var(--border-strong);border-radius:11px;background:var(--bg-soft);padding:0 12px;color:var(--muted)}.cw-search:focus-within{border-color:var(--ink-2);box-shadow:0 0 0 3px rgba(17,24,39,.05)}.cw-search svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7}.cw-search input{flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:13px}.cw-filter-chips{display:flex;gap:7px;flex-wrap:wrap;margin-top:11px}.cw-filter-chips button span{opacity:.65;margin-left:3px}.cw-model-list{padding:0 25px 25px;overflow:auto;display:flex;flex-direction:column;gap:9px}.cw-model-option{position:relative;display:flex;align-items:center;gap:13px;width:100%;min-width:0;padding:13px 14px;border:1px solid var(--border);border-radius:13px;background:var(--surface);color:var(--ink);text-align:left;cursor:pointer;transition:border-color .15s,background .15s}.cw-model-option:hover{background:var(--bg-soft);border-color:var(--border-strong)}.cw-model-option.selected{border-color:var(--ink);background:var(--bg-soft)}.cw-model-logo{width:46px;height:46px;flex:none;border-radius:12px}.cw-model-copy{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.cw-model-name{display:flex;align-items:center;gap:8px;min-width:0}.cw-model-name b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cw-model-name i{font-style:normal;font-size:9px;color:var(--bg);background:var(--ink);border-radius:5px;padding:2px 5px;white-space:nowrap}.cw-model-copy>small{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cw-model-caps{display:flex;gap:5px;flex-wrap:wrap}.cw-model-caps em{font-style:normal;font-size:9.5px;line-height:1.3;color:var(--ink-2);background:var(--bg-mute);border-radius:5px;padding:2px 6px}.cw-model-price{display:flex;flex-direction:column;align-items:flex-end;gap:3px;flex:none}.cw-model-price b{font-size:11px;font-weight:550}.cw-model-price small{font-size:9.5px;color:var(--muted)}.cw-model-check{width:20px;height:20px;display:grid;place-items:center;flex:none;border:1px solid var(--border-strong);border-radius:50%;color:transparent}.cw-model-check svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:2}.cw-model-option.selected .cw-model-check{background:var(--ink);border-color:var(--ink);color:var(--bg)}.cw-effect-layer .cw-dialog{width:min(1080px,100%)}.cw-effect-grid{padding:0 25px 25px;overflow:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}.cw-effect-card{position:relative;display:flex;flex-direction:column;min-width:0;padding:0;border:1px solid var(--border);border-radius:12px;overflow:hidden;background:var(--surface);color:var(--ink);text-align:left;cursor:pointer}.cw-effect-card:hover{border-color:var(--ink-2)}.cw-effect-media{position:relative;display:block;aspect-ratio:16/10;background:#171717;overflow:hidden}.cw-effect-media video{width:100%;height:100%;object-fit:cover;display:block}.cw-effect-media>i{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:rgba(255,255,255,.88);color:#111;transition:opacity .15s}.cw-effect-media>i svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6}.cw-effect-card.is-playing .cw-effect-media>i{opacity:0}.cw-effect-copy{display:flex;flex-direction:column;gap:3px;padding:11px 36px 11px 12px;min-width:0}.cw-effect-copy b{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cw-effect-copy small{font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cw-effect-add{position:absolute;right:11px;bottom:12px;color:var(--muted)}.cw-effect-add svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8}@keyframes cw-spin{to{transform:rotate(360deg)}}
.cw-layer button:focus-visible,.cw-feed button:focus-visible,.cw-feed input:focus-visible,.cw-model-select:focus-visible,.cw-video-model:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
@media(max-width:1180px){.cw-layout{grid-template-columns:340px minmax(0,1fr);gap:20px}.cw-card-grid{gap:16px 12px}.cw-model-select-price{display:none}}
@media(max-width:1050px){.cw-layout{grid-template-columns:1fr}.cw-control{max-width:none}.cw-right-column{margin-top:4px}.cw-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.cw-control-card .prompt-box textarea,.cw-control-stack .prompt-box textarea{min-height:130px}.cw-task-drawer{margin-top:16px}}
@media(max-width:760px){.cw-page-head{align-items:flex-start}.cw-page-badge{display:none}.cw-page-head h1{font-size:25px}.cw-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cw-effect-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cw-layer{padding:12px}.cw-dialog{max-height:94vh;border-radius:15px}.cw-dialog-head{padding:19px 18px 13px}.cw-model-tools,.cw-effect-tools{padding:0 18px 12px}.cw-model-list,.cw-effect-grid{padding:0 18px 18px}.cw-model-price{display:none}.cw-feed-search{width:140px}}
@media(max-width:520px){.cw-page-head{margin-bottom:16px}.cw-page-head p{font-size:12px}.cw-control-card,.cw-control-stack>.card.card-pad{padding:16px}.cw-feed-head{gap:8px;align-items:flex-start}.cw-feed-search{width:112px;margin-top:5px}.cw-feed-tabs button{padding:7px 9px;font-size:12px}.cw-card-grid{grid-template-columns:1fr}.cw-card-media{aspect-ratio:16/11}.cw-add-ref{opacity:1;transform:none}.cw-card-actions{transform:none}.cw-card-media::after{opacity:.65}.cw-effect-grid{grid-template-columns:1fr}.cw-model-option{padding:11px;gap:9px}.cw-model-logo{width:40px;height:40px}.cw-model-check{display:none}.cw-model-name b{font-size:12.5px}.cw-dialog-head h2{font-size:18px}.cw-model-select-price{display:block;font-size:10px}.cw-ratio-grid{grid-template-columns:repeat(3,1fr)}}
@media(prefers-reduced-motion:reduce){.cw-layer,.cw-dialog,.cw-card-actions,.cw-add-ref,.cw-card-media>img,.cw-card-media>video{transition:none!important}.cw-feed-loading i{animation:none}.cw-media-card:hover .cw-card-media>img{transform:none}}

/* 修正：app.css 通用 `.topbar, header` 规则误命中弹层 <header> 标题栏，
   恢复弹层自身背景（否则深色下标题白底白字不可见），并取消其底部分隔线。 */
.cw-dialog .cw-dialog-head { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; }