/* 共享界面规则：弹窗层级、可见高度、滚动区域与操作尺寸由这里统一维护。 */
:root{--wk-view-height:100dvh;--wk-view-top:0px;--wk-radius:18px}
.theme-dark{--wk-dialog:#111722;--wk-dialog-foot:#151c29;--wk-primary:#7454f2;--wk-accent-text:#b4a2ff}
.theme-light{--wk-dialog:#fff;--wk-dialog-foot:#f7f8fc;--wk-primary:#6a4df0;--wk-accent-text:#6a4df0}
.assist-apply-btn,.chat-msg.user,.mp-picker-tab.is-active,.theme-light .wukong-generate-btn{background:var(--wk-primary);color:#fff}
.assist-apply-btn:hover{filter:brightness(.94)}
.mp-style-label,.mp-expand-toggle,.chat-act,.ps-edit,.wk-tour-count,.wk-guide-dialog header small{color:var(--wk-accent-text)}
[data-wk-layer]{z-index:var(--wk-layer-z)!important}
.wk-layer-suspended{visibility:hidden!important;pointer-events:none!important}
.wk-layer-suspended *{visibility:hidden!important;transition:none!important}
.moments-picker:not(.show),.create-drawer-overlay:not(.show){display:none}
body.wk-modal-open{overflow:hidden}
body.wk-modal-open .main-content{overflow:hidden}
body.wk-modal-open>.wukong-watermark{visibility:hidden}
.create-drawer-overlay,.plan-editor-backdrop{background:rgba(5,9,20,.72);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.moments-picker,.theme-light .moments-picker{background:var(--wk-dialog);backdrop-filter:none;-webkit-backdrop-filter:none}
.moments-picker.show{
  top:calc(var(--wk-view-top) + var(--wk-view-height) / 2);bottom:auto;
  max-height:calc(var(--wk-view-height) - 32px);border-radius:var(--wk-radius);
}
.agent-modal.show{height:min(760px,calc(var(--wk-view-height) - 32px))}
.wz-modal.show{height:auto;min-height:min(360px,calc(var(--wk-view-height) - 32px))}
.moments-picker :is(.drawer-header,.moments-picker-head,.chat-foot,.wukong-modal-foot,.wz-foot,.moments-picker-tip,.mp-picker-tabs),
.plan-task-editor :is(.pte-head,.pte-foot){flex-shrink:0}
.moments-picker :is(.drawer-header,.moments-picker-head){gap:12px;padding:18px 22px;min-height:64px}
.moments-picker :is(.drawer-header,.moments-picker-head)>div{min-width:0}
.drawer-title,.moments-picker-title{overflow-wrap:anywhere;line-height:1.45}
.moments-picker :is(.modal-close,.moments-picker-close),.plan-task-editor .modal-close,.wk-guide-close{width:40px;height:40px;flex:0 0 40px;display:grid;place-items:center}
.moments-picker :is(.chat-foot,.wukong-modal-foot,.wz-foot,.moments-picker-tip),.pte-foot{background:var(--wk-dialog-foot)}
.moments-picker :is(.wukong-modal-body,.moments-picker-body,.chat-thread,.wz-body),.pte-fields,.wk-guide-body{min-height:0;overscroll-behavior:contain;scrollbar-gutter:stable}
.wukong-modal-body{flex:1 1 auto}
.wukong-modal-foot,.wz-foot{flex-wrap:wrap;align-items:center}
.moments-picker :is(button,input,textarea,select){font-family:inherit}
button:focus-visible,[role=button]:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
:is(input,textarea,select):focus-visible{outline:2px solid var(--accent);outline-offset:2px}
:is(input,textarea)::placeholder{color:var(--muted);opacity:1}
button:disabled{cursor:not-allowed}
.mp-style-card,.chat-msg,.wz-copy,.wz-privacy,.model-test-result,.wukong-note,.dtc-name{overflow-wrap:anywhere}
.mp-style-head{align-items:flex-start;gap:10px}.mp-style-label{min-width:0;line-height:1.5}.mp-style-count{flex:none;white-space:nowrap}
.mp-style-foot{gap:8px;flex-wrap:wrap}.mp-style-action{line-height:1.5}
.mp-expand-toggle,.chat-act,.ps-edit{min-height:36px;display:inline-flex;align-items:center;justify-content:center}
.chat-input{min-width:0}.chat-actions{flex-wrap:wrap}
.wukong-progress :is(span,strong,p){min-width:0;overflow-wrap:anywhere}
.wukong-progress>div:first-child{align-items:flex-start;flex-wrap:wrap}
.wpl-plan-actions{flex-wrap:wrap}.wpl-plan-actions button{min-height:36px}
.dtc-head{align-items:flex-start;gap:10px}.dtc-name{min-width:0}.dtc-count{flex:none}
.dtc-name{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.6}
.dtc-del-link{min-width:36px;min-height:36px;display:inline-grid;place-items:center}
.model-route{grid-template-columns:82px minmax(0,1fr);gap:7px 12px}
.model-route span{overflow:visible;overflow-wrap:anywhere}
.model-route small{grid-column:2;overflow-wrap:anywhere;line-height:1.6;font-size:12px}
.model-test-result{font-size:13px;line-height:1.8}
.wz-file-row{flex-wrap:wrap}.wz-file-row input{min-width:0;max-width:100%}
.pf-row{grid-template-columns:88px minmax(0,1fr)}
.pf-row input,.wz-ask textarea{min-height:44px}
.wz-list div{display:block;line-height:1.8}
.wz-list div:has(i){display:flex;align-items:flex-start}
.profile-summary{flex-wrap:wrap;line-height:1.7}
.profile-summary .ps-edit{flex:none}
.generation-saved-details summary{line-height:1.7}
.generation-goal-option input:focus-visible+span{outline:3px solid var(--accent);outline-offset:2px}
.wukong-field,.pte-fields label{font-size:13px}
.plan-confirm-modal .wukong-modal-body{overflow-x:hidden}
.plan-confirm-week-grid{overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x proximity;min-width:0;grid-template-columns:repeat(7,minmax(130px,1fr));padding-bottom:10px}
.plan-day-column{scroll-snap-align:start}.plan-slot-card{min-height:130px;height:auto}
.plan-week-overview{flex-wrap:wrap;position:static}
.plan-week-overview p{display:block;white-space:normal;overflow-wrap:anywhere;line-height:1.7;flex:1 1 260px}
.plan-editor-backdrop{position:fixed;inset:0}
.plan-task-editor{
  position:fixed;inset:auto;left:50%;top:calc(var(--wk-view-top) + var(--wk-view-height) / 2);
  transform:translate(-50%,-50%);width:min(620px,calc(100vw - 32px));height:min(720px,calc(var(--wk-view-height) - 32px));
  max-height:calc(var(--wk-view-height) - 32px);border:1px solid var(--line-strong);border-radius:var(--wk-radius);overflow:hidden;background:var(--wk-dialog);
}
.pte-fields{align-content:start;min-height:0;grid-template-columns:repeat(2,minmax(0,1fr))}
.pte-fields input,.pte-fields textarea{font-size:14px;min-height:44px}
.pte-head strong{white-space:normal;line-height:1.5}
.wukong-toast{z-index:10000;top:calc(var(--wk-view-top) + 16px);bottom:auto;max-height:calc(var(--wk-view-height) - 32px);overflow:auto;line-height:1.7}
.wk-guide-dialog{background:var(--wk-dialog);max-height:calc(var(--wk-view-height) - 24px)}
.wk-guide-dialog header{flex-shrink:0}.wk-guide-dialog footer{background:var(--wk-dialog-foot)}
.is-tour .wk-guide-dialog{max-height:none}
.main-content{width:100%;max-width:1800px;margin-inline:auto;scrollbar-gutter:stable}
.wz-content{display:flex;flex-direction:column;gap:12px;min-width:0}
.wk-intro-copy,.wk-tour-instructions{min-width:0}
/* 操作导览：悟小空用贴近目标的聊天气泡带用户逐步操作。 */
.wk-guide-layer.is-tour{display:block;padding:0;background:transparent}
.is-tour .wk-guide-hole{
  position:fixed;z-index:1;pointer-events:none;border:3px solid var(--accent);border-radius:13px;
  box-shadow:0 0 0 9999px rgba(5,9,20,.68),0 0 0 5px color-mix(in srgb,var(--accent) 25%,transparent),0 0 26px color-mix(in srgb,var(--accent) 72%,transparent);
  transition:left .38s cubic-bezier(.22,.8,.24,1),top .38s cubic-bezier(.22,.8,.24,1),width .38s cubic-bezier(.22,.8,.24,1),height .38s cubic-bezier(.22,.8,.24,1),border-radius .38s ease
}
.is-tour .wk-guide-dialog{
  position:fixed;z-index:3;right:auto;width:min(360px,calc(100vw - 32px));height:auto;max-height:none;
  overflow:visible;border-radius:18px;border-color:color-mix(in srgb,var(--accent) 34%,var(--line-strong));
  background:var(--wk-dialog);box-shadow:0 22px 70px rgba(0,0,0,.38),0 0 0 1px color-mix(in srgb,var(--accent) 8%,transparent);
  transform-origin:center;animation:wk-pop-in .28s cubic-bezier(.22,.8,.24,1) both
}
.is-tour .wk-guide-dialog::after{content:"";position:absolute;inset:0;z-index:0;border-radius:18px;pointer-events:none;box-shadow:inset 0 1px 0 color-mix(in srgb,#fff 7%,transparent)}
.is-tour .wk-guide-arrow{position:absolute;z-index:-1;width:16px;height:16px;background:var(--wk-dialog);transform:rotate(45deg);border:1px solid color-mix(in srgb,var(--accent) 34%,var(--line-strong))}
.is-tour .wk-guide-dialog[data-placement=left] .wk-guide-arrow{right:-8px;top:var(--wk-arrow-y);margin-top:-8px;border-left:0;border-bottom:0}
.is-tour .wk-guide-dialog[data-placement=right] .wk-guide-arrow{left:-8px;top:var(--wk-arrow-y);margin-top:-8px;border-top:0;border-right:0}
.is-tour .wk-guide-dialog[data-placement=top] .wk-guide-arrow{bottom:-8px;left:var(--wk-arrow-x);margin-left:-8px;border-left:0;border-top:0}
.is-tour .wk-guide-dialog[data-placement=bottom] .wk-guide-arrow{top:-8px;left:var(--wk-arrow-x);margin-left:-8px;border-right:0;border-bottom:0}
.is-tour .wk-tour-head{position:relative;z-index:1;min-height:62px;padding:10px 12px 9px 14px;justify-content:flex-start;border-radius:18px 18px 0 0;background:var(--wk-dialog)}
.is-tour .wk-tour-npc{width:38px;height:46px;flex:0 0 38px;object-fit:contain;filter:drop-shadow(0 5px 8px rgba(0,0,0,.24))}
.is-tour .wk-tour-head>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.is-tour .wk-tour-head small{font-size:12px;letter-spacing:.03em}
.wk-tour-presence{font-size:11px;color:var(--muted);line-height:1.3}
.wk-tour-presence i{display:inline-block;width:6px;height:6px;border-radius:50%;background:#43c783;box-shadow:0 0 0 3px color-mix(in srgb,#43c783 14%,transparent)}
.is-tour .wk-guide-close{margin-left:auto;width:36px;height:36px;flex-basis:36px}
.is-tour .wk-guide-body{position:relative;z-index:1;flex:1;padding:14px 16px 12px;overflow:visible;background:var(--wk-dialog);scrollbar-gutter:auto}
.wk-tour-message{transition:opacity .22s ease,transform .3s cubic-bezier(.22,.8,.24,1)}
.is-tour .is-thinking .wk-tour-message{opacity:0;transform:translateY(6px)}
.wk-tour-typing{position:absolute;left:16px;top:18px;z-index:2;display:flex;align-items:center;gap:9px;font-size:12px;color:var(--muted);transition:opacity .18s ease}
.wk-tour-typing[hidden]{display:none}
.wk-tour-typing>span{display:inline-flex;gap:4px;padding:8px 10px;border-radius:13px 13px 13px 4px;background:var(--surface-2);border:1px solid var(--line)}
.wk-tour-typing i{width:5px;height:5px;border-radius:50%;background:var(--muted);animation:wk-typing .8s infinite ease-in-out}
.wk-tour-typing i:nth-child(2){animation-delay:.13s}.wk-tour-typing i:nth-child(3){animation-delay:.26s}
.is-tour .is-speaking .wk-tour-typing{opacity:0;pointer-events:none}
.wk-tour-layout{display:block;min-height:0}
.wk-tour-count{display:flex;align-items:baseline;gap:4px;margin-bottom:5px;color:var(--muted);font-size:11px;letter-spacing:.04em}
.wk-tour-count span{color:var(--accent);font-size:14px;font-weight:800}
.is-tour .wk-tour-layout h2{margin:0 0 9px;font-size:19px;line-height:1.42;letter-spacing:-.01em}
.wk-tour-copy{font-size:14px;line-height:1.72}
.wk-tour-copy p{margin:0;color:var(--soft)}
.wk-tour-detail{margin:11px 0 0!important;padding:9px 0 0!important;border-top:1px solid var(--line)!important;font-size:12px}
.wk-tour-detail summary{display:inline-flex;align-items:center;min-height:30px;color:var(--muted);font-weight:650;cursor:pointer}
.wk-tour-detail p{margin:6px 0 0;font-size:12px;line-height:1.65}
.is-tour .wk-guide-dialog footer{position:relative;z-index:1;box-sizing:border-box;min-height:62px;padding:9px 12px;border-radius:0 0 18px 18px;gap:7px;background:var(--wk-dialog-foot)}
.is-tour .wk-guide-dialog footer button{min-height:42px;padding:8px 13px;font-size:12px;border-radius:10px}
/* 导览层：不走弹窗栈（避免真弹窗被挂起隐藏），直接浮在最高层；block 拦截一切点击保证演示安全，hole 透出高亮目标。 */
.wk-tour-layer{position:fixed;inset:0;z-index:9000;pointer-events:none}
.wk-tour-block{position:absolute;inset:0;pointer-events:auto}
.wk-tour-layer .wk-guide-dialog{pointer-events:auto}
@media(max-width:900px),(max-height:640px){
  .wk-tour-layer .wk-guide-dialog{max-height:calc(var(--wk-view-height) - 16px)}
  .wk-tour-layer .wk-guide-body{overflow-y:auto;min-height:0}
}
.wk-guide-target-pulse{animation:wk-target-pulse .62s ease-in-out 2!important;position:relative;z-index:2}
@keyframes wk-pop-in{from{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes wk-typing{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-3px);opacity:1}}
@keyframes wk-target-pulse{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 0%,transparent)}50%{box-shadow:0 0 0 7px color-mix(in srgb,var(--accent) 28%,transparent)}}
/* 电脑端用双栏承载插画和正文，头尾只保留必要操作空间。 */
@media(min-width:1024px) and (min-height:501px){
  .wz-modal.show{width:min(960px,calc(100vw - 80px))}
  .wz-modal.show:has(.has-art){width:min(1160px,calc(100vw - 80px))}
  .wz-modal .moments-picker-head{padding:14px 28px;min-height:70px}
  .wz-modal .moments-picker-title{font-size:21px}
  .wz-modal .wz-npc{width:34px;height:48px}
  .wz-modal .wz-step-label{font-size:14px}
  .wz-body{padding:28px;gap:32px}
  .wz-body.has-art{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);align-items:center;min-height:min(440px,54dvh)}
  .wz-body.has-art .wz-art{width:100%;height:auto;max-height:none;aspect-ratio:3/2;object-fit:contain;margin:0;border-radius:16px}
  .wz-content{gap:22px}
  .wz-copy{font-size:17px;line-height:1.9}
  .wz-ask{gap:12px}.wz-ask label{font-size:16px;line-height:1.8}
  .wz-ask textarea{min-height:132px;padding:16px;font-size:16px;line-height:1.8}
  .wz-privacy,.wz-file-row{font-size:14px;line-height:1.8}
  .wz-list,.pf-label,.pf-row input{font-size:15px}
  .wz-foot{padding:14px 28px;gap:12px}
  .wz-modal .wz-foot button{min-height:46px;font-size:15px;padding:10px 22px}
  .wk-guide-dialog:has(.wk-intro-copy){width:min(1240px,calc(100vw - 80px))}
  .wk-guide-dialog:has(.wk-intro-copy) .wk-guide-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);align-items:center;gap:36px;padding:28px 32px}
  .wk-intro-art{width:100%;height:auto;max-height:none;aspect-ratio:3/2;object-fit:contain;margin:0;border-radius:16px}
  .wk-intro-copy{font-size:16px;line-height:1.9}
  .wk-intro-copy p{margin:0 0 20px}.wk-intro-copy p:last-child{margin-bottom:0}
  .wk-guide-dialog header{padding:16px 28px;gap:18px}
  .wk-guide-dialog h2{font-size:26px;line-height:1.45}
  .wk-guide-dialog header small,.wk-tour-count{font-size:13px}
  .wk-guide-dialog footer{padding:14px 28px}
  .wk-guide-dialog footer button{min-height:46px;padding:10px 20px;font-size:15px}
}
@media(min-width:1024px) and (min-height:501px) and (max-height:800px){
  .wz-body.has-art .wz-art,.wk-guide-dialog:has(.wk-intro-copy) .wk-intro-art{position:sticky;top:0;align-self:start}
}
@media(min-width:1101px){
  #momentsPicker{width:min(1080px,calc(100vw - 48px))}
  .mp-picker-panel[data-panel=versions]{grid-template-columns:repeat(3,minmax(0,1fr))}
  .mp-picker-panel[data-panel=versions]>.mp-style-card{height:220px}
}
@media(min-width:761px) and (max-width:1100px){
  .mp-head-controls{gap:8px;flex-wrap:wrap}.section-head h2{font-size:19px}
  .moments-plan-grid{grid-template-columns:repeat(7,minmax(124px,1fr));overflow-x:auto}
  .mp-picker-panel{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .is-tour .wk-guide-dialog{width:min(360px,calc(100vw - 20px));max-height:none}
  .is-tour .wk-guide-body{padding:12px 14px 10px}
  .is-tour .wk-tour-layout h2{font-size:17px}
  .is-tour .wk-guide-dialog footer{padding:8px 10px max(8px,env(safe-area-inset-bottom))}
  .is-tour .wk-guide-dialog footer button{min-height:40px;padding:7px 10px}
  .is-tour .wk-tour-detail{display:none}
  .moments-picker.show,.wukong-modal.show,.agent-modal.show{
    top:auto;left:4px;right:4px;bottom:calc(100dvh - var(--wk-view-height) - var(--wk-view-top) + 4px);
    width:auto;max-height:calc(var(--wk-view-height) - 8px);border:1px solid var(--line-strong);border-radius:18px;
  }
  .agent-modal.show{height:calc(var(--wk-view-height) - 8px)}
  .wz-modal.show{height:auto;min-height:min(360px,calc(var(--wk-view-height) - 8px))}
  .moments-picker :is(.drawer-header,.moments-picker-head){padding:12px 14px;min-height:60px}
  .drawer-title,.agent-modal .moments-picker-title{font-size:16px}
  .moments-picker :is(.chat-foot,.wukong-modal-foot,.wz-foot),.pte-foot{padding:10px 12px max(12px,env(safe-area-inset-bottom));gap:8px}
  .moments-picker :is(.mp-week-btn,.assist-apply-btn),.pte-foot button{min-height:44px;font-size:13px}
  .moments-picker :is(input:not([type=radio]):not([type=range]):not([type=file]),textarea,select),.pte-fields :is(input,textarea){font-size:16px}
  .moments-picker .chat-foot .assist-apply-btn{min-width:64px;min-height:52px;padding:10px 12px;font-size:14px}
  .chat-input{min-height:52px;max-height:100px}
  #briefModal .moments-picker-head{display:grid;grid-template-columns:minmax(0,1fr) 40px;gap:8px}
  #briefModal .moments-picker-head>span{display:contents}
  #briefModal .moments-picker-title{grid-column:1;grid-row:1}
  #briefClose{grid-column:2;grid-row:1}
  #briefSkip{grid-column:1/-1;grid-row:2;justify-self:start;min-height:36px}
  .mp-picker-tabs{height:auto;flex-basis:auto;flex-wrap:wrap;padding:8px;gap:6px}
  .mp-picker-tab{flex:1 1 auto;min-height:40px;padding:8px 10px}
  .mp-picker-panel[data-panel=versions]>.mp-style-card{height:auto;min-height:180px}
  .mp-style-preview{font-size:14px;line-height:1.8}
  .mp-expand-toggle,.chat-act,.ps-edit{min-height:40px}
  .model-route{grid-template-columns:70px minmax(0,1fr)}
  .pf-row{grid-template-columns:1fr;gap:6px}.pf-label{text-align:left}
  .wz-body{padding:16px 14px;gap:14px}
  .wz-copy{font-size:14px}.wz-art{flex:none}
  .wz-file-row{font-size:13px;gap:6px}.wz-file-row input{width:100%}
  .rt-row{grid-template-columns:54px minmax(0,1fr) 40px}.rt-row input[type=range]{min-height:36px}
  .plan-confirm-week-grid{grid-template-columns:repeat(7,minmax(78vw,1fr))}
  .plan-week-overview p{flex-basis:100%;font-size:12px}
  .plan-task-editor{width:calc(100vw - 8px);height:calc(var(--wk-view-height) - 8px);max-height:calc(var(--wk-view-height) - 8px)}
  .pte-fields{grid-template-columns:1fr;padding:14px}.pte-fields label{grid-column:1}
  .plan-confirm-modal .wukong-modal-foot button{font-size:13px}
  .wukong-toast{left:12px;right:12px;max-width:none;font-size:13px}
  .wk-tour-copy{font-size:13px}
}
@media(max-height:500px){
  .moments-picker :is(.drawer-header,.moments-picker-head),.wk-guide-dialog header{padding:8px 14px;min-height:48px}
  .wk-intro-art,.wz-art{height:90px;max-height:90px;object-fit:cover}
  .wk-guide-dialog footer,.wz-foot,.wukong-modal-foot{padding-top:8px;padding-bottom:8px}
  .wk-tour-npc{height:40px;width:32px;flex-basis:32px}.wk-guide-dialog h2{font-size:18px}
  .moments-picker .chat-input{min-height:44px;max-height:64px}
  .moments-picker .chat-foot .assist-apply-btn{min-height:44px}
  .is-tour .wk-tour-head{min-height:48px;padding:6px 10px}.is-tour .wk-tour-npc{height:36px;width:30px;flex-basis:30px}.is-tour .wk-guide-body{padding:8px 12px 6px}.is-tour .wk-tour-layout h2{margin-bottom:4px;font-size:15px}.wk-tour-copy{font-size:11px;line-height:1.45}.wk-tour-detail{display:none}.is-tour .wk-guide-dialog footer{min-height:48px;padding:5px 8px}.is-tour .wk-guide-dialog footer button{min-height:36px;padding:5px 8px;font-size:10px}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
  .wk-tour-typing{display:none}.is-tour .is-thinking .wk-tour-message{opacity:1;transform:none}
}
