Repository navigation
Expand file tree
/
Copy pathstyles.css
More file actions
149 lines (127 loc) · 3.12 KB
/
Copy pathstyles.css
File metadata and controls
149 lines (127 loc) · 3.12 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
/* styles.css - 网页中疑难词汇的样式 */
/* 疑难词汇基础样式 */
.smart-dict-word {
background: linear-gradient(135deg, #667eea20, #764ba220);
border-bottom: 2px dotted #667eea;
border-radius: 3px;
padding: 1px 3px;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
display: inline-block;
color: inherit;
text-decoration: none;
font-weight: 500;
}
/* 悬停效果 */
.smart-dict-word:hover {
background: linear-gradient(135deg, #667eea40, #764ba240);
border-bottom-color: #764ba2;
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}
/* 翻译中状态 */
.smart-dict-word.translating {
background: linear-gradient(135deg, #ffeaa740, #fdcb6e40);
border-bottom-color: #fdcb6e;
animation: pulsing 1.5s ease-in-out infinite;
}
/* 已翻译状态 */
.smart-dict-word.translated {
background: linear-gradient(135deg, #00b89440, #00cec940);
border-bottom: 2px solid #00b894;
color: #00b894;
}
.smart-dict-word.translated:hover {
background: linear-gradient(135deg, #00b89460, #00cec960);
}
/* 脉搏动画 */
@keyframes pulsing {
0%, 100% {
opacity: 1;
transform: scale(1);
}
50% {
opacity: 0.8;
transform: scale(1.02);
}
}
/* 点击效果 */
.smart-dict-word:active {
transform: translateY(0);
transition: transform 0.1s ease;
}
/* 确保不影响原网页布局 */
.smart-dict-word {
line-height: inherit;
font-size: inherit;
font-family: inherit;
vertical-align: baseline;
}
/* 深色主题适配 */
@media (prefers-color-scheme: dark) {
.smart-dict-word {
background: linear-gradient(135deg, #667eea30, #764ba230);
border-bottom-color: #8b9dc3;
}
.smart-dict-word:hover {
background: linear-gradient(135deg, #667eea50, #764ba250);
border-bottom-color: #a29bfe;
}
.smart-dict-word.translating {
background: linear-gradient(135deg, #ffeaa750, #fdcb6e50);
border-bottom-color: #fdcb6e;
}
.smart-dict-word.translated {
background: linear-gradient(135deg, #00b89450, #00cec950);
border-bottom-color: #00cec9;
color: #00cec9;
}
}
/* 高对比度模式支持 */
@media (prefers-contrast: high) {
.smart-dict-word {
background: #667eea;
color: white;
border-bottom: 2px solid #333;
}
.smart-dict-word:hover {
background: #764ba2;
}
.smart-dict-word.translated {
background: #00b894;
border-bottom-color: #333;
}
}
/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
.smart-dict-word {
transition: none;
}
.smart-dict-word.translating {
animation: none;
}
.smart-dict-word:hover {
transform: none;
}
}
/* 移动设备优化 */
@media (max-width: 768px) {
.smart-dict-word {
padding: 2px 4px;
min-height: 24px;
touch-action: manipulation;
}
}
/* 确保在所有背景色上都有足够的对比度 */
.smart-dict-word {
box-decoration-break: clone;
-webkit-box-decoration-break: clone;
}
/* 防止用户选择时的样式冲突 */
.smart-dict-word::selection {
background: rgba(102, 126, 234, 0.3);
}
.smart-dict-word::-moz-selection {
background: rgba(102, 126, 234, 0.3);
}