Repository navigation
Expand file tree
/
Copy pathstyle.css
More file actions
135 lines (117 loc) · 3.6 KB
/
Copy pathstyle.css
File metadata and controls
135 lines (117 loc) · 3.6 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
/* style.css */
/* 翻译按钮容器 */
.x-translate-btn-container {
display: flex;
align-items: center;
width: fit-content;
cursor: pointer;
margin-top: 4px;
margin-bottom: 4px;
transition: background-color 0.2s;
border-radius: 9999px;
padding: 6px 10px; /* 调整内边距 */
user-select: none;
group: translate-btn;
}
.x-translate-btn-container:hover {
background-color: rgba(29, 155, 240, 0.1);
}
.x-translate-btn-inner {
display: flex;
align-items: center;
gap: 8px; /* 图标和文字间距 */
}
.x-translate-icon {
width: 1.25em;
height: 1.25em;
fill: currentColor;
color: rgb(83, 100, 113);
}
.x-translate-text {
color: rgb(83, 100, 113); /* 默认灰色 */
font-size: 13px;
font-weight: 500; /* 加粗一点 */
line-height: 20px;
}
/* 悬停状态 */
.x-translate-btn-container:hover .x-translate-text,
.x-translate-btn-container:hover .x-translate-icon {
color: rgb(29, 155, 240); /* 悬停蓝色 */
}
/* 翻译结果容器 - 卡片风格 */
.x-translation-result {
margin-top: 8px;
margin-bottom: 8px;
padding: 12px 16px;
background-color: rgb(247, 249, 249); /* 浅色背景 */
border: 1px solid rgb(207, 217, 222); /* 浅色边框 */
border-radius: 16px; /* 圆角 */
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
color: rgb(15, 20, 25);
line-height: 1.5;
font-size: 15px;
position: relative;
width: 100%;
box-sizing: border-box;
animation: fadeIn 0.2s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(-5px); }
to { opacity: 1; transform: translateY(0); }
}
/* 翻译结果头部 */
.x-translation-header {
display: flex;
align-items: center;
font-size: 13px;
font-weight: 600;
color: rgb(83, 100, 113);
margin-bottom: 8px;
gap: 6px;
}
.x-google-icon-svg {
width: 16px;
height: 16px;
}
.x-translation-content {
white-space: pre-wrap; /* 保留换行 */
word-wrap: break-word;
}
.x-translation-link {
color: rgb(29, 155, 240);
text-decoration: none;
}
.x-translation-link:hover {
text-decoration: underline;
}
/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
.x-translate-text, .x-translate-icon {
color: rgb(113, 118, 123);
}
.x-translation-result {
background-color: transparent; /* 深色模式下通常不需要背景色,或者很淡 */
border: 1px solid rgb(51, 54, 57);
color: rgb(231, 233, 234);
}
}
/* 强制深色模式 (如果网页 body 有 dark 类或特定背景) */
body[style*="background-color: rgb(0, 0, 0)"] .x-translation-result,
body[style*="background-color: rgb(21, 32, 43)"] .x-translation-result {
background-color: transparent;
border: 1px solid rgb(56, 68, 77);
color: rgb(231, 233, 234);
}
body[style*="background-color: rgb(0, 0, 0)"] .x-translate-text,
body[style*="background-color: rgb(21, 32, 43)"] .x-translate-text,
body[style*="background-color: rgb(0, 0, 0)"] .x-translate-icon,
body[style*="background-color: rgb(21, 32, 43)"] .x-translate-icon {
color: rgb(113, 118, 123);
}
/* 悬停时保持蓝色 */
body[style*="background-color: rgb(0, 0, 0)"] .x-translate-btn-container:hover .x-translate-text,
body[style*="background-color: rgb(21, 32, 43)"] .x-translate-btn-container:hover .x-translate-text,
body[style*="background-color: rgb(0, 0, 0)"] .x-translate-btn-container:hover .x-translate-icon,
body[style*="background-color: rgb(21, 32, 43)"] .x-translate-btn-container:hover .x-translate-icon {
color: rgb(29, 155, 240);
}