disk.css 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. /* 全局样式 */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. body {
  8. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  9. background: #f5f5f5;
  10. color: #333;
  11. }
  12. /* 主容器 */
  13. .disk-container {
  14. display: flex;
  15. flex-direction: column;
  16. height: 100vh;
  17. background: white;
  18. }
  19. /* 文件列表容器 */
  20. .file-list-container {
  21. position: relative;
  22. flex: 1;
  23. overflow-y: auto;
  24. padding: 24px;
  25. }
  26. /* 拖拽提示 */
  27. .drop-hint {
  28. display: none;
  29. flex-direction: column;
  30. justify-content: center;
  31. align-items: center;
  32. position: absolute;
  33. top: 24px;
  34. left: 24px;
  35. right: 24px;
  36. bottom: 24px;
  37. background: rgba(24, 144, 255, 0.05);
  38. border: 2px dashed #1890ff;
  39. border-radius: 8px;
  40. color: #1890ff;
  41. z-index: 10;
  42. pointer-events: none;
  43. }
  44. .drop-hint svg {
  45. margin-bottom: 16px;
  46. opacity: 0.6;
  47. }
  48. .drop-hint p {
  49. font-size: 16px;
  50. font-weight: 500;
  51. }
  52. .file-list-container.drag-over .drop-hint {
  53. display: flex;
  54. }
  55. /* 文件列表 */
  56. .file-list {
  57. display: flex;
  58. flex-wrap: wrap;
  59. gap: 16px;
  60. padding: 8px;
  61. }
  62. /* 文件项 */
  63. .file-item {
  64. display: flex;
  65. flex-direction: column;
  66. align-items: center;
  67. width: calc((100% - 32px) / 3);
  68. min-width: 120px;
  69. max-width: 180px;
  70. padding: 16px 8px;
  71. border-radius: 8px;
  72. cursor: pointer;
  73. transition: background 0.2s;
  74. user-select: none;
  75. }
  76. .file-item:hover {
  77. background: #f5f5f5;
  78. }
  79. .file-item.selected {
  80. background: #e6f7ff;
  81. }
  82. .file-item.dragging {
  83. opacity: 0.5;
  84. background: #e6f7ff;
  85. }
  86. .file-item.cut {
  87. opacity: 0.6;
  88. filter: grayscale(0.3);
  89. }
  90. .file-item.drag-target {
  91. background: rgba(24, 144, 255, 0.15);
  92. outline: 2px dashed #1890ff;
  93. outline-offset: -2px;
  94. }
  95. /* 选中状态 */
  96. .file-item.selected {
  97. background: rgba(82, 196, 26, 0.1);
  98. }
  99. .file-item .check-mark {
  100. position: absolute;
  101. top: 4px;
  102. left: 4px;
  103. width: 20px;
  104. height: 20px;
  105. background: #52c41a;
  106. border-radius: 50%;
  107. display: none;
  108. align-items: center;
  109. justify-content: center;
  110. color: white;
  111. z-index: 5;
  112. }
  113. .file-item.selected .check-mark {
  114. display: flex;
  115. }
  116. .file-item {
  117. position: relative;
  118. }
  119. /* 框选区域 */
  120. .selection-box {
  121. position: fixed;
  122. border: 1px solid #1890ff;
  123. background: rgba(24, 144, 255, 0.1);
  124. pointer-events: none;
  125. z-index: 1000;
  126. display: none;
  127. }
  128. .file-icon {
  129. display: flex;
  130. justify-content: center;
  131. align-items: center;
  132. width: 100%;
  133. max-width: 140px;
  134. aspect-ratio: 1;
  135. margin: 0 auto 8px;
  136. }
  137. .file-icon svg {
  138. width: 60%;
  139. height: 60%;
  140. }
  141. /* 图片缩略图 */
  142. .file-thumbnail {
  143. display: flex;
  144. justify-content: center;
  145. align-items: center;
  146. width: 100%;
  147. max-width: 140px;
  148. aspect-ratio: 1;
  149. margin: 0 auto 8px;
  150. border-radius: 6px;
  151. overflow: hidden;
  152. /* 棋盘格背景用于显示透明部分 */
  153. background-color: #ffffff;
  154. background-image:
  155. linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
  156. linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
  157. linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
  158. linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
  159. background-size: 16px 16px;
  160. background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  161. border: 1px solid #e5e5e5;
  162. position: relative;
  163. }
  164. .file-thumbnail img {
  165. width: 100%;
  166. height: 100%;
  167. object-fit: contain;
  168. }
  169. /* 文件夹预览徽章 */
  170. .folder-preview {
  171. border: 2px solid #fbbf24;
  172. /* 有预览图的文件夹使用纯白色背景 */
  173. background: #ffffff !important;
  174. background-image: none !important;
  175. }
  176. .folder-badge {
  177. position: absolute;
  178. bottom: 4px;
  179. right: 4px;
  180. width: 24px;
  181. height: 24px;
  182. display: flex;
  183. align-items: center;
  184. justify-content: center;
  185. background: rgba(255, 255, 255, 0.95);
  186. border-radius: 6px;
  187. font-size: 14px;
  188. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  189. }
  190. /* 文件夹图标 */
  191. .folder-icon {
  192. color: #ffc107;
  193. }
  194. /* 文件图标 */
  195. .file-icon-default {
  196. color: #90caf9;
  197. }
  198. .file-icon-image {
  199. color: #81c784;
  200. }
  201. .file-icon-video {
  202. color: #e57373;
  203. }
  204. .file-icon-audio {
  205. color: #ba68c8;
  206. }
  207. .file-icon-zip {
  208. color: #ff8a65;
  209. }
  210. .file-icon-document {
  211. color: #64b5f6;
  212. }
  213. /* 文件名 */
  214. .file-name {
  215. width: 100%;
  216. font-size: 13px;
  217. text-align: center;
  218. word-break: break-all;
  219. color: #333;
  220. line-height: 1.4;
  221. max-height: 2.8em;
  222. overflow: hidden;
  223. display: -webkit-box;
  224. -webkit-line-clamp: 2;
  225. line-clamp: 2;
  226. -webkit-box-orient: vertical;
  227. padding: 2px 4px;
  228. border-radius: 4px;
  229. cursor: text;
  230. }
  231. .file-name:hover {
  232. background: rgba(24, 144, 255, 0.1);
  233. }
  234. /* 重命名输入框 */
  235. .rename-input {
  236. width: 100%;
  237. font-size: 13px;
  238. text-align: center;
  239. padding: 2px 4px;
  240. border: 1px solid #1890ff;
  241. border-radius: 4px;
  242. outline: none;
  243. background: white;
  244. }
  245. /* 文件信息 */
  246. .file-info {
  247. font-size: 11px;
  248. color: #999;
  249. margin-top: 4px;
  250. }
  251. /* 空状态 */
  252. .empty-state {
  253. display: none;
  254. flex-direction: column;
  255. justify-content: center;
  256. align-items: center;
  257. height: 100%;
  258. color: #999;
  259. }
  260. .empty-state svg {
  261. margin-bottom: 24px;
  262. }
  263. .empty-state p {
  264. font-size: 16px;
  265. margin-bottom: 8px;
  266. }
  267. .empty-state .hint {
  268. font-size: 13px;
  269. color: #bbb;
  270. }
  271. .empty-state.show {
  272. display: flex;
  273. }
  274. /* 加载状态 */
  275. .loading {
  276. display: none;
  277. flex-direction: column;
  278. justify-content: center;
  279. align-items: center;
  280. position: absolute;
  281. top: 0;
  282. left: 0;
  283. right: 0;
  284. bottom: 0;
  285. background: rgba(255, 255, 255, 0.9);
  286. z-index: 20;
  287. }
  288. .loading.show {
  289. display: flex;
  290. }
  291. .spinner {
  292. width: 40px;
  293. height: 40px;
  294. border: 3px solid #f3f3f3;
  295. border-top: 3px solid #1890ff;
  296. border-radius: 50%;
  297. animation: spin 1s linear infinite;
  298. }
  299. @keyframes spin {
  300. 0% { transform: rotate(0deg); }
  301. 100% { transform: rotate(360deg); }
  302. }
  303. .loading p {
  304. margin-top: 16px;
  305. color: #666;
  306. font-size: 14px;
  307. }
  308. /* 上传进度 */
  309. .upload-progress {
  310. display: none;
  311. position: fixed;
  312. bottom: 24px;
  313. right: 24px;
  314. background: white;
  315. border-radius: 8px;
  316. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  317. padding: 16px;
  318. min-width: 300px;
  319. max-width: 400px;
  320. z-index: 1000;
  321. }
  322. .upload-progress.show {
  323. display: block;
  324. }
  325. .upload-progress-header {
  326. display: flex;
  327. justify-content: space-between;
  328. align-items: center;
  329. margin-bottom: 12px;
  330. }
  331. .upload-progress-title {
  332. font-size: 14px;
  333. font-weight: 500;
  334. color: #333;
  335. }
  336. .upload-progress-close {
  337. background: none;
  338. border: none;
  339. color: #999;
  340. cursor: pointer;
  341. padding: 4px;
  342. display: flex;
  343. align-items: center;
  344. }
  345. .upload-progress-item {
  346. display: flex;
  347. align-items: center;
  348. gap: 12px;
  349. padding: 8px 0;
  350. border-top: 1px solid #f0f0f0;
  351. }
  352. .upload-progress-icon {
  353. flex-shrink: 0;
  354. color: #1890ff;
  355. }
  356. .upload-progress-info {
  357. flex: 1;
  358. min-width: 0;
  359. }
  360. .upload-progress-name {
  361. font-size: 13px;
  362. color: #333;
  363. white-space: nowrap;
  364. overflow: hidden;
  365. text-overflow: ellipsis;
  366. }
  367. .upload-progress-status {
  368. font-size: 12px;
  369. color: #999;
  370. margin-top: 2px;
  371. }
  372. .upload-progress-bar {
  373. width: 100%;
  374. height: 4px;
  375. background: #f0f0f0;
  376. border-radius: 2px;
  377. margin-top: 4px;
  378. overflow: hidden;
  379. }
  380. .upload-progress-bar-fill {
  381. height: 100%;
  382. background: #1890ff;
  383. transition: width 0.3s;
  384. }
  385. .upload-progress-list {
  386. max-height: 320px;
  387. overflow-y: auto;
  388. }
  389. /* 响应式 */
  390. @media (max-width: 768px) {
  391. .header {
  392. flex-direction: column;
  393. gap: 12px;
  394. align-items: stretch;
  395. }
  396. .breadcrumb {
  397. justify-content: flex-start;
  398. }
  399. .actions {
  400. justify-content: flex-end;
  401. }
  402. .file-list {
  403. gap: 12px;
  404. }
  405. .file-item {
  406. width: calc((100% - 24px) / 3);
  407. min-width: 100px;
  408. max-width: none;
  409. }
  410. }
  411. @media (max-width: 650px) {
  412. .file-item {
  413. width: calc((100% - 12px) / 2);
  414. min-width: 100px;
  415. }
  416. }