:root{--green:#123d35;--ink:#1c2925;--muted:#65716b;--paper:#f8f5ed;--soft:#eeeadf;--line:#dedbd1;--red:#ae3d32;--white:#fffdf8;--shadow:0 14px 44px #26312812;font-family:ui-sans-serif,"Microsoft YaHei",system-ui,sans-serif}*{box-sizing:border-box}body{margin:0;color:var(--ink);background:var(--paper);font-size:15px}.app-shell{min-height:100dvh;display:flex}.sidebar{background:#103831;color:#eef4ee;width:268px;flex:none;padding:23px 14px 15px;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0;z-index:3}.icon-button{border:0;background:none;color:inherit;font-size:23px;cursor:pointer}.sidebar-controls{display:flex;align-items:center;gap:8px;margin-bottom:18px}.new-chat{flex:1;height:43px;border:1px solid #7a948b;background:#194b42;color:#fff;border-radius:7px;text-align:left;padding:0 12px;font-size:14px;cursor:pointer}.new-chat span{font-size:20px;vertical-align:-2px;margin-right:7px}.conversations{overflow:auto;flex:1}.conversations p{font-size:11px;letter-spacing:.8px;color:#98afa5;margin:6px 10px 9px}.conversation{color:#d6e0db;background:none;border:0;width:100%;padding:9px 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left;border-radius:5px;cursor:pointer}.conversation:hover,.conversation.selected{background:#1c493f}.main{margin-left:268px;min-width:0;flex:1;min-height:100dvh;display:flex;flex-direction:column}.topbar{height:105px;display:flex;align-items:center;justify-content:space-between;padding:18px clamp(28px,5vw,76px);border-bottom:1px solid var(--line);background:#fbf9f3}.chat-tools{display:flex;align-items:center;gap:10px}.clear-chat{border:0;border-radius:6px;background:transparent;color:var(--muted);padding:8px;font:inherit;font-size:12px;cursor:pointer}.clear-chat:hover{color:var(--ink);background:var(--soft)}.topbar h1{font:600 25px/1.2 Georgia,"Songti SC",serif;margin:2px 0}.eyebrow{font-size:10px;letter-spacing:1.4px;color:var(--red);font-weight:700;margin:0 0 7px}.search-button{border:1px solid var(--line);color:var(--muted);background:var(--white);border-radius:7px;padding:8px 10px;display:flex;align-items:center;gap:9px;cursor:pointer}.search-button span:first-child{font-size:19px;color:var(--green)}kbd{font:10px ui-sans-serif;background:var(--soft);padding:3px 5px;border-radius:3px}#chat-view{display:flex;flex:1;flex-direction:column;min-height:0}.welcome{width:min(825px,100%);margin:auto;padding:55px clamp(28px,6vw,78px) 35px}.welcome-stamp{float:right;width:64px;height:64px;color:var(--red);border:1px solid var(--red);border-radius:50%;display:grid;place-content:center;text-align:center;font:10px/1.3 Georgia;transform:rotate(9deg);opacity:.85}.welcome-stamp b{font-size:14px;letter-spacing:2px}.welcome h2{font:600 clamp(31px,4vw,43px)/1.15 Georgia,"Songti SC",serif;margin:0 0 14px}.welcome>p:not(.eyebrow){max-width:570px;color:var(--muted);line-height:1.85;margin:0 0 31px}.quick-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.quick{background:var(--white);border:1px solid var(--line);border-radius:8px;padding:15px;text-align:left;color:var(--ink);font-size:14px;line-height:1.5;cursor:pointer;min-height:66px}.quick:hover{border-color:#a6b8ad;box-shadow:var(--shadow)}.quick b{display:block;color:var(--green);font-size:12px;margin-bottom:3px}.messages{width:min(825px,100%);margin:0 auto;padding:33px clamp(28px,6vw,78px) 155px;display:flex;flex-direction:column;gap:25px}.message{display:grid;grid-template-columns:32px minmax(0,1fr);gap:12px;line-height:1.8}.avatar{width:29px;height:29px;border-radius:50%;display:grid;place-items:center;font:bold 11px Georgia;background:#dfe9df;color:var(--green)}.message.user .avatar{background:#ead7cf;color:var(--red)}.bubble{min-width:0}.message .who{font-size:12px;font-weight:bold;margin-bottom:4px}.message .content{white-space:pre-wrap}.message.user .content{background:#e9eee9;display:inline-block;padding:8px 12px;border-radius:3px 10px 10px 10px}.source-list{margin-top:13px;display:flex;flex-wrap:wrap;gap:7px}.source{border:1px solid #bfcfc4;background:transparent;color:var(--green);padding:5px 9px;border-radius:4px;font-size:12px;cursor:pointer;text-align:left}.source:hover{background:#e4eee6}.suggestions{display:flex;gap:7px;flex-wrap:wrap;margin-top:14px}.suggestion{border:0;background:#eeeade;color:#43544d;border-radius:18px;padding:6px 10px;font-size:12px;cursor:pointer}.source-detail{margin:14px 0 0;padding:13px 15px;background:#f0ede4;border-left:3px solid var(--red);font-size:13px;color:#4a5550}.source-detail[hidden]{display:none}.source-detail b{display:block;color:var(--ink);margin-bottom:3px}.typing{color:var(--muted);font-size:13px}.typing i{display:inline-block;width:5px;height:5px;border-radius:50%;background:var(--green);margin:0 2px;animation:pulse 1s infinite alternate}.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}@keyframes pulse{to{opacity:.2;transform:translateY(-3px)}}.composer-wrap{position:fixed;bottom:0;left:268px;right:0;padding:12px clamp(28px,6vw,78px) 15px;background:linear-gradient(transparent,#f8f5ed 22%)}.composer{max-width:825px;margin:auto;display:flex;align-items:flex-end;border:1px solid #b7c5ba;background:var(--white);border-radius:9px;padding:8px 8px 8px 13px;box-shadow:0 7px 20px #26312810}.composer:focus-within{border-color:var(--green);box-shadow:0 0 0 3px #2f67561a}.composer textarea{font:inherit;line-height:1.5;resize:none;max-height:140px;min-height:25px;flex:1;border:0;outline:0;background:transparent;color:var(--ink)}.send-button{border:0;background:var(--green);color:white;width:34px;height:34px;border-radius:6px;font-size:20px;cursor:pointer}.send-button:disabled{background:#9da8a2}.composer-wrap p{max-width:825px;margin:7px auto 0;display:flex;gap:14px;color:#7b847f;font-size:10px}.topics{display:flex;flex-wrap:wrap;gap:9px}.topic{border:1px solid var(--line);background:var(--white);padding:9px 11px;border-radius:5px;color:var(--green);cursor:pointer}.toast{position:fixed;bottom:25px;left:50%;translate:-50% 20px;background:#243a34;color:white;border-radius:5px;padding:9px 13px;font-size:13px;opacity:0;transition:.2s;pointer-events:none;z-index:9}.toast.show{opacity:1;translate:-50% 0}.mobile-only,.mobile-menu{display:none}.backdrop{display:none}
@media(max-width:720px){.sidebar{transform:translateX(-102%);transition:transform .22s;width:min(305px,85vw);box-shadow:12px 0 30px #0003}.sidebar.open{transform:none}.backdrop.open{display:block;position:fixed;inset:0;background:#11251e77;z-index:2}.main{margin-left:0}.topbar{height:78px;padding:12px 16px}.topbar h1{font-size:20px}.mobile-menu,.mobile-only{display:block}.mobile-only{width:44px;height:44px}.sidebar:not(.open){visibility:hidden}.search-button{padding:8px}.search-label,.search-button kbd{display:none}.welcome{padding:38px 20px 25px}.welcome h2{font-size:33px}.quick-grid{grid-template-columns:1fr}.messages{padding:23px 17px 144px}.composer-wrap{left:0;padding:10px 16px 12px}.composer-wrap p span:not(:first-child){display:none}}
@media(max-width:720px){.welcome{padding-bottom:100px}.composer-wrap{padding-bottom:calc(12px + env(safe-area-inset-bottom))}}
.source-image{display:block;max-width:100%;max-height:360px;object-fit:contain;margin-top:12px;border:1px solid var(--line);cursor:zoom-in;background:#fff}
.locator{display:block;margin:4px 0 8px;color:var(--muted)}
.quote{white-space:pre-wrap;overflow-wrap:anywhere}
.message{scroll-margin-top:24px}
.messages:empty{display:none}
.welcome[hidden]{display:none}
.welcome{margin-top:clamp(16px,6vh,74px);margin-bottom:110px}




@media(max-width:720px){
  .welcome{margin:0;padding-bottom:114px}
  .sidebar:not(.open){box-shadow:none}
  .quick-grid{gap:8px}
  .quick{min-height:58px;padding:11px 13px}
}

.composer { gap: 8px; align-items: center; }
.composer textarea { min-width: 0; }
#attach-image, #remove-image {
  flex-shrink: 0; color: var(--green); background: #edf2ed;
  border: 1px solid #c5d3c9; border-radius: 6px; padding: 7px 10px; cursor: pointer;
}
#attach-image:disabled { opacity: .6; }
.image-draft {
  display: flex; align-items: center; gap: 10px; max-width: 825px; margin: 0 auto 6px;
  background: var(--white); padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
}
.image-draft[hidden], #draft-preview[hidden] { display: none; }
.image-draft img { width: 46px; height: 46px; object-fit: contain; }
.image-draft strong, .image-draft small { display: block; }
.image-draft small { color: var(--muted); font-size: 11px; }
#remove-image { margin-left: auto; }
.picture-context { font-size: 13px; color: #495d53; background: #edf2ec; padding: 8px 10px; margin: 4px 0 9px; border-radius: 5px; }
.picture-context small { font-weight: bold; display: block; }
.picture-sent { display: block; max-width: 130px; max-height: 95px; border: 1px solid var(--line); border-radius: 5px; margin: 4px 0; }
.picture-badge { display: block; color: var(--muted); font-size: 12px; }
.composer-wrap:has(.image-draft:not([hidden])) { background: var(--paper); }
#chat-view:has(.image-draft:not([hidden])) .messages { padding-bottom: 225px; }

.conversation-row { display: flex; align-items: center; border-radius: 6px; }
.conversation-row:hover, .conversation-row:focus-within, .conversation-row.selected { background: #1c493f; }
.conversation-row .conversation { flex: 1; min-width: 0; width: auto; background: transparent; font: inherit; font-size: 13px; }
.chat-more { flex: none; width: 34px; min-height: 32px; margin-right: 3px; padding: 0; border: 0; border-radius: 5px;
  background: transparent; color: #d6e0db; font-size: 21px; cursor: pointer; opacity: 0; }
.conversation-row:hover .chat-more, .conversation-row:focus-within .chat-more, .chat-more[aria-expanded="true"] { opacity: 1; }
.chat-more:hover, .chat-more[aria-expanded="true"] { background: #355e54; }
.chat-group:not(:first-child) { padding-top: 14px; }
.chat-menu { position: fixed; z-index: 8; width: 140px; padding: 5px; border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink); background: var(--white); box-shadow: 0 7px 24px #123d3524; }
.chat-menu button { display: block; width: 100%; padding: 8px 12px; text-align: left; font: inherit; font-size: 14px;
  border: 0; border-radius: 5px; color: inherit; background: transparent; cursor: pointer; }
.chat-menu button:hover, .chat-menu button:focus-visible { background: #edf2ec; outline: none; }
.chat-menu [data-chat-op="delete"] { color: #9b3930; }
#chat-dialog { width: min(350px, 88vw); padding: 22px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); background: var(--white); box-shadow: var(--shadow); }
#chat-dialog::backdrop { background: #102c2670; }
#chat-dialog h2 { margin: 0 0 16px; font-size: 19px; }
#chat-title-input { box-sizing: border-box; width: 100%; padding: 9px 10px; border: 1px solid #9eb5a6;
  border-radius: 5px; font: inherit; background: #fff; color: var(--ink); }
#chat-delete-note { color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog-actions button { border: 1px solid var(--line); border-radius: 6px; padding: 7px 14px; background: var(--white); color: var(--ink); cursor: pointer; }
#confirm-chat-op { background: var(--green); border-color: var(--green); color: white; }
#chat-dialog[data-op="delete"] #confirm-chat-op { background: #963c33; border-color: #963c33; }
#confirm-chat-op:disabled { opacity: .5; cursor: default; }
.answer-time { display: block; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
@media (hover: none), (pointer: coarse), (max-width: 720px) {
  .chat-more { opacity: 1; min-height: 44px; width: 44px; }
  .chat-menu button { min-height: 44px; }
}
