-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathv2ex-scene-script.user.js
More file actions
5918 lines (5495 loc) · 227 KB
/
v2ex-scene-script.user.js
File metadata and controls
5918 lines (5495 loc) · 227 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ==UserScript==
// @name $V2EX Scence +
// @namespace http://tampermonkey.net/
// @version 1.4.3
// @description 为 V2EX 增强场景化打赏、私信和聊天功能
// @author JoeJoeJoe
// @match https://www.v2ex.com/*
// @match https://*.v2ex.com/*
// @exclude https://*.v2ex.com/signin/*
// @exclude https://*.v2ex.com/2fa/*
// @icon https://www.v2ex.com/static/icon-192.png
// @grant GM_xmlhttpRequest
// @grant GM_addStyle
// @grant GM_registerMenuCommand
// @grant unsafeWindow
// @connect www.v2ex.com
// @connect jillian-fnk7b6-fast-mainnet.helius-rpc.com
// @connect raw.githubusercontent.com
// ==/UserScript==
(function() {
'use strict';
const PAGE_WINDOW = (typeof unsafeWindow !== 'undefined' && unsafeWindow) ? unsafeWindow : window;
// Solana RPC 端点
const SOLANA_RPC = 'https://jillian-fnk7b6-fast-mainnet.helius-rpc.com';
// Solana Web3.js CDN 链接
const WEB3_CDN = 'https://unpkg.com/@solana/web3.js@1.95.0/lib/index.iife.js';
// Solana SPL Token CDN 链接
const SPL_TOKEN_CDN = 'https://unpkg.com/@solana/spl-token@0.4.5/lib/index.iife.js';
// Solana Wallet Adapter Base CDN 链接
const WALLET_ADAPTER_BASE_CDN = 'https://cdn.jsdelivr.net/npm/@solana/wallet-adapter-base@0.9.24/+esm';
// BS58 模块 CDN 链接
const BS58_MODULE_CDN = 'https://cdn.jsdelivr.net/npm/bs58@5.0.0/+esm';
// Solana 链 ID
const SOLANA_CHAIN_ID = 'solana:mainnet-beta';
// 标准连接功能
const STANDARD_CONNECT_FEATURE = 'standard:connect';
// 标准事件功能
const STANDARD_EVENTS_FEATURE = 'standard:events';
// Solana 签名并发送交易功能
const SOLANA_SIGN_AND_SEND_FEATURE = 'solana:signAndSendTransaction';
// Solana 签名交易功能
const SOLANA_SIGN_TRANSACTION_FEATURE = 'solana:signTransaction';
// V2EX 代币铸币地址
const V2EX_MINT = '9raUVuzeWUk53co63M4WXLWPWE4Xc6Lpn7RS9dnkpump';
// 消息成本
const MESSAGE_COST = 1;
// 用户地址缓存
const addressCache = new Map();
// Planet 所有者缓存
const planetOwnerCache = new Map();
// 默认回复消息
const DEFAULT_REPLY_MESSAGE = '感谢您的精彩回答';
// 快速感谢自动提交标志
const QUICK_THANK_AUTO_SUBMIT = false;
// 快速感谢模板函数
const QUICK_THANK_TEMPLATE = (names) => `感谢 ${names.join(' ')} 的打赏!🎉\n`;
// 快速感谢存储键
const QUICK_THANK_STORAGE_KEY = 'quick-thank-thanked-users-v1';
// DM 模态元素
let dmModalEl = null;
// 打赏模态上下文
let tipModalContext = null;
// 快速感谢是否已初始化
let quickThankInitialized = false;
// 聊天记录存储键
const TIP_CHAT_STORAGE_KEY = 'v2ex-tip-chat-records-v1';
// 聊天元数据存储键
const TIP_CHAT_META_KEY = 'v2ex-tip-chat-meta-v1';
// 当前登录用户缓存键
const TIP_CHAT_SELF_KEY = 'v2ex-tip-chat-self';
// 聊天记录最大限制
const TIP_CHAT_RECORD_LIMIT = 600;
// 聊天消息长度限制(需少于 150 个字符)
const TIP_CHAT_MAX_MESSAGE_LENGTH = 149;
const TIP_CHAT_PREFS_KEY = 'v2ex-tip-chat-prefs-v1';
const TIP_CHAT_MIN_WIDTH = 620;
const TIP_CHAT_MIN_HEIGHT = 420;
const TIP_CHAT_COMPOSER_MAX_LINES = 5;
const TIP_CHAT_CHANGELOG_KEY = 'v2ex-tip-chat-changelog-version';
const TIP_CHAT_DEFAULT_THEME = 'dark';
const RESIZE_ICON_URL = 'https://raw.githubusercontent.com/HelloWorldImJoe/TampermonkeyScripts/master/assets/resize.svg';
// 在此对象中维护版本号到更新说明的映射,新增版本请追加条目
const SCRIPT_CHANGELOG_ENTRIES = {
'1.4.3': [
'过滤掉 *.v2ex.com/signin/* | 2fa 路径,避免在登录页面加载脚本引起问题'
],
'1.4.2': [
'新增在会话消息旁展示消耗/获得代币数量功能, 绿色显示获得, 红色显示消耗'
],
'1.4.1': [
'新增按 Esc 键关闭聊天面板功能, 当聊天面板未固定时可以快速关闭面板'
],
'1.4.0': [
'新增聊天面板拖动缩放与自适应布局能力,可以通过右下角的拖拽手柄调整大小',
'新增主动发起会话功能, 输入用户名直接发起一个会话',
'新增聊天面板位置记忆功能, 面板位置会在关闭后保存, 下次打开时恢复',
'新增会话置顶功能, 置顶的会话会固定在列表顶部',
'新增消息引用功能, 可以引用某条消息进行回复, 长按消息气泡即可触发操作面板',
'新增引用消息点击跳转到原消息位置, 如果原消息在当前页面没加载, 则不跳转',
'新增日/月模式切换, 可以在面板顶部切换当前主题',
'新增图片显示支持, 可以在消息中显示图片链接',
'新增R按钮和C按钮, R按钮用于刷新会话列表(适应于消息不同步), C按钮用于清除当前会话记录(重新建立索引)',
'优化PIN状态不会再在刷新后丢失',
'修复若干已知问题'
]
};
// 脚本远程地址
const SCRIPT_UPDATE_URL = 'https://raw.githubusercontent.com/HelloWorldImJoe/TampermonkeyScripts/master/v2ex-scene-script.user.js';
// 脚本检查缓存键
const SCRIPT_UPDATE_CHECK_KEY = 'v2ex-tip-chat-update-check';
// 更新检查间隔(6 小时)
const SCRIPT_UPDATE_INTERVAL = 6 * 60 * 60 * 1000;
// 每页记录数量预估(用于计算最大分页请求)
const TIP_CHAT_PAGE_ESTIMATE = 20;
// 引导阶段最多抓取的页面数量
const TIP_CHAT_MAX_BOOTSTRAP_PAGES = Math.ceil(TIP_CHAT_RECORD_LIMIT / TIP_CHAT_PAGE_ESTIMATE) + 2;
// 增量页面数量
const TIP_CHAT_INCREMENTAL_PAGES = 2;
// 刷新间隔(毫秒)
const TIP_CHAT_REFRESH_INTERVAL = 120000;
// 长按触发时间(毫秒)
const TIP_CHAT_LONG_PRESS_DELAY = 520;
// 长按移动容差(像素)
const TIP_CHAT_LONG_PRESS_MOVE_THRESHOLD = 6;
// 初始加载数量
const TIP_CHAT_INITIAL_LOAD = 50;
// 加载步长
const TIP_CHAT_LOAD_STEP = 20;
// 手动刷新修复页数上限
const TIP_CHAT_REPAIR_PAGES = 6;
// 聊天是否已初始化标志
let tipChatInitialized = false;
// 升级检测是否已安排
let scriptUpdateCheckScheduled = false;
// 聊天状态对象
const tipChatState = {
// 聊天记录数组
records: [],
// 对话映射
conversationMap: new Map(),
// 摘要数组
summaries: [],
// 活跃对等方
activePeer: null,
// 可见计数映射
visibleCountMap: new Map(),
// 元素对象
elements: {},
// 偏好设置
preferences: null,
// 偏好设置是否已加载
prefsLoaded: false,
// UI 偏好设置
uiPrefs: createDefaultPanelPrefs(),
// 置顶的对话
pinnedConversations: new Set(),
// 手动添加的对等方
manualPeers: new Map(),
// 当前主题
currentTheme: TIP_CHAT_DEFAULT_THEME,
// 当前登录用户
currentUser: null,
// 刷新状态
refreshing: null,
// 刷新定时器
refreshTimer: null,
// 用户是否向上滚动
userScrolledUp: false,
// 面板是否固定
pinned: false,
// 是否正在发送新消息
composerSending: false,
// 已提示的升级版本
upgradePromptedVersion: null,
// 消息操作菜单
messageActionsMenu: null,
// 引用的消息
quotedMessage: null
};
let pendingConversationRenderFrame = null;
// 成员头像缓存
const memberAvatarCache = new Map();
// 成员头像请求缓存
const memberAvatarRequestCache = new Map();
// 是否在成员页面
const isMemberPage = window.location.pathname.startsWith('/member/');
const baseStyles = `
:root {
--tip-button-color: #374151;
--tip-button-hover-bg: rgba(59, 130, 246, 0.12);
--tip-button-hover-border: #3b82f6;
--tip-chat-panel-bg: #0f172a;
--tip-chat-sidebar-bg: #111a2f;
--tip-chat-border: rgba(148, 163, 184, 0.18);
--tip-chat-text: #e2e8f0;
--tip-chat-muted: #94a3b8;
--tip-chat-accent: #6366f1;
--tip-chat-bubble-self: #283859;
--tip-chat-bubble-peer: rgba(100, 116, 139, 0.35);
--dm-accent: #3b82f6;
--dm-bg: #0f172a;
--dm-text: #e5e7eb;
--dm-muted: #9ca3af;
}
.Night {
--tip-button-color: #9aa0ae;
--tip-button-hover-bg: rgba(59, 130, 246, 0.08);
--tip-chat-panel-bg: #050a18;
--tip-chat-sidebar-bg: #070d18;
--tip-chat-border: rgba(148, 163, 184, 0.28);
}
`;
const tipStyles = `
.tip-button {
cursor: pointer;
color: var(--dm-accent, #3b82f6);
margin-left: 6px;
font-size: 12px;
font-weight: 600;
text-decoration: none;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 2px 6px;
border: 1px solid rgba(59, 130, 246, 0.45);
border-radius: 3px;
background: rgba(59, 130, 246, 0.08);
line-height: 1.2;
position: relative;
transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.tip-button:first-child {
margin-left: 0;
}
.tip-button .tip-icon {
width: 12px;
height: 12px;
display: block;
}
.planet-tip-button {
width: auto;
height: auto;
padding: 2px 8px;
line-height: 1.2;
font-size: 12px;
}
.tip-button:hover {
color: var(--dm-accent, #3b82f6);
background: rgba(59, 130, 246, 0.18);
border-color: rgba(59, 130, 246, 0.65);
}
/* Hover-only controls for reply rows */
.cell[id^="r_"] tr .tip-button,
.cell[id^="r_"] tr .dm-btn {
opacity: 0;
pointer-events: none;
transform: translateY(2px);
transition: opacity 0.16s ease, transform 0.16s ease;
}
.cell[id^="r_"] tr:hover .tip-button,
.cell[id^="r_"] tr:hover .dm-btn {
opacity: 1;
pointer-events: auto;
transform: translateY(0);
}
.tip-button.loading {
opacity: 0.6;
pointer-events: none;
}
.tip-button[data-tip]:hover::after,
.tip-button[data-tip]:hover::before {
opacity: 1;
visibility: visible;
transform: translate(-50%, -6px);
}
.tip-button[data-tip]::after {
content: attr(data-tip);
position: absolute;
left: 50%;
bottom: 100%;
transform: translate(-50%, 0);
background: #111827;
color: #e5e7eb;
padding: 6px 10px;
border-radius: 6px;
font-size: 12px;
white-space: nowrap;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
opacity: 0;
visibility: hidden;
transition: all 0.16s ease;
z-index: 2;
}
.tip-button[data-tip]::before {
content: '';
position: absolute;
left: 50%;
bottom: 100%;
transform: translate(-50%, 0);
border: 6px solid transparent;
border-top-color: #111827;
opacity: 0;
visibility: hidden;
transition: all 0.16s ease;
z-index: 2;
margin-bottom: -1px;
}
.tip-update-banner {
position: fixed;
right: 24px;
bottom: 24px;
border-radius: 10px;
background: rgba(15, 23, 42, 0.94);
color: #e2e8f0;
padding: 14px 18px;
box-shadow: 0 18px 45px rgba(15, 23, 42, 0.45);
border: 1px solid rgba(148, 163, 184, 0.25);
font-size: 13px;
display: flex;
gap: 12px;
align-items: center;
z-index: 2147483647;
}
.tip-update-banner a {
color: #60a5fa;
text-decoration: underline;
font-weight: 600;
}
.tip-update-close {
background: transparent;
border: none;
color: #94a3b8;
font-size: 15px;
cursor: pointer;
}
#tip-modal-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
z-index: 10000;
justify-content: center;
align-items: center;
}
.tip-modal-content {
background: #1a1f2e;
border-radius: 12px;
width: 500px;
max-width: 90%;
overflow: hidden;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.tip-modal-tabs {
display: flex;
background: #232936;
}
.tip-modal-tab {
flex: 1;
padding: 15px;
text-align: center;
cursor: pointer;
color: #8a92a3;
font-weight: 500;
border-bottom: 2px solid transparent;
transition: all 0.3s;
}
.tip-modal-tab.active {
color: #fff;
background: #1a1f2e;
border-bottom-color: #3b82f6;
}
.tip-modal-tab:hover {
color: #fff;
}
.tip-modal-inner {
padding: 30px;
}
.tip-modal-title {
font-size: 16px;
color: #e5e7eb;
margin-bottom: 18px;
line-height: 1.5;
display: flex;
flex-direction: column;
gap: 8px;
}
.tip-meta-row {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.tip-token-chip {
padding: 4px 10px;
border-radius: 8px;
background: linear-gradient(135deg, #3b82f6, #2563eb);
color: #fff;
font-weight: 700;
letter-spacing: 0.2px;
box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}
.tip-meta-sub {
color: #9ca3af;
font-size: 13px;
}
.tip-amount-container {
margin-bottom: 20px;
}
.tip-amount-label {
color: #9ca3af;
font-size: 14px;
margin-bottom: 10px;
display: block;
}
.tip-amounts {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.tip-amount-option {
display: none;
}
.tip-amount-label-radio {
padding: 10px 20px;
border: 1px solid #374151;
border-radius: 6px;
cursor: pointer;
transition: all 0.3s;
color: #d1d5db;
background: #232936;
font-size: 14px;
}
.tip-amount-option:checked + .tip-amount-label-radio {
background: #3b82f6;
border-color: #3b82f6;
color: #fff;
}
.tip-amount-label-radio:hover {
border-color: #4b5563;
background: #2d3748;
}
.tip-actions {
display: flex;
gap: 10px;
}
.tip-button-action {
flex: 1;
padding: 12px;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: all 0.3s;
}
.tip-button-cancel {
background: #374151;
color: #d1d5db;
}
.tip-button-cancel:hover {
background: #4b5563;
}
.tip-button-confirm {
background: #3b82f6;
color: #fff;
}
.tip-button-confirm:hover {
background: #2563eb;
}
.tip-button-confirm:disabled {
background: #4b5563;
cursor: not-allowed;
opacity: 0.5;
}
.tip-message {
margin-top: 15px;
padding: 12px;
border-radius: 6px;
font-size: 13px;
display: none;
}
.tip-message.success {
background: #065f46;
color: #d1fae5;
display: block;
}
.tip-message.error {
background: #7f1d1d;
color: #fecaca;
display: block;
}
.tip-message.info {
background: #1e3a8a;
color: #bfdbfe;
display: block;
}
.tip-user-info {
color: #3b82f6;
font-weight: 600;
}
.tip-postscript-container {
margin-bottom: 20px;
}
.tip-postscript-label {
color: #9ca3af;
font-size: 14px;
margin-bottom: 10px;
display: block;
}
.tip-postscript-input {
width: 100%;
padding: 10px;
background: #232936;
border: 1px solid #374151;
border-radius: 6px;
color: #d1d5db;
font-size: 14px;
resize: vertical;
min-height: 80px;
font-family: inherit;
transition: border-color 0.3s;
}
.tip-postscript-input:focus {
outline: none;
border-color: #3b82f6;
}
.tip-postscript-input::placeholder {
color: #6b7280;
}
`;
const dmAndChatStyles = `
/* DM UI */
:root {
--dm-accent: #3b82f6;
--dm-bg: #0f172a;
--dm-text: #e5e7eb;
--dm-muted: #9ca3af;
}
.dm-btn {
cursor: pointer;
color: var(--dm-accent);
font-size: 12px;
font-weight: 600;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid rgba(59,130,246,0.45);
background: rgba(59,130,246,0.08);
padding: 2px 6px;
border-radius: 3px;
margin-left: 6px;
text-decoration: none;
transition: all 0.2s ease;
}
.dm-btn:hover { background: rgba(59,130,246,0.18); }
.dm-btn.loading { opacity: 0.6; pointer-events: none; }
#dm-overlay {
display: none;
position: fixed;
inset: 0;
background: rgba(0,0,0,0.72);
z-index: 10000;
justify-content: center;
align-items: center;
}
.dm-modal {
width: 460px;
max-width: 88vw;
background: #111827;
color: var(--dm-text);
border-radius: 12px;
box-shadow: 0 24px 70px rgba(0,0,0,0.55);
overflow: hidden;
}
.dm-head {
padding: 16px 18px;
background: #0b1220;
border-bottom: 1px solid #1f2937;
font-weight: 700;
display: flex;
align-items: center;
gap: 8px;
}
.dm-body { padding: 18px; }
.dm-field label { color: var(--dm-muted); font-size: 13px; display: block; margin-bottom: 8px; }
.dm-field textarea {
width: 100%;
min-height: 90px;
box-sizing: border-box;
padding: 12px;
border-radius: 8px;
border: 1px solid #1f2937;
background: #0f172a;
color: var(--dm-text);
resize: vertical;
font-size: 14px;
outline: none;
transition: border-color 0.2s ease;
}
.dm-field textarea:focus { border-color: var(--dm-accent); }
.dm-foot {
padding: 14px 18px 16px;
display: flex;
align-items: center;
gap: 10px;
border-top: 1px solid #1f2937;
}
.dm-actions { margin-left: auto; display: flex; gap: 10px; }
.dm-btn-ghost, .dm-btn-primary {
border: none;
border-radius: 8px;
padding: 10px 14px;
font-size: 14px;
cursor: pointer;
transition: all 0.2s ease;
}
.dm-btn-ghost { background: #1f2937; color: var(--dm-text); }
.dm-btn-ghost:hover { background: #273248; }
.dm-btn-primary { background: var(--dm-accent); color: #fff; }
.dm-btn-primary[disabled] { opacity: 0.6; cursor: not-allowed; }
.dm-status { color: var(--dm-muted); font-size: 12px; }
/* Quick Thank */
.quick-thank-btn { cursor: pointer; }
.quick-thank-modal {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: #222;
color: #fff;
padding: 12px;
border-radius: 6px;
z-index: 99999;
min-width: 280px;
}
.quick-thank-modal input[type=checkbox] { margin-right: 6px; }
.quick-thank-modal .actions { margin-top: 10px; text-align: right; }
.tip-chat-launcher {
position: fixed;
right: 26px;
bottom: 26px;
width: 52px;
height: 52px;
border-radius: 16px;
border: none;
background: var(--tip-chat-accent, #6366f1);
color: #fff;
cursor: pointer;
box-shadow: 0 18px 45px rgba(2, 6, 23, 0.55);
z-index: 9998;
display: flex;
align-items: center;
justify-content: center;
font-size: 22px;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tip-chat-launcher:hover {
transform: translateY(-2px);
box-shadow: 0 22px 55px rgba(15, 23, 42, 0.65);
}
.tip-chat-launcher-indicator {
position: absolute;
top: 9px;
right: 10px;
width: 10px;
height: 10px;
border-radius: 50%;
background: #f87171;
box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.32);
}
.tip-chat-panel {
position: fixed;
right: 26px;
bottom: 90px;
z-index: 9999;
opacity: 0;
pointer-events: none;
transform: translateY(12px);
transition: opacity 0.2s ease, transform 0.2s ease;
}
.tip-chat-panel.open {
opacity: 1;
pointer-events: auto;
transform: translateY(0);
}
.tip-chat-panel.custom-position {
right: auto;
bottom: auto;
}
.tip-chat-panel.dragging {
cursor: move;
}
.tip-chat-shell {
width: min(920px, 96vw);
height: min(740px, 85vh);
min-width: 600px;
min-height: 420px;
display: flex;
border-radius: 18px;
overflow: hidden;
background: var(--tip-chat-panel-bg);
border: 1px solid var(--tip-chat-border);
color: var(--tip-chat-text);
box-shadow: 0 30px 70px rgba(2, 6, 23, 0.7);
position: relative;
}
.tip-chat-draggable {
cursor: move;
user-select: none;
}
.tip-chat-resize-handle {
position: absolute;
width: 22px;
height: 22px;
right: 8px;
bottom: 8px;
border-radius: 6px;
border: 1px solid var(--tip-chat-border);
background: rgba(148, 163, 184, 0.12);
cursor: nwse-resize;
z-index: 2;
box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.2);
display: flex;
align-items: center;
justify-content: center;
}
.tip-chat-resize-handle::after {
content: '';
width: 14px;
height: 14px;
background: url(${RESIZE_ICON_URL}) center/contain no-repeat;
opacity: 0.85;
}
.tip-chat-resize-handle:hover {
background-color: rgba(99, 102, 241, 0.2);
}
.tip-chat-sidebar {
width: 400px;
min-width: 360px;
background: var(--tip-chat-sidebar-bg);
border-right: 1px solid var(--tip-chat-border);
display: flex;
flex-direction: column;
}
.tip-chat-sidebar-header {
padding: 18px 20px 12px;
border-bottom: 1px solid var(--tip-chat-border);
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 10px;
}
.tip-chat-title {
font-size: 16px;
font-weight: 700;
}
.tip-chat-subtitle {
font-size: 12px;
color: var(--tip-chat-muted);
}
.tip-chat-sidebar-actions {
display: flex;
gap: 6px;
}
.tip-chat-icon-btn {
width: 28px;
height: 28px;
border-radius: 8px;
border: 1px solid var(--tip-chat-border);
background: transparent;
color: var(--tip-chat-text);
cursor: pointer;
font-size: 13px;
transition: background 0.2s ease;
}
.tip-chat-icon-btn:hover {
background: rgba(148, 163, 184, 0.12);
}
.tip-chat-icon-btn.loading {
opacity: 0.6;
pointer-events: none;
}
.tip-chat-icon-btn.tip-chat-new {
font-weight: 700;
}
.tip-chat-icon-btn.tip-chat-theme {
font-size: 14px;
}
.tip-chat-conversation-list {
flex: 1;
overflow-y: auto;
padding: 8px;
}
.tip-chat-conversation-empty {
padding: 20px;
text-align: center;
color: var(--tip-chat-muted);
font-size: 13px;
}
.tip-chat-conversation-item {
width: 100%;
border: none;
background: transparent;
color: inherit;
padding: 10px;
border-radius: 10px;
display: flex;
gap: 10px;
cursor: pointer;
text-align: left;
transition: background 0.2s ease;
}
.tip-chat-conversation-item:hover {
background: rgba(148, 163, 184, 0.12);
}
.tip-chat-conversation-item.active {
background: rgba(99, 102, 241, 0.18);
}
.tip-chat-conversation-item.pinned {
border: 1px solid rgba(99, 102, 241, 0.35);
background: rgba(99, 102, 241, 0.08);
}
.tip-chat-conversation-pin-label {
color: var(--tip-chat-accent);
font-size: 11px;
margin-left: 6px;
}
.tip-chat-avatar {
width: 38px;
height: 38px;
border-radius: 12px;
background: rgba(148, 163, 184, 0.25);
display: flex;
align-items: center;
justify-content: center;
font-weight: 700;
font-size: 14px;
color: var(--tip-chat-text);
overflow: hidden;
}
.tip-chat-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}
.tip-chat-conversation-meta {
flex: 1;
min-width: 0;
}
.tip-chat-conversation-meta header {
display: flex;
justify-content: space-between;
font-size: 13px;
margin-bottom: 4px;
}
.tip-chat-conversation-meta header span:last-child {
color: var(--tip-chat-muted);
font-size: 12px;
}
.tip-chat-conversation-preview {
color: var(--tip-chat-muted);
font-size: 12px;
line-height: 1.4;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.tip-chat-thread {
flex: 1;
display: flex;
flex-direction: column;
background: var(--tip-chat-panel-bg);
}
.tip-chat-thread-header {
padding: 18px 22px 14px;
border-bottom: 1px solid var(--tip-chat-border);
display: flex;
align-items: center;
gap: 12px;
}
.tip-chat-thread-info {
flex: 1;
min-width: 0;
}
.tip-chat-thread-title {
font-size: 15px;
font-weight: 600;
}
.tip-chat-thread-meta {
font-size: 12px;
color: var(--tip-chat-muted);
margin-top: 2px;
}
.tip-chat-thread-actions {
display: flex;
align-items: center;
gap: 8px;
}
.tip-chat-thread-tip-btn {
height: 30px;
padding: 0 12px;
border-radius: 8px;
border: 1px solid rgba(99, 102, 241, 0.45);
background: rgba(99, 102, 241, 0.14);
color: var(--tip-chat-text);
font-weight: 600;
font-size: 12px;
cursor: pointer;
transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.tip-chat-thread-tip-btn:hover:not(:disabled) {
background: rgba(99, 102, 241, 0.22);
border-color: rgba(99, 102, 241, 0.7);
color: #fff;
}
.tip-chat-thread-tip-btn:disabled,
.tip-chat-thread-tip-btn.loading {
opacity: 0.5;
cursor: not-allowed;
pointer-events: none;
}
.tip-chat-thread-pin-btn {
height: 30px;
padding: 0 14px;
border-radius: 8px;
border: 1px dashed rgba(148, 163, 184, 0.45);
background: transparent;
color: var(--tip-chat-muted);
font-size: 11px;
letter-spacing: 0.08em;
cursor: pointer;
transition: all 0.2s ease;
}
.tip-chat-thread-pin-btn.pinned {
color: var(--tip-chat-text);
border-color: rgba(99, 102, 241, 0.65);