Repository navigation
Expand file tree
/
Copy pathstyles.css
More file actions
290 lines (270 loc) · 10.2 KB
/
Copy pathstyles.css
File metadata and controls
290 lines (270 loc) · 10.2 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
/**
* 划词翻译 v1.1.0 - 样式
*/
/* ========== 翻译图标 ========== */
#st-translate-icon {
position: absolute;
width: 32px; height: 32px;
background: linear-gradient(135deg, #07c160 0%, #05a050 100%);
border-radius: 50%;
box-shadow: 0 3px 10px rgba(7,193,96,0.3);
cursor: pointer;
z-index: 2147483646;
display: flex; align-items: center; justify-content: center;
transition: all 0.2s ease;
animation: st-icon-pop 0.2s ease;
}
#st-translate-icon:hover { transform: scale(1.12); box-shadow: 0 5px 14px rgba(7,193,96,0.4); }
#st-translate-icon svg { width: 18px; height: 18px; color: white; }
@keyframes st-icon-pop { from { opacity:0; transform:scale(0.7); } to { opacity:1; transform:scale(1); } }
/* ========== 翻译弹窗 ========== */
#st-translate-popup {
position: absolute;
width: 380px; max-width: 92vw;
background: #fff;
border-radius: 14px;
box-shadow: 0 8px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
z-index: 2147483647;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
font-size: 14px; line-height: 1.6; color: #333;
overflow: hidden;
animation: st-popup-in 0.22s cubic-bezier(0.16,1,0.3,1);
border: 1px solid rgba(0,0,0,0.06);
}
@keyframes st-popup-in { from { opacity:0; transform:translateY(-8px) scale(0.97); } to { opacity:1; transform:translateY(0) scale(1); } }
/* 头部 */
.st-popup-header {
display: flex; align-items: center; justify-content: space-between;
padding: 10px 12px;
background: linear-gradient(135deg, #07c160 0%, #05a050 100%);
color: white;
}
.st-popup-header-left { display: flex; align-items: center; gap: 8px; }
.st-popup-title { font-weight: 600; font-size: 13px; letter-spacing: 0.3px; }
.st-engine-badge {
font-size: 10px; background: rgba(255,255,255,0.2); padding: 2px 8px;
border-radius: 10px; font-weight: 500;
}
.st-engine-select {
font-size: 11px;
padding: 3px 8px;
border: 1px solid rgba(255,255,255,0.3);
border-radius: 4px;
background: rgba(0,0,0,0.2);
color: white;
cursor: pointer;
outline: none;
margin-left: 8px;
}
.st-engine-select:hover {
background: rgba(0,0,0,0.3);
border-color: rgba(255,255,255,0.5);
}
.st-engine-select:focus {
border-color: #4285f4;
box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3);
}
.st-engine-select option {
background: #333;
color: white;
}
.st-dark-theme .st-engine-select {
background: rgba(255,255,255,0.1);
border-color: rgba(255,255,255,0.2);
}
.st-dark-theme .st-engine-select:hover {
background: rgba(255,255,255,0.15);
}
/* 截图按钮 */
.st-btn-screenshot {
display: flex; align-items: center; gap: 4px;
padding: 5px 10px;
background: #f0f0f0;
border: none; border-radius: 6px;
font-size: 12px; color: #555;
cursor: pointer; transition: all 0.15s;
}
.st-btn-screenshot:hover {
background: #e0e0e0;
color: #333;
}
.st-btn-screenshot svg {
color: #666;
}
/* 截图预览 */
#st-screenshot-preview {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
z-index: 2147483647;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
}
.st-screenshot-overlay {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.85);
display: flex; align-items: center; justify-content: center;
padding: 20px;
}
.st-screenshot-container {
background: white;
border-radius: 12px;
max-width: 90vw;
max-height: 90vh;
display: flex; flex-direction: column;
overflow: hidden;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.st-screenshot-header {
display: flex; align-items: center; justify-content: space-between;
padding: 12px 16px;
background: #07c160;
color: white;
font-weight: 500;
}
.st-screenshot-close {
background: none; border: none;
color: white; font-size: 24px;
cursor: pointer; padding: 0 4px;
}
.st-screenshot-image-container {
position: relative;
flex: 1;
overflow: auto;
max-height: 70vh;
background: #f5f5f5;
}
.st-screenshot-image {
max-width: 100%;
display: block;
cursor: crosshair;
}
.st-screenshot-footer {
display: flex; align-items: center; gap: 12px;
padding: 12px 16px;
background: #f8f9fa;
border-top: 1px solid #eee;
}
.st-screenshot-hint {
flex: 1;
font-size: 13px;
color: #666;
}
.st-screenshot-cancel,
.st-screenshot-confirm {
padding: 8px 16px;
border-radius: 6px;
border: none;
font-size: 13px;
cursor: pointer;
transition: all 0.15s;
}
.st-screenshot-cancel {
background: #f0f0f0;
color: #555;
}
.st-screenshot-cancel:hover {
background: #e0e0e0;
}
.st-screenshot-confirm {
background: #07c160;
color: white;
}
.st-screenshot-confirm:hover:not(:disabled) {
background: #06a050;
}
.st-screenshot-confirm:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.st-popup-actions { display: flex; gap: 4px; }
.st-btn-icon {
background: rgba(255,255,255,0.15); border: none; color: white;
width: 28px; height: 28px; border-radius: 6px;
cursor: pointer; display: flex; align-items: center; justify-content: center;
transition: all 0.15s ease;
}
.st-btn-icon:hover { background: rgba(255,255,255,0.28); }
.st-btn-icon svg { width: 15px; height: 15px; }
.st-btn-icon.st-copied { background: rgba(255,255,255,0.4); }
.st-btn-icon.st-pinned { background: rgba(255,200,0,0.5); }
/* 内容区 */
.st-popup-content { padding: 14px 16px; max-height: 280px; overflow-y: auto; }
.st-source-text {
color: #888; font-size: 13px; line-height: 1.7;
word-wrap: break-word; margin-bottom: 10px;
padding: 8px 10px; background: #f5f6f7; border-radius: 8px;
border-left: 3px solid #ddd;
}
.st-divider { height: 1px; background: linear-gradient(90deg, transparent, #e8e8e8, transparent); margin: 10px 0; }
.st-translated-text { color: #222; font-size: 15px; line-height: 1.8; word-wrap: break-word; font-weight: 500; }
.st-loading { display: flex; align-items: center; gap: 10px; color: #999; font-size: 13px; }
.st-spinner { width: 16px; height: 16px; border: 2px solid #e8e8e8; border-top-color: #07c160; border-radius: 50%; animation: st-spin 0.7s linear infinite; }
@keyframes st-spin { to { transform: rotate(360deg); } }
.st-error { color: #ff4d4f; font-size: 13px; }
/* 底部 */
.st-popup-footer {
display: flex; align-items: center; justify-content: space-between;
padding: 8px 16px; background: #f8f9fa; border-top: 1px solid #eee;
}
.st-lang-info { font-size: 12px; color: #999; }
.st-footer-actions { display: flex; gap: 8px; }
.st-btn-fullpage {
background: transparent; border: 1px solid #ddd; color: #666;
padding: 4px 10px; border-radius: 6px; cursor: pointer;
font-size: 11px; display: flex; align-items: center; gap: 4px;
transition: all 0.15s;
}
.st-btn-fullpage:hover { background: #f0f0f0; border-color: #bbb; color: #333; }
/* ========== 深色主题 ========== */
#st-translate-popup.st-dark-theme { background: #1e1e2e; border-color: #333; color: #e0e0e0; }
#st-translate-popup.st-dark-theme .st-source-text { background: #2a2a3a; color: #aaa; border-left-color: #444; }
#st-translate-popup.st-dark-theme .st-translated-text { color: #e8e8e8; }
#st-translate-popup.st-dark-theme .st-popup-footer { background: #252535; border-top-color: #333; }
#st-translate-popup.st-dark-theme .st-lang-info { color: #888; }
#st-translate-popup.st-dark-theme .st-divider { background: linear-gradient(90deg, transparent, #444, transparent); }
#st-translate-popup.st-dark-theme .st-btn-fullpage { border-color: #444; color: #aaa; }
#st-translate-popup.st-dark-theme .st-btn-fullpage:hover { background: #333; color: #e0e0e0; }
/* ========== 全文翻译 ========== */
#st-fullpage-overlay {
position: fixed; top: 0; left: 0; width: 100%; height: 100%;
background: rgba(255,255,255,0.97); z-index: 2147483647;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
overflow-y: auto; animation: st-fade-in 0.2s ease;
}
@keyframes st-fade-in { from { opacity: 0; } to { opacity: 1; } }
.st-fullpage-container { max-width: 900px; margin: 0 auto; padding: 20px; }
.st-fullpage-header {
position: sticky; top: 0; background: white; padding: 16px 0;
border-bottom: 1px solid #eee; margin-bottom: 20px; z-index: 1;
display: flex; align-items: center; gap: 16px;
}
.st-fullpage-header h3 { font-size: 16px; color: #333; white-space: nowrap; }
.st-fullpage-progress { flex: 1; height: 4px; background: #eee; border-radius: 2px; overflow: hidden; }
.st-fullpage-progress-bar { height: 100%; background: #07c160; border-radius: 2px; transition: width 0.3s; width: 0; }
.st-fullpage-count { font-size: 13px; color: #999; white-space: nowrap; }
.st-fullpage-close {
background: #f5f5f5; border: none; color: #666; padding: 6px 16px;
border-radius: 6px; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.st-fullpage-close:hover { background: #eee; }
.st-fullpage-content { padding-bottom: 40px; }
.st-fullpage-block { margin-bottom: 16px; padding: 16px; background: #fafafa; border-radius: 10px; border-left: 4px solid #07c160; }
.st-fullpage-source { color: #888; font-size: 14px; line-height: 1.8; margin-bottom: 8px; }
.st-fullpage-translated { color: #222; font-size: 15px; line-height: 1.9; font-weight: 500; }
.st-error-text { color: #ff4d4f !important; }
/* ========== 滚动条 ========== */
#st-translate-popup::-webkit-scrollbar, .st-popup-content::-webkit-scrollbar { width: 5px; }
#st-translate-popup::-webkit-scrollbar-track, .st-popup-content::-webkit-scrollbar-track { background: transparent; }
#st-translate-popup::-webkit-scrollbar-thumb, .st-popup-content::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
#st-translate-popup.st-dark-theme::-webkit-scrollbar-thumb, #st-translate-popup.st-dark-theme .st-popup-content::-webkit-scrollbar-thumb { background: #555; }
/* ========== 响应式 ========== */
@media (max-width: 480px) {
#st-translate-popup { width: calc(100vw - 30px); left: 15px !important; right: 15px !important; }
}
/* ========== 禁用选中 ========== */
#st-translate-popup, #st-translate-icon, #st-fullpage-overlay { user-select: none; -webkit-user-select: none; }
/* ========== 动画偏好 ========== */
@media (prefers-reduced-motion: reduce) {
#st-translate-icon, #st-translate-popup, #st-fullpage-overlay { animation: none; }
.st-spinner { animation: none; border-top-color: #e0e0e0; }
}