:root{color-scheme:light;--ink:#173d45;--muted:#71838b;--green:#176e62;--pale:#e3f1e9;--border:#dce6df}
*{box-sizing:border-box}
html,body{margin:0;height:100%;font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;background:#fbfcf9;color:var(--ink);font-size:15px}
button,input,textarea{font:inherit;color:inherit}
button,a,input,textarea{touch-action:manipulation}
button{border:1px solid transparent;background:transparent;cursor:pointer;min-height:44px;border-radius:10px;padding:10px 14px}
button:disabled{opacity:.5;cursor:wait}
button:hover{background:#edf3ef}
button:focus-visible,a:focus-visible{outline:2px solid var(--green);outline-offset:3px}
input,textarea{border:1px solid var(--border);border-radius:12px;background:white;padding:13px;min-width:0;width:100%}
textarea{resize:none;line-height:1.6}
textarea:focus{outline:none}
input:focus,textarea:focus-visible{outline:2px solid #81b6a7}
[hidden]{display:none!important}
.primary{background:var(--green);color:white}
.primary:hover{background:#0b584e}
.shell{display:flex;height:100%;height:100dvh;min-height:0}
#sidebar{width:248px;flex-shrink:0;padding:34px 23px 18px;border-right:1px solid var(--border);background:#f7faf5;display:flex;flex-direction:column}
.brand{font-size:27px;font-weight:750;letter-spacing:-1px}
.brand span{font-size:16px;letter-spacing:-.5px}
.tagline{color:var(--muted);font-size:12px;margin:5px 0 30px}
.new{width:100%;margin-bottom:28px}
.section-label{font-size:12px;font-weight:600;letter-spacing:1px;color:var(--muted);margin:0 4px 12px}
#history{flex:1;overflow:auto;min-height:0}
#history button{width:100%;text-align:left;margin-bottom:6px;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#history button.selected{background:var(--pale);font-weight:600}
#history small{display:block;color:var(--muted);font-size:11px;font-weight:400;margin-top:5px}
.utilities{border-top:1px solid var(--border);padding-top:15px;display:flex;flex-direction:column;gap:5px}
.utilities button{text-align:left}
main{flex:1;min-width:0;display:flex;flex-direction:column;background:#fffefb}
header{display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--border);min-height:68px;padding:8px 23px}
header h1{font-size:16px;flex:1;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
header h1 span{font-size:13px}
.motto{font-size:12px;color:var(--muted)}
#menu,#details{font-size:20px}
#menu{display:none}
#messages{flex:1;overflow-y:auto;min-height:0;padding:24px max(24px,calc((100% - 960px)/2));scroll-behavior:smooth;overflow-wrap:anywhere}
.quiet{height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;opacity:.75}
.quiet img{width:80px;border-radius:25px}
.quiet p{color:var(--muted);font-size:13px}
.message{display:flex;gap:16px;margin-bottom:28px;align-items:flex-start}
.message.user{justify-content:flex-end}
.avatar{height:38px;width:38px;border-radius:50%;object-fit:cover;flex-shrink:0}
.content{max-width:85%;min-width:0;line-height:1.85}
.user .content{max-width:75%}
.bubble{white-space:pre-wrap;margin:0}
.user .bubble{background:var(--pale);padding:10px 17px;border-radius:16px 16px 4px 16px}
.choices{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}
.choices button{border-color:#ccded8;background:white;font-size:13px;border-radius:18px;padding:7px 17px}
.step{border:1px solid var(--border);padding:16px 20px;border-radius:16px;margin-top:15px;background:#f9fbf7}
.step h3{font-size:15px;margin:0 0 7px}
.step p{margin:6px 0}
.warning{color:#8a572c;font-size:13px}
.sources{font-size:12px;margin-top:13px}
.sources a{display:block;color:var(--green);margin:5px 0}
.message-image{display:block;max-width:340px;max-height:300px;width:100%;object-fit:contain;border-radius:12px;margin-top:10px;border:1px solid var(--border);cursor:zoom-in}
.compose-wrap{flex-shrink:0;width:100%;max-width:1010px;align-self:center;padding:12px 24px max(12px,env(safe-area-inset-bottom))}
#composer{background:white;border:1px solid #cddfd6;border-radius:19px;padding:9px 10px;box-shadow:0 4px 24px #173d4508}
#draft{border:0;background:transparent;padding:5px 8px;min-height:42px;max-height:140px}
.compose-tools{display:flex;gap:2px;align-items:center}
.compose-tools button{font-size:23px;padding:6px 13px}
#hint{flex:1;font-size:11px;color:#8b9b9f;padding-left:10px}
.send{width:42px;height:42px;min-height:42px;border-radius:50%;font-size:25px!important}
.privacy{margin:7px 3px 0;text-align:right;font-size:10px;color:#97a2a5}
#status{padding:10px 25px;background:#f8eddc;font-size:13px}
#status button{min-height:28px;text-decoration:underline;padding:3px 10px}
#pending-images{display:flex;gap:12px;padding:4px}
#pending-images img{height:65px;border-radius:8px}
#confirmation{font-size:13px;padding:10px;background:#ecf4ef;border-radius:12px;margin-bottom:8px}
#confirmation button{background:white;border:1px solid var(--border);margin:5px}
.modal-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.modal-head h2{font-size:21px}
#modal{position:fixed;inset:0;background:#153e3c38;display:flex;align-items:center;justify-content:center;padding:20px;z-index:30}
.modal-box{background:#fffefb;border-radius:22px;padding:18px 25px 28px;width:480px;max-width:100%;max-height:90vh;overflow:auto;box-shadow:0 20px 90px #163e3b22}
.modal-box p{font-size:13px;line-height:1.7;color:var(--muted)}
.modal-box label{display:block;font-size:13px;margin:14px 0 6px}
.modal-box .primary{width:100%;margin-top:18px}
.modal-box textarea{min-height:140px}
.modal-box a{color:var(--green)}
.product{width:100%;text-align:left;border:1px solid var(--border);margin-top:10px}
.product small{display:block;font-size:12px;color:var(--muted);margin:8px 0}
#toast{position:fixed;bottom:110px;left:50%;transform:translateX(-50%);background:#173d45;color:white;padding:12px 20px;border-radius:12px;z-index:60;max-width:90%;font-size:13px}
.skip{position:fixed;left:10px;top:-60px;z-index:99;background:white}
.skip:focus{top:10px}
#shade{position:fixed;inset:0;background:#153e3c44;border-radius:0;z-index:19}
body.sidebar-hidden #sidebar{display:none}
body.sidebar-hidden #menu{display:block}
@media(min-width:801px){#menu{display:block}
}
@media(max-width:800px){#sidebar{display:none;position:fixed;inset:0 auto 0 0;z-index:20;width:275px;height:100%;box-shadow:10px 0 40px #153e3c15}
body.menu-open #sidebar{display:flex}
#menu{display:block}
header{min-height:74px;padding:10px 13px;gap:6px}
header h1{font-size:17px}
.motto{font-size:10px;max-width:68px;line-height:1.6}
#messages{padding:22px 16px}
.message{gap:10px;margin-bottom:25px}
.avatar{width:31px;height:31px}
.content{max-width:calc(100% - 41px);font-size:14px}
.user .content{max-width:90%}
.compose-wrap{padding:8px 12px max(10px,env(safe-area-inset-bottom))}
.privacy{font-size:9px}
#hint{font-size:10px}
#composer{border-radius:16px}
.choices{gap:7px}
.choices button{font-size:12px;padding:6px 12px}
.modal-box{padding:12px 19px 22px}
.message-image{max-width:290px}
}
@media(prefers-reduced-motion:reduce){#messages{scroll-behavior:auto}
}


/* v0.8 reference geometry: one slim toolbar, no second action row. */
#sidebar{width:228px;padding:28px 16px 18px}

header{min-height:52px;padding:2px 18px}

#messages{padding-top:18px;padding-bottom:18px}

.compose-wrap{max-width:1010px;padding:8px 22px max(16px,env(safe-area-inset-bottom))}

#composer{display:flex;align-items:center;gap:0;min-height:54px;padding:2px 4px;border-radius:15px;box-shadow:0 3px 16px #173d4505}

#composer button{display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:48px;min-height:48px;padding:0;color:var(--green);border:0}

#composer svg{display:block;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

#composer #draft{flex:1;width:0;min-width:0;height:24px;min-height:24px;max-height:132px;border:0;border-radius:0;padding:1px 5px;background:transparent;font-size:14px;line-height:22px;overflow-y:auto;box-shadow:none}

#draft::placeholder{font-size:12px;color:#8a98a4;white-space:nowrap;text-overflow:ellipsis}

#composer #send{background:transparent;border-radius:10px}

#send span{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--green);color:white;box-shadow:inset 0 2px 5px #ffffff30}

#send svg{width:19px;height:19px}

#send:disabled{opacity:.65;cursor:default}

#composer:focus-within{border-color:#8db9ab}

@media(max-width:800px){
 #sidebar{width:260px}

 header{min-height:56px;padding:4px 12px}

 header h1{font-size:15px}

 .compose-wrap{padding:6px 10px max(12px,env(safe-area-inset-bottom))}

 #composer{min-height:54px;border-radius:14px}

 #composer button{flex-basis:42px;width:42px}

 #messages{padding:18px 14px}

 .message{gap:10px;margin-bottom:24px}

 .content{font-size:14px;line-height:1.75}

}


.heading{flex:1;min-width:0}.heading h1{font-weight:650}
#header-tagline{display:none;margin:7px 0 0;color:var(--muted);font-size:12px}
.utilities button{display:flex;align-items:center;gap:16px}
.icon{width:21px;height:21px;flex-shrink:0}
@media(max-width:800px){
 body:not(.conversation) header{position:relative;min-height:108px;padding:22px 18px 34px;align-items:flex-start;border-bottom:0}
 body:not(.conversation) .heading{order:1;padding-top:5px}
 body:not(.conversation) .heading h1{font-size:20px}
 body:not(.conversation) #header-tagline{display:block}
 body:not(.conversation) #menu{order:2;padding:4px;width:40px}
 body:not(.conversation) #details{display:none}
 body:not(.conversation) .motto{position:absolute;right:18px;bottom:6px;font-size:12px;max-width:75px;line-height:1.5}
 body.conversation .motto{display:none}
}

.motto span:first-child::after{content:"，"}@media(max-width:800px){.motto span{display:block;white-space:nowrap}.motto span:first-child::after{content:""}}

/* Long drafts use the whole composer width; only real overflow scrolls. */
/* Composite-only motion; no height/width or shadow animation during typing. */
@keyframes message-arrive{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
.message-new{animation:message-arrive .22s cubic-bezier(.22,1,.36,1) both}
button{transition:background-color .14s ease,color .14s ease,transform .12s ease}
button:active:not(:disabled){transform:scale(.985)}
@media(prefers-reduced-motion:reduce){.message{animation:none}button{transition:none}button:active:not(:disabled){transform:none}}
#composer{display:grid;grid-template-columns:44px 44px minmax(0,1fr) 44px 44px}
#composer #camera{grid-column:1}#composer #upload{grid-column:2}
#composer #draft{grid-column:3;width:100%;outline:none;scrollbar-width:thin;scrollbar-color:#b5c9c0 transparent}
#composer #voice{grid-column:4}#composer #send{grid-column:5}
#composer #draft::-webkit-scrollbar{width:4px}
#composer #draft::-webkit-scrollbar-thumb{background:#b5c9c0;border-radius:4px}
#composer #draft::-webkit-scrollbar-button{display:none}
#composer.expanded #draft{grid-column:1/-1;grid-row:1;width:calc(100% - 16px);margin:6px 8px 2px;padding:2px 4px}
#composer.expanded button{grid-row:2}
@media(max-width:800px){#composer{grid-template-columns:42px 42px minmax(0,1fr) 42px 42px}.motto{letter-spacing:0;text-align:right}.motto span{white-space:nowrap}}

/* Motion board v2: local expansion only; no scaling text or moving navigation. */
#composer{overflow:hidden;align-content:end;transition:border-color .18s ease}
#composer.expanded{grid-template-rows:minmax(0,1fr) 48px}
#composer.expanded #draft{align-self:end;min-height:0}
.message-new{animation-fill-mode:backwards}
@media(max-width:800px){
 #sidebar{display:flex;transform:translateX(-100%);visibility:hidden;transition:transform .28s cubic-bezier(.2,0,0,1),visibility 0s .28s}
 body.menu-open #sidebar{visibility:visible;transform:translateX(0);transition-delay:0s}
}
@media(prefers-reduced-motion:reduce){
 #composer,#sidebar{transition:none!important}.message-new{animation:none}
}

/* Progress belongs to the current assistant turn, never a top banner. */
#live-answer .activity{display:table;margin:0 0 10px;padding:6px 11px;border-radius:8px;background:#edf5f0;color:#5a7d72;font-size:12px;line-height:1.5}
#live-answer .bubble{white-space:pre-wrap}
.image-caption{font-size:12px;line-height:1.5;color:#617972;margin:6px 0 12px;overflow-wrap:anywhere}
