File size: 10,373 Bytes
5aa1e9b
 
 
 
 
 
 
47f0dd7
5aa1e9b
 
 
 
 
 
 
47f0dd7
5aa1e9b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47f0dd7
5aa1e9b
 
 
47f0dd7
5aa1e9b
 
 
 
 
 
 
 
 
 
47f0dd7
5aa1e9b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
:root{
  --bg:#0b0b10; --bg2:#14141c; --bg3:#1d1d28; --line:rgba(255,255,255,.08);
  --text:#f2f2f7; --mute:#8e8ea0; --violet:#8b5cf6; --orange:#fb923c;
  --grad:linear-gradient(90deg,#a78bfa 0%,#c084fc 30%,#f472b6 62%,#fb923c 100%);
  --user:linear-gradient(135deg,#7c3aed,#c026d3 60%,#f97316);
  --r:20px;
  --sat:env(safe-area-inset-top,0px); --sab:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);
  font:16px/1.5 -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;overscroll-behavior:none}
button{font:inherit;color:inherit;border:0;background:none;cursor:pointer}
.hidden{display:none!important}
#app{display:flex;flex-direction:column;height:100dvh;max-width:820px;margin:0 auto;position:relative}

/* header */
#top{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:10px;
  padding:calc(8px + var(--sat)) 14px 10px;background:rgba(11,11,16,.72);
  backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);
  border-bottom:1px solid var(--line)}
.brand{flex:1;text-align:center;min-width:0}
.brand h1{margin:0;font-size:19px;font-weight:800;letter-spacing:-.3px;background:var(--grad);
  -webkit-background-clip:text;background-clip:text;color:transparent}
.status{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;color:var(--mute);white-space:nowrap}
.status .dot{width:7px;height:7px;border-radius:50%;background:#f59e0b;box-shadow:0 0 8px #f59e0b}
.status.ready .dot{background:#22c55e;box-shadow:0 0 8px #22c55e}
.status.busy .dot{background:#a78bfa;box-shadow:0 0 8px #a78bfa;animation:pulse 1s infinite}
.status.err .dot{background:#ef4444;box-shadow:0 0 8px #ef4444}
@keyframes pulse{50%{opacity:.35}}
.icon-btn{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;color:#d4d4e0;background:var(--bg3)}
.icon-btn:active{transform:scale(.94)}
.think-toggle{height:36px;padding:0 11px;border-radius:18px;background:var(--bg3);font-size:13px;font-weight:600;color:var(--mute);
  border:1px solid var(--line);transition:all .2s;white-space:nowrap}
.think-toggle[aria-pressed="true"]{color:#fff;background:linear-gradient(135deg,rgba(139,92,246,.35),rgba(251,146,60,.3));border-color:rgba(167,139,250,.6);
  box-shadow:0 0 14px rgba(139,92,246,.35)}

/* scroll */
#scroller{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:14px 14px 8px;scroll-behavior:auto}
#messages{display:flex;flex-direction:column;gap:14px}

/* loader */
.loader{display:grid;place-items:center;min-height:70%}
.loader-card{width:min(360px,92%);text-align:center;padding:28px 22px;border-radius:24px;background:var(--bg2);border:1px solid var(--line)}
.bolt{font-size:44px;animation:float 2.4s ease-in-out infinite}
@keyframes float{50%{transform:translateY(-6px)}}
.loader-title{font-weight:700;font-size:17px;margin:8px 0 14px}
.bar{height:8px;border-radius:8px;background:var(--bg3);overflow:hidden}
.bar-fill{height:100%;width:0;background:var(--grad);border-radius:8px;transition:width .25s}
.loader-sub{font-size:13px;color:var(--mute);margin-top:12px}
.retry{margin-top:14px;padding:9px 18px;border-radius:14px;background:var(--user);font-weight:600}

/* empty */
.empty{text-align:center;padding:9vh 6px 10px}
.hero{font-size:52px;filter:drop-shadow(0 0 18px rgba(251,146,60,.45))}
.hero-title{font-size:23px;font-weight:800;margin-top:6px;letter-spacing:-.3px}
.hero-sub{color:var(--mute);font-size:14px;margin:4px 0 22px}
.chips{display:flex;flex-wrap:wrap;gap:9px;justify-content:center}
.chip{padding:10px 14px;border-radius:16px;background:var(--bg2);border:1px solid var(--line);font-size:14px;text-align:left;
  max-width:100%;transition:transform .12s,background .2s}
.chip:active{transform:scale(.97);background:var(--bg3)}

/* messages */
.msg{display:flex;flex-direction:column;animation:pop .22s ease-out}
@keyframes pop{from{opacity:0;transform:translateY(6px)}}
.msg.user{align-items:flex-end}
.msg.user .bubble{background:var(--user);color:#fff;border-radius:var(--r) var(--r) 6px var(--r);padding:9px 14px;max-width:84%;
  white-space:pre-wrap;word-wrap:break-word;box-shadow:0 4px 18px rgba(124,58,237,.25)}
.msg.bot .bubble{background:var(--bg2);border:1px solid var(--line);border-radius:var(--r) var(--r) var(--r) 6px;padding:10px 14px;max-width:100%;
  overflow-wrap:anywhere;min-width:60px}
.answer>:first-child{margin-top:0}.answer>:last-child{margin-bottom:0}
.answer p{margin:.45em 0}
.answer h1,.answer h2,.answer h3,.answer h4{margin:.7em 0 .3em;line-height:1.25}
.answer h1{font-size:1.25em}.answer h2{font-size:1.15em}.answer h3,.answer h4{font-size:1.05em}
.answer ul,.answer ol{margin:.4em 0;padding-left:1.35em}
.answer li{margin:.15em 0}
.answer a{color:#c4b5fd}
.answer blockquote{margin:.5em 0;padding-left:10px;border-left:3px solid var(--violet);color:#c9c9d6}
.answer hr{border:0;border-top:1px solid var(--line);margin:.8em 0}
.answer code.inl{background:var(--bg3);padding:1px 6px;border-radius:6px;font-size:.88em;font-family:ui-monospace,"SF Mono",Menlo,monospace}
.boxed{display:inline-block;padding:1px 8px;border:1.5px solid var(--orange);border-radius:8px;font-weight:700;color:#fed7aa}
.answer table{border-collapse:collapse;margin:.5em 0;font-size:.92em;display:block;overflow-x:auto}
.answer th,.answer td{border:1px solid var(--line);padding:4px 8px}

.code-block{margin:.6em 0;border-radius:14px;overflow:hidden;background:#07070b;border:1px solid var(--line)}
.code-head{display:flex;align-items:center;gap:6px;padding:6px 8px 6px 12px;background:#121219;font-size:12px;color:var(--mute)}
.code-head .lang{flex:1;font-family:ui-monospace,Menlo,monospace;text-transform:lowercase}
.cbtn{padding:4px 10px;border-radius:9px;background:var(--bg3);font-size:12px;font-weight:600;color:#e5e5ef}
.cbtn:active{transform:scale(.95)}
.cbtn.pv{background:linear-gradient(135deg,#7c3aed,#f97316);color:#fff}
.code-block pre{margin:0;padding:10px 12px;overflow-x:auto;font:12.5px/1.5 ui-monospace,"SF Mono",Menlo,Consolas,monospace;color:#e4e4ee;-webkit-overflow-scrolling:touch}
.code-block pre code{white-space:pre}
.tk-k{color:#c792ea}.tk-s{color:#c3e88d}.tk-c{color:#6b7089;font-style:italic}.tk-n{color:#f78c6c}.tk-t{color:#89ddff}

.thought{margin:0 0 8px;border-radius:14px;background:rgba(139,92,246,.08);border:1px solid rgba(139,92,246,.22);overflow:hidden}
.thought summary{list-style:none;cursor:pointer;padding:7px 12px;font-size:13px;font-weight:600;color:#c4b5fd;display:flex;align-items:center;gap:6px}
.thought summary::-webkit-details-marker{display:none}
.thought summary::after{content:"›";margin-left:auto;transition:transform .2s;font-size:16px}
.thought[open] summary::after{transform:rotate(90deg)}
.thought .tbody{padding:0 12px 10px;font-size:13px;color:#a9a9bd;white-space:pre-wrap;max-height:300px;overflow-y:auto}
.thinking-live summary span{background:linear-gradient(90deg,#a78bfa,#fb923c,#a78bfa);background-size:200% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:shine 1.6s linear infinite}
@keyframes shine{to{background-position:-200% 0}}

.typing{display:inline-flex;gap:4px;padding:4px 0}
.typing i{width:7px;height:7px;border-radius:50%;background:var(--mute);animation:blink 1.2s infinite}
.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,80%,100%{opacity:.25;transform:scale(.85)}40%{opacity:1;transform:scale(1)}}
.caret{display:inline-block;width:.5em;height:1.05em;margin-left:2px;vertical-align:-.15em;border-radius:2px;background:linear-gradient(180deg,#a78bfa,#fb923c);animation:pulse .9s infinite}

.meta{display:flex;align-items:center;gap:8px;margin:5px 4px 0;font-size:11.5px;color:var(--mute)}
.meta .mbtn{padding:3px 9px;border-radius:9px;background:var(--bg2);border:1px solid var(--line);font-size:11.5px;color:#cfcfe0}
.meta .mbtn.pv{background:linear-gradient(135deg,#7c3aed,#f97316);color:#fff;border:0}
.err-text{color:#fca5a5}

/* composer */
#composer{padding:8px 12px calc(8px + var(--sab));background:linear-gradient(to top,var(--bg) 70%,rgba(11,11,16,0))}
.input-wrap{display:flex;align-items:flex-end;gap:8px;background:var(--bg2);border:1px solid var(--line);border-radius:24px;padding:6px 6px 6px 16px;
  transition:border-color .2s,box-shadow .2s}
.input-wrap:focus-within{border-color:rgba(167,139,250,.55);box-shadow:0 0 0 3px rgba(139,92,246,.15)}
#input{flex:1;resize:none;border:0;outline:0;background:transparent;color:var(--text);font-family:inherit;font-size:16px;line-height:1.4;max-height:160px;padding:7px 0}
#input::placeholder{color:#6e6e80}
.send{width:36px;height:36px;border-radius:50%;flex:none;display:grid;place-items:center;background:var(--user);color:#fff;transition:opacity .2s,transform .12s}
.send:disabled{opacity:.3}
.send:active{transform:scale(.92)}
.send.stop{background:#f2f2f7;color:#111}
.foot-note{text-align:center;font-size:10.5px;color:#5c5c6e;margin-top:6px}

/* sheet */
.sheet{position:fixed;inset:0;z-index:50;background:rgba(0,0,0,.55);display:flex;align-items:flex-end;animation:fade .2s}
@keyframes fade{from{opacity:0}}
.sheet-panel{width:100%;height:calc(100dvh - var(--sat) - 10px);background:#fff;border-radius:18px 18px 0 0;overflow:hidden;display:flex;flex-direction:column;
  animation:up .32s cubic-bezier(.2,.9,.25,1)}
@keyframes up{from{transform:translateY(100%)}}
.sheet-bar{position:relative;display:flex;align-items:center;gap:8px;padding:14px 12px 10px;background:#15151d;color:#fff}
.grabber{position:absolute;left:50%;top:5px;width:38px;height:5px;border-radius:3px;background:#4b4b5a;transform:translateX(-50%)}
.sheet-title{flex:1;font-weight:700;font-size:15px;padding-left:4px}
.sheet-btn{width:32px;height:32px;border-radius:50%;background:#2a2a36;font-size:15px;display:grid;place-items:center}
.sheet-btn.close{background:#3a3a48}
#previewFrame{flex:1;width:100%;border:0;background:#fff}

.toast{position:fixed;left:50%;bottom:calc(90px + var(--sab));transform:translate(-50%,20px);opacity:0;background:rgba(40,40,52,.95);color:#fff;
  padding:8px 16px;border-radius:14px;font-size:13.5px;font-weight:600;pointer-events:none;transition:all .25s;z-index:60}
.toast.show{opacity:1;transform:translate(-50%,0)}