(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18566,(e,t,r)=>{t.exports=e.r(76562)},388,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(18566);e.s(["default",0,function(){let[e,a]=(0,r.useState)(""),[o,l]=(0,r.useState)(""),[d,i]=(0,r.useState)(!1),n=(0,s.useRouter)(),c=async t=>{if(t.preventDefault(),e.trim()){i(!0),l("");try{let t=await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e})}),r=await t.json();r.ok?(n.push("/"),n.refresh()):l(r.error||"密码错误")}catch{l("网络错误")}finally{i(!1)}}};return(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--bg)"},children:(0,t.jsxs)("div",{className:"w-[360px]",children:[(0,t.jsxs)("div",{className:"text-center mb-8",children:[(0,t.jsx)("h1",{className:"text-[24px] font-semibold tracking-wide mb-1",children:"myWiki"}),(0,t.jsx)("p",{className:"text-[13px]",style:{color:"var(--muted)"},children:"请输入密码以继续"})]}),(0,t.jsxs)("form",{onSubmit:c,className:"bg-white rounded-xl p-6 shadow-sm border",style:{borderColor:"var(--border)"},children:[(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)("input",{type:"password",value:e,onChange:e=>a(e.target.value),placeholder:"输入密码",autoFocus:!0,className:"w-full px-4 py-3 text-[14px] rounded-lg border focus:outline-none focus:ring-2 focus:ring-amber-200 focus:border-amber-300 transition-shadow",style:{borderColor:"var(--border)",background:"var(--bg)"}})}),o&&(0,t.jsx)("div",{className:"mb-4 px-3 py-2 rounded-lg bg-red-50 border border-red-200 text-[12px] text-red-600",children:o}),(0,t.jsx)("button",{type:"submit",disabled:!e.trim()||d,className:"w-full py-2.5 text-[14px] font-medium rounded-lg bg-gray-900 text-white hover:bg-gray-800 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:d?"验证中...":"进入"})]}),(0,t.jsx)("p",{className:"text-center mt-4 text-[11px]",style:{color:"var(--muted)"},children:"密码有效期 7 天"})]})})}])}]);