:root{
  color-scheme:light;
  --ink:#20242a;
  --muted:#6c737d;
  --line:rgba(36,40,46,.12);
  --paper:rgba(255,255,255,.92);
  --canvas:#f3f1eb;
  --yellow:#f2b84b;
  --yellow-deep:#d9931d;
  --blue:#2f80ed;
  --blue-deep:#1765ca;
  --shadow:0 24px 70px rgba(57,51,39,.14);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:var(--ink)}
body{min-height:100dvh;background:
  radial-gradient(circle at 8% 4%,rgba(242,184,75,.24),transparent 30%),
  radial-gradient(circle at 94% 94%,rgba(47,128,237,.13),transparent 32%),var(--canvas)}
button,textarea{font:inherit}
button,a{-webkit-tap-highlight-color:transparent}
.assistant-app{width:min(1220px,100%);min-height:100dvh;margin:0 auto;padding:18px 24px 24px}
.app-bar{height:58px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.brand{display:flex;align-items:center;gap:11px;color:inherit;text-decoration:none}
.brand-mark{display:grid;place-items:center;width:40px;height:40px;border-radius:13px;background:var(--yellow);color:#30250f;box-shadow:0 8px 18px rgba(217,147,29,.22)}
.brand strong,.brand small{display:block}.brand strong{font-size:15px;letter-spacing:.02em}.brand small{margin-top:2px;color:var(--muted);font-size:11px}
.app-actions{display:flex;align-items:center;gap:8px}
.status-pill{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:0 12px;border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.62);color:var(--muted);font-size:12px}
.status-dot{width:7px;height:7px;border-radius:50%;background:#98a0aa;box-shadow:0 0 0 4px rgba(152,160,170,.12)}
.status-pill.ready .status-dot{background:#2dac68;box-shadow:0 0 0 4px rgba(45,172,104,.13)}
.status-pill.demo .status-dot{background:var(--yellow-deep);box-shadow:0 0 0 4px rgba(217,147,29,.13)}
.status-pill.error .status-dot{background:#dc5151;box-shadow:0 0 0 4px rgba(220,81,81,.12)}
.icon-button{display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid var(--line);border-radius:11px;background:rgba(255,255,255,.68);color:var(--muted);cursor:pointer;transition:transform .15s,background .15s,color .15s}
.icon-button:hover,.icon-button:focus-visible{transform:translateY(-1px);background:#fff;color:var(--ink);outline:none}
.auth-button{display:flex;align-items:center;gap:7px;height:36px;max-width:180px;padding:0 12px;border:1px solid rgba(47,128,237,.24);border-radius:11px;background:rgba(47,128,237,.08);color:var(--blue-deep);cursor:pointer;transition:transform .15s,background .15s,border-color .15s}
.auth-button span{overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.auth-button:hover,.auth-button:focus-visible{transform:translateY(-1px);border-color:rgba(47,128,237,.46);background:rgba(47,128,237,.14);outline:none}.auth-button.authenticated{border-color:rgba(45,172,104,.28);background:rgba(45,172,104,.09);color:#218653}
.profile-button{display:flex;align-items:center;gap:7px;max-width:210px;height:36px;padding:0 11px;border:1px solid var(--line);border-radius:11px;background:rgba(255,255,255,.68);color:var(--muted);cursor:pointer;transition:transform .15s,background .15s,color .15s,border-color .15s}
.profile-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.profile-button i{flex:0 0 auto;color:var(--blue)}
.profile-button:hover,.profile-button:focus-visible{transform:translateY(-1px);border-color:rgba(47,128,237,.32);background:#fff;color:var(--ink);outline:none}
.profile-button.selected{border-color:rgba(47,128,237,.28);background:rgba(47,128,237,.08);color:var(--blue-deep)}
.profile-button:disabled{cursor:wait;opacity:.55;transform:none}
.assistant-layout{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:18px;height:calc(100dvh - 100px);min-height:620px;max-height:920px}
.chat-card,.guide-card{border:1px solid rgba(255,255,255,.72);background:var(--paper);box-shadow:var(--shadow);backdrop-filter:blur(18px)}
.chat-card{position:relative;display:flex;min-width:0;min-height:0;flex-direction:column;overflow:hidden;border-radius:24px}
.chat-context{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding:24px 26px 18px;border-bottom:1px solid var(--line)}
.eyebrow,.guide-label{color:var(--blue);font-weight:700;font-size:11px;letter-spacing:.12em;text-transform:uppercase}
.chat-context h1{margin:5px 0 0;font-size:clamp(20px,3vw,30px);line-height:1.18;letter-spacing:-.035em}
.chat-context a{flex:0 0 auto;color:var(--blue-deep);font-size:12px;text-decoration:none}.chat-context a:hover{text-decoration:underline}
.auth-gate[hidden]{display:none!important}.auth-gate{position:absolute;inset:0;z-index:30;display:grid;place-items:center;padding:24px;background:rgba(243,241,235,.88);backdrop-filter:blur(14px)}
.auth-gate-card{display:flex;width:min(430px,100%);flex-direction:column;align-items:center;padding:34px 30px;border:1px solid rgba(255,255,255,.82);border-radius:24px;background:rgba(255,255,255,.94);box-shadow:0 24px 70px rgba(57,51,39,.18);text-align:center}.auth-gate-icon{display:grid;place-items:center;width:58px;height:58px;margin-bottom:17px;border-radius:19px;background:rgba(242,184,75,.2);color:var(--yellow-deep);font-size:24px}.auth-gate-card h2{margin:7px 0 9px;font-size:24px;letter-spacing:-.025em}.auth-gate-card p{max-width:340px;margin:0;color:var(--muted);font-size:13px;line-height:1.65}.auth-gate-card button{display:flex;align-items:center;justify-content:center;gap:9px;margin-top:22px;padding:12px 20px;border:0;border-radius:13px;background:var(--blue);color:#fff;font-weight:700;cursor:pointer;box-shadow:0 9px 22px rgba(47,128,237,.24);transition:transform .15s,background .15s}.auth-gate-card button:hover,.auth-gate-card button:focus-visible{transform:translateY(-1px);background:var(--blue-deep);outline:none}
.profile-panel[hidden]{display:none!important}
.profile-panel{position:absolute;inset:0;z-index:20;display:grid;place-items:center;padding:22px;background:rgba(29,34,41,.32);backdrop-filter:blur(7px)}
.profile-panel-card{display:flex;width:min(860px,100%);max-height:calc(100% - 8px);flex-direction:column;overflow:hidden;border:1px solid rgba(255,255,255,.75);border-radius:22px;background:#fbfbfc;box-shadow:0 26px 80px rgba(24,32,43,.3)}
.profile-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:22px 24px 17px;border-bottom:1px solid var(--line)}
.profile-panel-head h2{margin:5px 0 5px;font-size:22px;letter-spacing:-.025em}.profile-panel-head p{max-width:650px;margin:0;color:var(--muted);font-size:12px;line-height:1.55}
.profile-groups{display:grid;gap:22px;overflow:auto;padding:20px 24px;transition:opacity .15s}.profile-groups.loading{pointer-events:none;opacity:.48}
.profile-group h3{margin:0 0 10px;color:var(--muted);font-size:11px;letter-spacing:.08em;text-transform:uppercase}
.profile-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.profile-option{display:flex;align-items:flex-start;gap:11px;min-width:0;padding:13px;border:1px solid var(--line);border-radius:14px;background:#fff;color:var(--ink);text-align:left;cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .15s}
.profile-option:hover,.profile-option:focus-visible{transform:translateY(-1px);border-color:rgba(47,128,237,.38);box-shadow:0 8px 20px rgba(47,128,237,.09);outline:none}.profile-option.active{border-color:rgba(47,128,237,.55);background:rgba(47,128,237,.06)}
.profile-option-icon{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border-radius:11px;background:rgba(242,184,75,.18);color:var(--yellow-deep)}
.profile-option-copy{display:block;min-width:0;flex:1}.profile-option-copy strong,.profile-option-copy small,.profile-option-copy em{display:block}.profile-option-copy strong{font-size:13px}.profile-option-copy small{margin-top:3px;color:var(--muted);font-size:11px;line-height:1.45}.profile-option-copy em{overflow:hidden;margin-top:5px;color:#8a919b;font-family:"SFMono-Regular",Consolas,monospace;font-size:9px;font-style:normal;text-overflow:ellipsis;white-space:nowrap}
.profile-option-check{display:none;margin-top:8px;color:var(--blue)}.profile-option.active .profile-option-check{display:block}
.profile-unknown{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 24px 20px;padding:11px;border:1px dashed rgba(47,128,237,.34);border-radius:13px;background:rgba(47,128,237,.04);color:var(--blue-deep);font-size:12px;cursor:pointer}.profile-unknown:hover,.profile-unknown:focus-visible{background:rgba(47,128,237,.09);outline:none}
.messages{flex:1;min-height:0;overflow-y:auto;padding:22px 26px;scroll-behavior:smooth}
.message-row{display:flex;gap:10px;margin:0 0 16px}.message-row.user{justify-content:flex-end}
.message-avatar{display:block;flex:0 0 38px;width:38px;height:38px;overflow:hidden;border:1px solid rgba(36,40,46,.12);border-radius:12px;background:var(--yellow);box-shadow:0 4px 12px rgba(57,51,39,.12)}
.message-avatar img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
.message-bubble{max-width:min(78%,720px);padding:11px 14px;border-radius:5px 16px 16px 16px;background:#f0f1f3;color:var(--ink);font-size:14px;line-height:1.72;white-space:pre-wrap;word-break:break-word}
.message-row.user .message-bubble{border-radius:16px 5px 16px 16px;background:var(--blue);color:#fff}
.message-bubble pre{max-width:100%;overflow:auto;margin:7px 0;padding:11px;border-radius:10px;background:#20252d;color:#e9edf3;white-space:pre;font-family:"SFMono-Regular",Consolas,monospace;font-size:12px}
.message-bubble code{padding:1px 4px;border-radius:4px;background:rgba(0,0,0,.08);font-family:"SFMono-Regular",Consolas,monospace;font-size:.92em}.message-row.user code{background:rgba(255,255,255,.17)}
.suggestions{display:flex;flex-wrap:wrap;gap:7px;padding:0 26px 12px}
.suggestions button{padding:7px 11px;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--muted);font-size:12px;cursor:pointer;transition:border-color .15s,color .15s,background .15s}
.suggestions button:hover,.suggestions button:focus-visible{border-color:rgba(47,128,237,.35);background:rgba(47,128,237,.06);color:var(--blue-deep);outline:none}
.composer{display:flex;align-items:flex-end;gap:10px;margin:0 20px;padding:10px 10px 10px 15px;border:1px solid rgba(47,128,237,.2);border-radius:17px;background:#fff;box-shadow:0 8px 22px rgba(45,58,75,.08)}
.composer:focus-within{border-color:rgba(47,128,237,.55);box-shadow:0 8px 24px rgba(47,128,237,.12)}
.composer textarea{flex:1;min-height:26px;max-height:140px;padding:3px 0;border:0;outline:0;resize:none;background:transparent;color:var(--ink);font-size:14px;line-height:1.5}
.composer textarea::placeholder{color:#9aa0a9}
.send-button{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;border:0;border-radius:12px;background:var(--blue);color:#fff;cursor:pointer;box-shadow:0 7px 16px rgba(47,128,237,.25);transition:transform .15s,background .15s}
.send-button:hover,.send-button:focus-visible{transform:translateY(-1px);background:var(--blue-deep);outline:none}.send-button:disabled{cursor:wait;transform:none;opacity:.55}
.disclaimer{margin:8px 22px 14px;color:#8a9099;text-align:center;font-size:10px;line-height:1.5}
.guide-card{align-self:stretch;overflow:auto;padding:26px 23px;border-radius:24px}
.guide-card h2{margin:7px 0 22px;font-size:21px;line-height:1.25;letter-spacing:-.025em}
.guide-card ul{display:grid;gap:18px;margin:0;padding:0;list-style:none}.guide-card li{display:flex;align-items:flex-start;gap:11px}.guide-card li>i{display:grid;place-items:center;width:30px;height:30px;color:var(--blue);font-size:15px}.guide-card li span{color:var(--muted);font-size:12px;line-height:1.55}.guide-card li strong{display:block;margin-bottom:2px;color:var(--ink);font-size:13px}
.safety-note{display:flex;gap:10px;margin:24px 0 14px;padding:13px;border-radius:14px;background:rgba(242,184,75,.15);color:#6b511d}.safety-note>i{margin-top:2px;color:var(--yellow-deep)}.safety-note p{margin:0;font-size:11px;line-height:1.55}.safety-note strong{display:block;margin-bottom:2px;color:#5a4316}
.guide-link{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px 12px;border:1px solid rgba(47,128,237,.19);border-radius:12px;background:rgba(47,128,237,.06);color:var(--blue-deep);font-size:12px;text-decoration:none}.guide-link:hover{background:rgba(47,128,237,.1)}
@media(max-width:960px){.assistant-layout{grid-template-columns:minmax(0,1fr)}.guide-card{display:none}}
@media(max-width:640px){
  .assistant-app{padding:0}.app-bar{height:62px;padding:0 12px;background:rgba(243,241,235,.88);backdrop-filter:blur(14px)}
  .brand-mark{width:36px;height:36px;border-radius:11px}.brand small{display:none}.status-pill{padding:0 9px}.status-pill{font-size:11px}.auth-button{width:38px;padding:0;justify-content:center}.auth-button span{display:none}.profile-button{max-width:42px;width:42px;padding:0;justify-content:center}.profile-button span{display:none}
  .assistant-layout{height:calc(100dvh - 62px);min-height:0;max-height:none}.chat-card{border:0;border-radius:0;box-shadow:none;background:rgba(255,255,255,.94)}
  .chat-context{align-items:flex-start;padding:18px 16px 13px}.chat-context h1{font-size:20px}.chat-context a{margin-top:4px;font-size:0}.chat-context a i{font-size:14px}
  .messages{padding:17px 14px}.message-bubble{max-width:86%;font-size:13px}.suggestions{flex-wrap:nowrap;overflow-x:auto;padding:0 14px 10px;scrollbar-width:none}.suggestions::-webkit-scrollbar{display:none}.suggestions button{flex:0 0 auto}
  .composer{margin:0 10px;padding-left:12px}.disclaimer{margin:7px 14px 10px}.icon-button{width:34px;height:34px}
  .profile-panel{padding:0;place-items:stretch}.profile-panel-card{width:100%;max-height:100%;border:0;border-radius:0}.profile-panel-head{padding:18px 16px 14px}.profile-panel-head h2{font-size:19px}.profile-groups{padding:16px}.profile-list{grid-template-columns:1fr}.profile-unknown{margin:0 16px 16px}.auth-gate{padding:18px}.auth-gate-card{padding:28px 20px}.auth-gate-card h2{font-size:21px}
}
@media(prefers-color-scheme:dark){
  :root{color-scheme:dark;--ink:#edf0f4;--muted:#a1a8b2;--line:rgba(255,255,255,.11);--paper:rgba(30,33,38,.92);--canvas:#181a1e;--shadow:0 24px 70px rgba(0,0,0,.38)}
  body{background:radial-gradient(circle at 8% 4%,rgba(242,184,75,.13),transparent 30%),radial-gradient(circle at 94% 94%,rgba(47,128,237,.13),transparent 32%),var(--canvas)}
  .status-pill,.icon-button,.profile-button{background:rgba(36,39,45,.72)}.icon-button:hover,.icon-button:focus-visible,.profile-button:hover,.profile-button:focus-visible{background:#2c3037}.message-bubble{background:#30343b}.composer{background:#24272d}.message-bubble code{background:rgba(255,255,255,.09)}.auth-gate{background:rgba(24,26,30,.9)}.auth-gate-card{border-color:rgba(255,255,255,.12);background:rgba(35,38,44,.97)}
  .profile-panel-card{border-color:rgba(255,255,255,.12);background:#23262c}.profile-option{background:#2c3037}.profile-button.selected{background:rgba(47,128,237,.14)}
  @media(max-width:640px){.app-bar{background:rgba(24,26,30,.9)}.chat-card{background:rgba(30,33,38,.96)}}
}
