:root{--brand:#3978f6;--bg:#f4f7fb;--muted:#7b8798;--line:#e6ebf3}*{box-sizing:border-box}html,body{min-height:100%;margin:0;background:#e9eef6;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;color:#1e293b}.app{position:relative;width:100%;max-width:480px;min-height:100dvh;margin:auto;display:flex;flex-direction:column;background:var(--bg);box-shadow:0 0 30px #273f6517}header{padding:max(12px,env(safe-area-inset-top)) 16px 12px;min-height:70px;display:flex;justify-content:space-between;align-items:center;background:#fff;border-bottom:1px solid var(--line)}.profile{display:flex;gap:10px;align-items:center}.avatar{width:42px;height:42px;display:grid;place-items:center;border-radius:50%;color:#fff;background:linear-gradient(135deg,var(--brand),#7f9eff)}h1,p{margin:0}h1{font-size:16px}.profile p{margin-top:3px;color:var(--muted);font-size:12px}.profile i{display:inline-block;width:7px;height:7px;margin-right:4px;border-radius:50%;background:#27c67a}button,textarea,input{font:inherit}header button{border:0;border-radius:16px;padding:8px 11px;color:var(--brand);background:#edf3ff;font-size:13px;cursor:pointer}.messages{flex:1;overflow:auto;padding:16px}.row{display:flex;gap:8px;align-items:flex-end;margin:12px 0}.row.user{justify-content:flex-end}.row.system{justify-content:center}.msg-avatar{flex:0 0 30px;width:30px;height:30px;display:grid;place-items:center;border-radius:50%;background:#dce7ff;color:var(--brand);font-size:12px}.bubble{max-width:78%;padding:10px 12px;border-radius:15px;border-bottom-left-radius:4px;background:#fff;box-shadow:0 2px 8px #22375910;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.5}.user .bubble{color:#fff;background:var(--brand);border-bottom-right-radius:4px;border-bottom-left-radius:15px}.system .bubble{padding:6px 10px;color:var(--muted);background:#e9edf3;border-radius:12px;box-shadow:none;font-size:12px}.chat-image{display:block;max-width:min(250px,62vw);max-height:280px;border-radius:9px}.time{margin-top:4px;color:#a1aab8;font-size:10px}.typing{padding:0 16px 10px;color:var(--muted);font-size:12px}.typing b{display:inline-block;width:5px;height:5px;margin-left:3px;border-radius:50%;background:var(--brand);animation:b 1s infinite}.typing b:nth-child(2){animation-delay:.15s}.typing b:nth-child(3){animation-delay:.3s}@keyframes b{0%,60%,100%{transform:translateY(0);opacity:.35}30%{transform:translateY(-4px);opacity:1}}.hide{display:none!important}.quick{display:flex;gap:8px;padding:8px 12px;overflow:auto;background:#fff;border-top:1px solid var(--line)}.quick button{flex:0 0 auto;border:1px solid #cddcff;border-radius:18px;padding:7px 11px;color:var(--brand);background:#fff;font-size:12px;cursor:pointer}.preview{padding:8px 14px;background:#fff}.preview img{width:64px;height:64px;object-fit:cover;border-radius:8px}.preview small{display:block;color:var(--muted);font-size:11px}footer{display:flex;gap:8px;align-items:flex-end;padding:10px 12px max(12px,env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line)}.icon{width:30px;height:36px;border:0;background:transparent;font-size:19px;cursor:pointer}textarea{flex:1;min-width:0;min-height:38px;max-height:96px;padding:8px 10px;resize:none;outline:0;border:1px solid var(--line);border-radius:12px;background:#f7f9fc;line-height:20px}.send{height:36px;min-width:52px;border:0;border-radius:10px;color:#fff;background:var(--brand);cursor:pointer}.send:disabled{opacity:.5}.access-gate{position:absolute;z-index:5;inset:0;display:grid;place-items:center;padding:22px;background:linear-gradient(150deg,#edf4ff,#f8fbff)}.access-card{width:min(100%,360px);padding:30px 24px;border:1px solid #e4ebf7;border-radius:22px;background:#fff;box-shadow:0 18px 46px #1e3c7130;text-align:center}.gate-logo{width:58px;height:58px;margin:0 auto 16px;display:grid;place-items:center;border-radius:18px;color:#fff;font-size:24px;font-weight:700;background:linear-gradient(135deg,#3978f6,#81a4ff)}.access-card h1{font-size:21px}.access-card p{margin:9px 0 22px;color:var(--muted);font-size:13px}.access-card input{width:100%;height:45px;padding:0 13px;border:1px solid #dce4f1;border-radius:11px;outline:none}.access-card input:focus{border-color:var(--brand);box-shadow:0 0 0 3px #e8f0ff}.access-card button{width:100%;height:44px;margin-top:12px;border:0;border-radius:11px;color:#fff;background:var(--brand);cursor:pointer}.access-error{min-height:20px;margin-top:10px;color:#e5484d;font-size:13px}@media(min-width:481px){.app{min-height:calc(100dvh - 24px);margin:12px auto;border-radius:18px;overflow:hidden}}
