@charset "UTF-8";
:root{color-scheme:light;--paper:#f7f2e8;--ink:#342d28;--muted:#766b60;--line:#d9cebf;--green:#705141;--wash:#eee6d8;--white:#fffcf6;--serif:"Songti SC","STSong","Noto Serif CJK SC",Georgia,serif;--font:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Helvetica Neue",sans-serif}
*{box-sizing:border-box}html,body{margin:0;height:100%;overscroll-behavior:none}body{background:var(--paper);color:var(--ink);font:15px/1.6 var(--font);-webkit-font-smoothing:antialiased}button,input,textarea{font:inherit;color:inherit}button{cursor:pointer;border:0;background:none;-webkit-tap-highlight-color:transparent}button:disabled{cursor:default}button,input,textarea,a{-webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible{outline:2px solid #9a7156;outline-offset:4px}button{touch-action:manipulation}svg{width:20px;height:20px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}input,textarea{outline:none}a{color:var(--green);text-underline-offset:3px}[hidden]{display:none!important}.sr-only{position:absolute;clip:rect(0,0,0,0);width:1px;height:1px;overflow:hidden;white-space:nowrap}
.app{height:100vh;height:100dvh;display:flex;flex-direction:column;max-width:1120px;margin:auto;padding-top:env(safe-area-inset-top)}.topbar{height:92px;flex:none;display:flex;align-items:center;justify-content:space-between;padding:0 44px}.brand{display:flex;align-items:center;gap:10px;padding:8px 0;text-align:left;color:#542d37}.topbar nav{display:flex;align-items:center;gap:7px}.nav-divider{width:1px;height:16px;background:var(--line);margin:0 8px}.icon-button{width:42px;height:42px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#776b60;flex:none;transition:background .18s,color .18s,transform .18s}.icon-button:hover{background:var(--wash);color:var(--ink)}.icon-button:active{transform:scale(.94)}.dark,.send{background:var(--ink);color:var(--white)}.dark:hover,.send:hover{background:#68414b;color:#fff}
.scroll-area{flex:1;overflow:auto;scroll-behavior:smooth;scrollbar-width:thin;scrollbar-color:#d8cab6 transparent;padding:0 36px}.welcome{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px 0 68px;animation:appear .45s ease}.welcome h1{font:500 32px/1.5 var(--serif);letter-spacing:1px;margin:23px 0 10px;text-align:center}.suggestions{display:flex;gap:12px}.suggestions button{border:1px solid var(--line);border-radius:14px;padding:13px 16px;display:flex;gap:13px;align-items:center;background:#ffffff60;font-size:13px;transition:border-color .2s,background .2s}.suggestions button:hover{background:#fff;border-color:#bda98e}.suggestions svg{width:17px;height:17px;color:var(--green)}.suggest-arrow{margin-left:14px;opacity:.5}.suggest-arrow svg{width:14px;height:14px}
.messages{width:100%;max-width:710px;margin:auto;padding:20px 0 30px}.messages:empty{display:none}.message{margin-bottom:30px;animation:appear .22s ease;min-width:0}.message.user{display:flex;justify-content:flex-end}.user .message-text{white-space:pre-wrap;overflow-wrap:anywhere;max-width:88%;background:#ece3d5;padding:13px 19px;border-radius:20px 20px 5px 20px;font-size:15px;line-height:1.7}.assistant{padding:0 3px}.assistant .message-text{font-family:var(--serif);font-size:17px;line-height:1.95;overflow-wrap:anywhere}.message-text> :first-child{margin-top:0}.message-text> :last-child{margin-bottom:0}.message-text p{margin:0 0 14px}.message-text h1,.message-text h2,.message-text h3{font-size:17px;line-height:1.6;margin:24px 0 12px;font-weight:600}.message-text ul,.message-text ol{padding-left:23px;margin:12px 0}.message-text li{padding-left:3px;margin:5px 0}.message-text strong{font-weight:600}.message-text pre{max-width:100%;overflow:auto;border:1px solid var(--line);background:#eee7db;padding:14px;border-radius:12px;line-height:1.6;font-size:12px}.message-text code{font-size:.88em;background:#eee7db;border-radius:4px;padding:2px 4px;font-family:ui-monospace,SFMono-Regular,monospace}.message-text pre code{background:none;padding:0}.message-text table{border-collapse:collapse;display:block;overflow:auto;font-size:13px;max-width:100%}.message-text th,.message-text td{padding:9px 12px;border-bottom:1px solid var(--line);text-align:left}.message-text blockquote{margin:12px 0;border-left:2px solid #bba387;padding-left:15px;color:#716557}.message-text hr{border:0;border-top:1px solid var(--line);margin:20px 0}.message-meta{display:flex;align-items:center;min-height:28px;margin-top:8px;gap:7px;color:var(--muted);font-size:11px}.message-meta .icon-button{width:28px;height:28px}.message-meta svg{width:14px;height:14px}.message-error{font-size:13px;color:#a26b54;margin-top:10px}.pending-dots{height:27px;display:flex;align-items:center;gap:5px}.pending-dots i{display:block;width:5px;height:5px;background:#aa8f72;border-radius:50%;animation:pulse 1.2s infinite}.pending-dots i:nth-child(2){animation-delay:.15s}.pending-dots i:nth-child(3){animation-delay:.3s}.tool-status{display:flex;gap:7px;align-items:center;font-size:12px;color:#776553;margin-bottom:12px}.tool-status svg{width:14px;height:14px}.sources{display:flex;gap:7px;flex-wrap:wrap;margin:15px 0 2px}.source{display:flex;gap:7px;align-items:center;max-width:210px;border:1px solid var(--line);border-radius:9px;background:#ffffff80;padding:6px 9px;text-decoration:none;color:#776553;font-size:11px}.source span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.source svg{width:12px;height:12px;flex:none}.source:hover{border-color:#b59c7f;background:#fff}
.action-card{margin:14px 0;max-width:420px;border:1px solid #d6c7b2;background:#f0e8d9;border-radius:16px;padding:15px;display:flex;gap:12px;align-items:center}.action-symbol{color:#85694c;flex:none}.action-copy{flex:1;min-width:0}.action-copy strong{font-weight:500;font-size:13px;display:block;overflow-wrap:anywhere}.action-copy small{font-size:12px;color:#746451}.confirm-action{padding:8px 12px;border-radius:10px;background:#65414a;color:white;font-size:12px;white-space:nowrap}.confirm-action:hover{background:#542d37}.confirm-action:disabled{background:#e5d9c8;color:#766856}.action-card.failed{background:#f5eee8;border-color:#e8ddd1}
.composer-wrap{width:100%;max-width:782px;margin:auto;padding:0 36px max(12px,env(safe-area-inset-bottom));flex:none;background:var(--paper)}.composer{border:1px solid #cfc1ac;border-radius:22px;padding:16px 14px 11px;background:var(--white);box-shadow:none;transition:border-color .2s,box-shadow .2s}.composer:focus-within{border-color:#a48969;box-shadow:none}.composer textarea{display:block;resize:none;border:0;background:transparent;width:100%;min-height:27px;max-height:160px;line-height:1.6;padding:0 4px;font-size:16px}.composer textarea::placeholder{color:#83776b}.composer-bottom{display:flex;align-items:center;justify-content:space-between;margin-top:12px}.mode-button{display:flex;align-items:center;gap:7px;padding:7px 10px;border-radius:10px;font-size:12px;color:#776b5e;transition:background .2s,color .2s}.mode-button svg{width:16px;height:16px}.mode-button:hover{background:var(--paper)}.mode-button[aria-pressed=true]{color:#5e4839;background:#eee4d6}.send{width:36px;height:36px}.send svg{width:19px;height:19px;stroke-width:1.8}.send:disabled{background:#e9dfcf;color:#9c8c78}.activity{height:24px;display:flex;align-items:center;justify-content:center;color:#7f7262;font-size:11px;padding-top:6px}.activity:empty::after{content:'·';font-size:20px;color:#c3b49b}
.gate{min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:28px}.gate-form{width:330px;max-width:100%;text-align:center;margin-top:-70px}.gate-input{display:flex;align-items:center;padding:8px 8px 8px 20px;border-radius:19px;background:white;border:1px solid var(--line)}.gate-input:focus-within{border-color:#a68c70}.gate-input input{width:100%;min-width:0;border:0;background:none;font-size:16px;letter-spacing:2px}.gate-input input::placeholder{color:#817463;letter-spacing:1px;font-size:14px}.gate-input .icon-button{width:38px;height:38px}.error-line{min-height:24px;font-size:12px;color:#a26b54;margin-top:14px}
.drawer{position:fixed;inset:0 0 0 auto;width:min(420px,100%);height:100%;max-height:100dvh;max-width:100%;border:0;border-left:1px solid var(--line);margin:0;padding:0;background:var(--paper);color:var(--ink);box-shadow:-15px 0 50px #00000008}.drawer::backdrop{background:#382a2235;backdrop-filter:blur(3px)}.drawer-header{display:flex;align-items:center;justify-content:space-between;padding:24px 25px 16px}.drawer-header h2{font-size:17px;font-weight:500;margin:0}.drawer-body{padding:0 24px 30px;overflow:auto;height:calc(100% - 90px)}.drawer-empty{padding:40px 0;text-align:center;color:var(--muted);font-size:13px}.history-item{width:100%;padding:17px 6px;text-align:left;border-bottom:1px solid var(--line);display:block}.history-item strong{font-size:14px;font-weight:400;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history-item small{font-size:11px;color:var(--muted)}.history-item:hover strong{color:var(--green)}.device-row{display:flex;align-items:center;gap:13px;border-bottom:1px solid var(--line);padding:17px 0}.device-row>.device-icon{width:38px;height:38px;border-radius:12px;background:#ede4d5;display:flex;align-items:center;justify-content:center;color:#856e51;flex:none}.device-row.offline{opacity:.5}.device-label{flex:1;min-width:0}.device-label strong{font-size:13px;font-weight:450;display:block;overflow-wrap:anywhere}.device-label small{font-size:11px;color:var(--muted)}.device-row .icon-button{width:35px;height:35px}.device-row .on{background:#e7dcc9;color:#6c533c}.toast{position:fixed;bottom:190px;left:50%;transform:translateX(-50%);max-width:90%;background:#3e2d29eb;color:white;border-radius:13px;padding:10px 18px;font-size:13px;z-index:10;box-shadow:0 4px 30px #0001}
@keyframes pulse{0%,80%,100%{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}@keyframes appear{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:900px){.topbar{height:100px}.welcome{padding-bottom:100px}.welcome h1{font-size:33px}.composer-wrap{padding-bottom:22px}.assistant .message-text{font-size:18px}}
@media(max-width:600px){.topbar{height:78px;padding:0 18px}.brand-name{font-size:17px}.topbar nav{gap:2px}.icon-button{width:39px;height:39px}.nav-divider{margin:0 5px}.scroll-area{padding:0 22px}.welcome{padding-bottom:58px}.welcome h1{font-size:26px;margin:20px 0 10px}.suggestions{gap:10px}.suggestions button{padding:11px 13px;font-size:12px;gap:10px}.suggest-arrow{margin-left:8px}.messages{padding-top:14px}.message{margin-bottom:26px}.user .message-text{padding:11px 16px;max-width:90%;font-size:14px}.assistant .message-text{font-size:17px}.composer-wrap{padding-left:15px;padding-right:15px;padding-bottom:max(7px,env(safe-area-inset-bottom))}.composer{border-radius:20px;padding:13px 12px 10px}.composer-bottom{margin-top:9px}.activity{height:20px}.drawer-header{padding-top:max(24px,env(safe-area-inset-top))}.drawer{width:92%}.source{max-width:175px}.action-card{padding:13px;gap:10px}.action-copy strong{font-size:12px}.confirm-action{padding:8px 10px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Book-paper palette and display serifs; chat stays in a screen-readable sans serif. */
.portrait{display:block;object-fit:contain;flex:none}
.brand-name{font:600 19px/1.3 var(--serif);letter-spacing:.5px;white-space:nowrap}
.brand-name small{display:block;font:10px/1.6 var(--font);letter-spacing:1.2px;color:var(--muted);margin-top:3px}
.topbar{position:relative}
.topbar::after{content:'';position:absolute;bottom:0;left:44px;right:44px;height:1px;background:repeating-linear-gradient(to right,var(--line) 0 4px,transparent 4px 8px)}
.bookplate{display:flex;flex-direction:column;align-items:center;gap:17px;color:var(--muted);font:12px/1.5 var(--serif);letter-spacing:2px}
.welcome-note{margin:0 0 30px;text-align:center;line-height:1.9;color:var(--muted);font-size:13px}
.suggestions button{border-radius:6px;background:#fffcf680}
.suggestions button:hover{background:var(--white)}
.gate-portrait{margin:0 auto 24px}
.gate-title{font:600 25px/1.5 var(--serif);color:#542d37;margin:0;letter-spacing:1px}
.gate-title small{font:italic 16px Georgia,serif;letter-spacing:0}
.gate-note{font-size:12px;color:var(--muted);margin:12px 0 32px}
.gate-input{background:var(--white)}
.message-author{display:flex;align-items:center;gap:9px;font:12px/1.5 var(--serif);color:#75584a;margin:0 0 14px;letter-spacing:1px}
.dark,.send{background:#542d37}
.action-card{border-radius:10px}
@media(max-width:600px){.brand-name{font-size:17px}.brand-portrait{width:30px;height:30px}.brand{gap:8px}.topbar::after{left:18px;right:18px}.welcome-portrait{width:112px;height:112px}.welcome{padding-bottom:34px}.welcome-note{margin-bottom:25px}.bookplate{gap:13px;font-size:11px}.topbar nav{gap:0}.nav-divider{margin:0 2px}}
@media(max-width:350px){.brand-name{font-size:15px}.brand-portrait{display:none}.topbar{padding:0 14px}.suggestions button{gap:8px}.suggest-arrow{margin-left:2px}}
@media(max-height:650px){.welcome{padding:20px 0;min-height:auto}.welcome-portrait{width:64px;height:64px}.bookplate{gap:8px}.welcome h1{margin-top:14px;font-size:25px}.welcome-note{margin-bottom:18px}}

.welcome-portrait{width:132px;height:132px}.gate-portrait{width:110px;height:110px}.message-author .portrait{width:32px;height:32px}.brand-portrait{width:38px;height:38px}
@media(max-width:600px){.welcome-portrait{width:112px;height:112px}.brand-portrait{width:34px;height:34px}}
@media(max-height:650px){.welcome-portrait{width:64px;height:64px}}
