File size: 5,226 Bytes
e1ae2c6 | 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 | /* ============================================
Base Styles & Global Reset
============================================ */
/* 可访问性:视觉隐藏但保留屏幕阅读器可读 */
.visually-hidden {
position: absolute !important;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
/* 主题切换按钮 - 调整为 iOS 风格 */
.theme-toggle {
position: fixed;
bottom: var(--spacing-xl);
right: var(--spacing-xl);
width: 2.5rem;
height: 2.5rem;
border-radius: var(--radius-lg);
background: rgba(var(--card-bg-rgb), 0.65);
border: 1px solid var(--border-color);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
color: var(--text-color);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all var(--transition-normal);
transition-timing-function: var(--transition-bounce);
z-index: 100;
box-shadow: 0 4px 16px var(--shadow-color);
}
.theme-toggle:hover {
transform: translateY(-2px);
background: rgba(var(--card-bg-rgb), 0.75);
box-shadow: 0 6px 20px var(--shadow-color);
color: var(--accent-color);
}
.theme-toggle:active {
transform: translateY(0);
box-shadow: 0 2px 8px var(--shadow-color);
}
.theme-toggle i {
font-size: 18px;
}
/* 全局样式 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* 全局 Focus Visible 样式 */
:focus-visible {
outline: 2px solid var(--accent-color);
outline-offset: 2px;
}
/* 导航项 Focus 样式 */
.nav-item:focus-visible,
.submenu-item:focus-visible,
.site-card:focus-visible,
.theme-toggle:focus-visible,
.category-toggle:focus-visible,
.menu-toggle:focus-visible,
.search-toggle:focus-visible {
outline: 2px solid var(--accent-color);
outline-offset: 2px;
z-index: 10;
}
/* 通用滚动条样式 */
.custom-scrollbar {
scrollbar-width: thin;
/* Firefox */
scrollbar-color: var(--scrollbar-color) transparent;
/* Firefox */
}
/* Webkit滚动条样式(Chrome, Safari, Edge等) */
.custom-scrollbar::-webkit-scrollbar {
width: 7px;
/* 统一滚动条宽度 */
}
.custom-scrollbar::-webkit-scrollbar-track {
background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
background-color: var(--scrollbar-color);
/* 使用变量 */
border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
background-color: var(--scrollbar-hover-color);
/* 使用变量 */
}
/* 防止滚动条导致的布局偏移 */
html {
overflow-y: hidden;
/* 改为hidden,移除强制显示的滚动条 */
scrollbar-width: thin;
/* Firefox */
/* 明确 rem 基准字号:便于用 rem 统一管理字号(1rem = 16px) */
font-size: 16px;
}
/* 搜索高亮样式 */
.highlight {
background-color: var(--highlight-bg);
border-radius: var(--radius-sm);
padding: 0 2px;
font-weight: bold;
color: var(--text-color);
}
body {
font-family: var(
--font-body,
system-ui,
-apple-system,
'Segoe UI',
Roboto,
'Noto Sans',
'Helvetica Neue',
Arial,
sans-serif
);
font-weight: var(--font-weight-body, normal);
line-height: 1.6;
background-color: var(--bg-color);
color: var(--text-color);
min-height: var(--app-height, 100vh);
overflow: hidden;
/* 防止body滚动 */
padding-right: 0 !important;
/* 防止滚动条导致的布局偏移 */
transition:
background-color 0.3s ease,
color 0.3s ease;
}
/* 布局 */
.layout {
display: flex;
min-height: var(--app-height, 100vh);
position: relative;
z-index: 1;
overflow: hidden;
/* 防止layout滚动 */
opacity: 0;
transition: opacity 0.3s ease;
}
/* 确保加载后立即显示 */
body.loaded .layout {
opacity: 1;
}
/* 移动端基础样式 */
.mobile-buttons {
display: none;
position: fixed;
top: var(--spacing-md);
top: calc(env(safe-area-inset-top) + var(--spacing-md));
left: 0;
right: 0;
width: 100%;
padding: 0 var(--spacing-md);
padding-left: calc(env(safe-area-inset-left) + var(--spacing-md));
padding-right: calc(env(safe-area-inset-right) + var(--spacing-md));
justify-content: space-between;
z-index: 910;
pointer-events: none;
}
.menu-toggle,
.search-toggle {
background: var(--sidebar-bg);
border: none;
color: var(--text-color);
width: 2.5rem;
height: 2.5rem;
border-radius: var(--radius-md);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.25s var(--transition-bounce);
box-shadow: 0 2px 8px var(--shadow-color);
pointer-events: auto;
}
.menu-toggle:hover,
.search-toggle:hover {
background: var(--secondary-bg);
transform: translateY(-2px);
box-shadow: 0 4px 12px var(--shadow-color);
}
.menu-toggle:active,
.search-toggle:active {
transform: translateY(0);
}
/* 遮罩层 */
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
opacity: 0;
visibility: hidden;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
z-index: 950;
/* 调整遮罩层z-index,处于按钮与弹出面板之间 */
}
.overlay.active {
opacity: 1;
visibility: visible;
}
|