:root{--bg: #f8f7f4;--surface: #ffffff;--surface-muted: #f0ede6;--border: #e5e1d8;--border-subtle: #eeebe4;--text: #15171c;--text-strong: #0c0e12;--text-muted: #555c68;--accent: #245287;--accent-soft: #eaf1f9;--user-bg: #edf2f8;--user-border: #d5e2f1;--vermilion: #c64b32;--danger: #b93829;--shadow: 0 2px 14px rgba(24, 26, 31, .045);--radius: 14px;--md-font-size: 17px;--md-line-height: 1.9;--font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans", sans-serif;--font-claude-zh: "Newsreader", "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;--font-jp-mincho: "Noto Serif JP", "Hiragino Mincho ProN", "YuMincho", "Noto Serif SC", serif}:root[data-theme=dark]{--bg: #181817;--surface: #222220;--surface-muted: #2c2c29;--border: #363532;--border-subtle: #2d2c29;--text: #eceae4;--text-strong: #f8f7f2;--text-muted: #a3a098;--accent: #8cb8f0;--accent-soft: rgba(140, 184, 240, .15);--user-bg: #272d38;--user-border: #384457;--vermilion: #e8846f;--danger: #eb7667;--shadow: 0 4px 22px rgba(0, 0, 0, .38);color-scheme:dark}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg: #181817;--surface: #222220;--surface-muted: #2c2c29;--border: #363532;--border-subtle: #2d2c29;--text: #eceae4;--text-strong: #f8f7f2;--text-muted: #a3a098;--accent: #8cb8f0;--accent-soft: rgba(140, 184, 240, .15);--user-bg: #272d38;--user-border: #384457;--vermilion: #e8846f;--danger: #eb7667;--shadow: 0 4px 22px rgba(0, 0, 0, .38);color-scheme:dark}}.app-shell.font-sm{--md-font-size: 15.5px;--md-line-height: 1.82}.app-shell.font-md{--md-font-size: 17px;--md-line-height: 1.88}.app-shell.font-lg{--md-font-size: 19px;--md-line-height: 1.92}.app-shell.font-xl{--md-font-size: 21.5px;--md-line-height: 1.94}.app-shell.font-xxl{--md-font-size: 24px;--md-line-height: 1.96}.app-shell.font-xl .turns-container,.app-shell.font-xxl .turns-container{max-width:960px}*{box-sizing:border-box}html,body,#root{margin:0;height:100%;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Text,PingFang SC,Hiragino Sans,sans-serif;text-rendering:optimizeLegibility}button,input,textarea{font-family:inherit;color:inherit}.gate-shell{min-height:100%;display:grid;place-items:center;padding:24px}.gate-card{width:100%;max-width:440px;background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:38px 30px;text-align:center;box-shadow:var(--shadow)}.brand-mark{width:54px;height:54px;border-radius:16px;margin:0 auto 18px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent)}.brand-mark.warn{color:var(--vermilion);background:#c64b321f}.gate-card h1{margin:0 0 10px;font-size:26px;letter-spacing:.02em}.gate-sub{margin:0 0 24px;color:var(--text-muted);font-size:15px;line-height:1.65}.gate-hint{margin:16px 0 0;font-size:13px;color:var(--text-muted)}.btn-primary,.btn-secondary{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:13px 22px;border-radius:12px;border:none;font-size:15.5px;font-weight:600;cursor:pointer;transition:transform .12s ease,opacity .15s ease}.btn-primary{background:var(--accent);color:#fff;width:100%}.btn-secondary{background:var(--surface-muted);color:var(--text)}.btn-primary:hover,.btn-secondary:hover{opacity:.92}.alert-error{margin:0 0 16px;padding:12px 14px;border-radius:10px;background:#b938291f;color:var(--danger);font-size:14px;line-height:1.55;text-align:left}.app-shell{display:flex;height:100dvh;overflow:hidden;position:relative}.sidebar{width:296px;flex-shrink:0;background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column;padding:16px 14px;gap:12px;z-index:30;transition:width .2s ease,padding .2s ease,border-color .2s ease,opacity .15s ease;overflow:hidden}.sidebar.collapsed{width:0;padding-left:0;padding-right:0;border-right-color:transparent;opacity:0;pointer-events:none}.sidebar-header{display:flex;align-items:center;justify-content:space-between}.brand-inline{display:flex;align-items:center;gap:10px}.brand-dot{width:36px;height:36px;border-radius:10px;background:var(--accent);color:#fff;font-weight:700;display:grid;place-items:center;font-size:17px}.brand-name{font-weight:700;font-size:17px}.brand-model{font-size:11.5px;color:var(--text-muted)}.lexicon-pill{display:flex;align-items:center;justify-content:space-between;padding:7px 11px;border-radius:9px;background:var(--accent-soft);color:var(--accent);font-size:12.5px;font-weight:500}.btn-new-note{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;padding:10px 12px;border-radius:11px;border:1px solid var(--border);background:var(--bg);font-size:14.5px;font-weight:600;cursor:pointer}.btn-new-note:hover{border-color:var(--accent);color:var(--accent)}.search-box{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:10px;color:var(--text-muted);pointer-events:none}.search-box input{width:100%;padding:9px 28px 9px 33px;border-radius:10px;border:1px solid var(--border);background:var(--bg);font-size:13.5px;outline:none}.search-box input:focus{border-color:var(--accent)}.clear-search{position:absolute;right:8px;border:none;background:transparent;color:var(--text-muted);cursor:pointer;padding:2px}.filter-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;background:var(--bg);padding:3px;border-radius:10px}.filter-tabs button{border:none;background:transparent;padding:6px 4px;border-radius:8px;font-size:12.5px;color:var(--text-muted);cursor:pointer}.filter-tabs button.active{background:var(--surface);color:var(--text);font-weight:600;box-shadow:0 1px 3px #0000000f}.note-list{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:4px}.empty-list{padding:28px 12px;text-align:center;font-size:13.5px;color:var(--text-muted);line-height:1.65}.note-item{padding:10px 12px;border-radius:10px;cursor:pointer;border:1px solid transparent;transition:background .12s ease}.note-item:hover{background:var(--bg)}.note-item.active{background:var(--accent-soft);border-color:#24528738}.note-item-top{display:flex;align-items:center;justify-content:space-between;gap:6px}.note-item-title{font-size:14.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.note-item-badges{display:inline-flex;align-items:center;gap:4px;color:var(--text-muted);flex-shrink:0}.pin-active{color:var(--vermilion)!important}.note-item-meta{margin-top:4px;display:flex;justify-content:space-between;font-size:12px;color:var(--text-muted)}.sidebar-footer{padding-top:10px;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:8px}.user-pill{display:flex;align-items:center;gap:8px;min-width:0}.avatar,.avatar-fallback{width:30px;height:30px;border-radius:50%;flex-shrink:0}.avatar-fallback{background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-size:13px;font-weight:700}.user-email{font-size:12.5px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.workspace{flex:1;min-width:0;display:flex;flex-direction:column;height:100%}.topbar{height:58px;padding:0 22px;border-bottom:1px solid var(--border);background:var(--surface);display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0}.topbar-left{display:flex;align-items:center;gap:10px;min-width:0}.topbar-title{margin:0;font-size:16px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.font-switcher{display:inline-flex;align-items:center;background:var(--bg);border:1px solid var(--border);border-radius:9px;padding:2px;gap:2px}.font-switcher button{border:none;background:transparent;padding:4px 9px;border-radius:7px;font-size:12.5px;font-weight:650;color:var(--text);cursor:pointer}.font-switcher button:hover:not(:disabled){background:var(--surface);color:var(--accent)}.font-switcher button:disabled{opacity:.35;cursor:not-allowed}.font-scale-label{padding:0 6px;font-size:12px;font-weight:600;color:var(--accent);min-width:58px;text-align:center;-webkit-user-select:none;user-select:none}.icon-btn{width:36px;height:36px;border-radius:9px;border:none;background:transparent;color:var(--text-muted);display:grid;place-items:center;cursor:pointer}.icon-btn:hover{background:var(--surface-muted);color:var(--text)}.icon-btn.danger:hover{color:var(--danger)}.conversation{flex:1;overflow-y:auto;padding:28px 24px 40px}.welcome{max-width:760px;margin:6vh auto 0;text-align:center}.welcome-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:13px;font-weight:600;margin-bottom:16px}.welcome h1{margin:0 0 12px;font-size:28px;line-height:1.35}.welcome p{margin:0 0 30px;color:var(--text-muted);font-size:15.5px;line-height:1.65}.welcome code{background:var(--surface-muted);padding:2px 7px;border-radius:6px;font-size:13.5px}.quick-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;text-align:left}.quick-card{padding:16px 18px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);cursor:pointer;display:flex;flex-direction:column;gap:6px;transition:border-color .15s ease,transform .12s ease}.quick-card:hover{border-color:var(--accent);transform:translateY(-1px)}.quick-label{font-size:15px;font-weight:650;color:var(--accent)}.quick-preview{font-size:13.5px;color:var(--text-muted);line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.turns-container{max-width:880px;margin:0 auto;display:flex;flex-direction:column;gap:22px}.turn-user{display:flex;justify-content:flex-end}.user-bubble{max-width:86%;background:var(--user-bg);border:1px solid var(--user-border);color:var(--text-strong);padding:14px 18px;border-radius:16px 16px 4px;font-size:calc(var(--md-font-size) - .5px);line-height:1.68;white-space:pre-wrap;word-break:break-word}.turn-thumb{display:block;max-width:280px;max-height:220px;border-radius:10px;margin-bottom:10px;object-fit:contain;border:1px solid var(--border)}.model-card{background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:26px 32px;box-shadow:var(--shadow)}.lexicon-evidence-bar{margin-bottom:16px;padding:8px 13px;border-radius:10px;background:var(--bg);border:1px solid var(--border-subtle);font-size:13px;color:var(--text-muted)}.model-footer{margin-top:20px;padding-top:12px;border-top:1px solid var(--border-subtle);display:flex;align-items:center;justify-content:space-between;font-size:13px;color:var(--text-muted)}.copy-btn{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--border);background:var(--bg);padding:5px 11px;border-radius:8px;font-size:13px;font-weight:500;cursor:pointer}.copy-btn:hover{border-color:var(--accent);color:var(--accent)}.thinking-row{display:flex;align-items:center;gap:10px;color:var(--text-muted);font-size:15.5px}.pulse-dot{width:10px;height:10px;border-radius:50%;background:var(--vermilion);animation:pulse 1.2s ease-in-out infinite}@keyframes pulse{0%,to{opacity:.35;transform:scale(.9)}50%{opacity:1;transform:scale(1.15)}}.anki-quick-box{margin-top:20px;padding:15px 18px;border-radius:13px;background:var(--bg);border:1px solid var(--border);display:flex;flex-direction:column;gap:10px}.anki-quick-title{font-size:13px;font-weight:650;color:var(--accent)}.anki-quick-row{display:flex;align-items:center;gap:12px;font-size:calc(var(--md-font-size) - 1px);line-height:1.55}.anki-field-label{flex-shrink:0;padding:3px 9px;border-radius:7px;background:var(--surface-muted);font-size:12.5px;font-weight:650;color:var(--text-muted)}.anki-field-value{flex:1;min-width:0;color:var(--text-strong);word-break:break-word}.memo-card{background:var(--surface);border:1px dashed var(--border);border-radius:14px;padding:14px 18px}.memo-header{display:flex;align-items:center;justify-content:space-between;font-size:13.5px;font-weight:600;color:var(--text-muted);margin-bottom:8px}.memo-header span{display:inline-flex;align-items:center;gap:6px}.memo-saved{color:var(--accent);font-weight:500}.memo-input{width:100%;border:none;background:transparent;resize:vertical;font-size:15px;line-height:1.65;outline:none}.md-root{font-family:var(--font-claude-zh);font-size:var(--md-font-size);font-weight:500;line-height:var(--md-line-height);color:var(--text);letter-spacing:.008em;word-break:break-word}.claude-serif{font-family:var(--font-claude-zh);font-weight:500}.jp-text{font-family:var(--font-jp-mincho);font-weight:inherit;font-feature-settings:"palt" 1;letter-spacing:.015em}.zh-translation{font-family:var(--font-ui);font-size:.91em;font-weight:400;color:var(--text-muted);margin-left:3px;letter-spacing:.01em}.md-root>:first-child{margin-top:0}.md-root>:last-child{margin-bottom:0}.md-h2{margin:28px 0 12px;padding-bottom:7px;border-bottom:1px solid var(--border-subtle);font-size:calc(var(--md-font-size) * 1.24);font-weight:700;color:var(--text-strong);line-height:1.4}.md-h3{margin:24px 0 10px;padding-bottom:5px;border-bottom:1px solid var(--border-subtle);font-size:calc(var(--md-font-size) * 1.12);font-weight:700;color:var(--accent);line-height:1.45}.md-h4{margin:18px 0 8px;font-size:calc(var(--md-font-size) * 1.03);font-weight:650;color:var(--text-strong);line-height:1.45}.md-p{margin:0 0 13px}.md-root strong{font-weight:700;color:var(--text-strong)}.md-root ul,.md-root ol{margin:0 0 14px;padding-left:1.55em}.md-root li{margin-bottom:7px}.md-root li>p{margin-bottom:6px}.md-root li>ul,.md-root li>ol{margin-top:6px;margin-bottom:6px}.md-root ul>li::marker{color:var(--text-muted)}.md-quote{margin:14px 0;padding:10px 16px;border-left:3.5px solid var(--accent);background:var(--bg);border-radius:0 10px 10px 0;color:var(--text)}.md-quote p{margin:0 0 6px}.md-quote p:last-child{margin-bottom:0}.md-inline-code{background:var(--surface-muted);border:1px solid var(--border-subtle);padding:2px 7px;border-radius:6px;font-size:.88em;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace}.md-code-block{margin:14px 0;background:var(--surface-muted);border:1px solid var(--border-subtle);padding:14px 16px;border-radius:10px;overflow-x:auto;font-size:calc(var(--md-font-size) * .86);line-height:1.65;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace}.md-table-wrap{overflow-x:auto;margin:16px 0;border:1px solid var(--border);border-radius:10px}.md-table{width:100%;border-collapse:collapse;font-size:calc(var(--md-font-size) * .92);line-height:1.65}.md-table th,.md-table td{border-bottom:1px solid var(--border-subtle);border-right:1px solid var(--border-subtle);padding:10px 14px;text-align:left;vertical-align:top}.md-table th:last-child,.md-table td:last-child{border-right:none}.md-table tbody tr:last-child td{border-bottom:none}.md-table th{background:var(--bg);font-weight:650;color:var(--text-strong)}.md-table tbody tr:nth-child(2n) td{background:#80808008}.md-hr{border:none;border-top:1px solid var(--border);margin:20px 0}.md-link{color:var(--accent);text-decoration:underline;text-underline-offset:3px}.jp-reading{font-family:var(--font-jp-mincho);color:var(--accent);font-weight:600;font-size:.95em}.composer-wrap{border-top:1px solid var(--border);background:var(--surface);padding:10px 20px calc(14px + env(safe-area-inset-bottom));flex-shrink:0}.mode-bar{max-width:880px;margin:0 auto 8px;display:flex;gap:6px;overflow-x:auto;scrollbar-width:none}.mode-chip{border:1px solid var(--border);background:var(--bg);color:var(--text-muted);padding:5px 12px;border-radius:999px;font-size:13px;cursor:pointer;white-space:nowrap}.mode-chip.active{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}.attachment-strip{max-width:880px;margin:0 auto 8px;padding:8px 12px;border-radius:12px;border:1px solid var(--border);background:var(--bg);display:flex;align-items:center;gap:10px}.attachment-thumb{width:50px;height:50px;border-radius:8px;object-fit:cover;flex-shrink:0}.attachment-info{flex:1;min-width:0}.attachment-title{font-size:13.5px;font-weight:600}.attachment-sub{font-size:12px;color:var(--text-muted)}.composer-box{max-width:880px;margin:0 auto;display:flex;align-items:flex-end;gap:8px;background:var(--bg);border:1px solid var(--border);border-radius:16px;padding:9px 12px}.composer-box:focus-within{border-color:var(--accent)}.composer-box textarea{flex:1;border:none;background:transparent;resize:none;font-size:16px;line-height:1.55;padding:5px 4px;outline:none;max-height:180px}.send-btn{width:38px;height:38px;border-radius:11px;border:none;background:var(--accent);color:#fff;display:grid;place-items:center;cursor:pointer;flex-shrink:0}.send-btn:disabled{opacity:.4;cursor:not-allowed}.send-btn.stop{background:var(--vermilion)}.toast-error{max-width:880px;width:calc(100% - 40px);margin:0 auto 8px;padding:10px 14px;border-radius:10px;background:#b938291f;color:var(--danger);font-size:14px;display:flex;align-items:center;justify-content:space-between;gap:10px}.toast-error button{border:none;background:transparent;color:inherit;cursor:pointer}.drop-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#2452872e;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:grid;place-items:center;z-index:60;pointer-events:none}.drop-box{background:var(--surface);border:2px dashed var(--accent);border-radius:20px;padding:36px 48px;display:flex;flex-direction:column;align-items:center;gap:12px;color:var(--accent);font-weight:600;font-size:16px}.mobile-only{display:none}.desktop-only{display:grid}.sidebar-backdrop{display:none}@media(max-width:820px){.app-shell.font-sm{--md-font-size: 15px}.app-shell.font-md{--md-font-size: 16.5px}.app-shell.font-lg{--md-font-size: 18px}.app-shell.font-xl{--md-font-size: 20px}.app-shell.font-xxl{--md-font-size: 22px}.mobile-only{display:grid}.desktop-only{display:none}.sidebar,.sidebar.collapsed{position:fixed;inset:0 auto 0 0;width:296px;padding:16px 14px;border-right:1px solid var(--border);opacity:1;pointer-events:auto;transform:translate(-100%);transition:transform .2s ease;box-shadow:var(--shadow)}.sidebar.open{transform:translate(0)}.sidebar-backdrop{display:block;position:fixed;top:0;right:0;bottom:0;left:0;background:#00000059;z-index:25}.quick-grid{grid-template-columns:1fr}.topbar{padding:0 12px}.conversation{padding:16px 12px 28px}.model-card{padding:18px 16px;border-radius:14px}.user-bubble{max-width:92%}}
