/* Cloud drive workspace, scoped to preserve editor/history styling. */
body:has(.drive-page){background:#fff}
#page:has(.drive-page){max-width:none;width:100%;margin:0;padding:0}
.drive-page{display:block!important;width:100%!important;min-height:calc(100vh - 76px);margin:0!important;padding:0!important;background:#fff;color:#232425;font-family:Arial,Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.drive-main{min-width:0;width:auto!important;max-width:none!important;margin:0!important;padding:0!important}.drive-page svg{display:block;width:20px;height:20px}

.drive-top{height:69px;padding:16px 20px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between}.drive-search-wrap{position:relative;width:540px;height:37px}.drive-search-wrap>svg{position:absolute;z-index:1;left:16px;top:10px;width:16px;height:16px;color:#777}.drive-search-wrap #drive-search{box-sizing:border-box;width:540px;height:37px;padding:8px 16px 8px 42px;border:.5px solid #d4d4dc;border-radius:12px;background:#fff;font-size:14px;line-height:20px}.drive-capacity{display:flex;align-items:baseline;gap:8px}.drive-capacity span{font-size:11px;color:#606366}
.drive-section-tabs{height:43px;box-sizing:border-box;display:flex;align-items:flex-end;padding:0 20px 10px;border-bottom:1px solid #ececec}.drive-section-tabs a{padding:6px 14px;border-radius:16px;background:#171717;color:#fff;text-decoration:none;font-size:12px;font-weight:650}
.drive-toolbar{height:60px;box-sizing:border-box;padding:10px 20px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #ededed;position:relative}.drive-crumbs{flex:1}.drive-sort-control{position:relative;display:flex;align-items:center;height:38px;border:1px solid #e5e5e5;border-radius:9px;background:#fff}.drive-sort-control>button{height:100%;border:0;background:transparent}.drive-sort-control>button:first-child{min-width:116px;padding:0 12px;text-align:left}.drive-sort-control>#drive-direction{width:38px;border-left:1px solid #e5e5e5}.drive-sort-control button.desc svg{transform:rotate(180deg)}
.drive-sort-menu{position:absolute;right:38px;top:43px;z-index:20;width:170px;padding:6px;background:#fff;border:1px solid #e7e7e7;border-radius:8px;box-shadow:0 8px 24px #0002}.drive-sort-menu button{display:block;width:100%;height:35px;padding:0 10px;border:0;border-radius:6px;background:#fff;text-align:left;font-size:12px}.drive-sort-menu button:hover{background:#f6f6f6}.drive-sort-menu button.active{font-weight:700;color:#111}
.drive-view{padding:3px;border-radius:10px;background:#f1f1f1}.drive-view button{height:32px;border:0;border-radius:7px;background:transparent}.drive-view button:focus,.drive-view button:hover,.drive-view button[aria-pressed="true"]{background:#fff;box-shadow:0 1px 5px #0002}
.drive-primary,.drive-trash-button{display:inline-flex;align-items:center;gap:7px;min-height:40px;border-radius:20px;text-decoration:none}.drive-trash-button{padding:0 14px;background:#f3f3f3;color:#333}.drive-new-menu{width:170px!important;padding:6px!important}.drive-new-menu button{height:35px!important;display:flex;align-items:center;gap:10px}.drive-new-menu svg{width:24px!important;height:24px!important}
.drive-collection.grid{display:grid!important;grid-template-columns:repeat(auto-fill,152px)!important;grid-auto-rows:192px!important;gap:12px!important;padding:16px 20px!important}.drive-card{box-sizing:border-box!important;width:152px!important;height:192px!important;padding:0!important;border:0!important;background:transparent!important}.drive-card:hover,.drive-card.selected{background:#f7f7f7!important}.drive-card-main{width:152px!important}.drive-card-preview{box-sizing:border-box!important;width:152px!important;height:152px!important;border-radius:8px!important;background:transparent!important}.drive-card-preview img{width:100%!important;height:100%!important;object-fit:contain!important}.drive-card-main>span:nth-child(2){font-size:12px!important;line-height:14px!important;margin-top:6px!important}.drive-card-main small{font-size:10px!important;line-height:14px!important}
.drive-tasks{width:350px!important;border-radius:8px!important}.drive-dialog{box-sizing:border-box!important;width:440px!important;height:149px!important;min-height:149px!important;padding:0!important;border-radius:8px!important}.drive-dialog form{box-sizing:border-box;height:149px!important;padding:14px 10px 10px!important;display:grid!important;grid-template-rows:24px 31px 40px!important;gap:10px!important}.drive-dialog header{padding:0!important}.drive-dialog header h2{font-size:14px!important;line-height:20px!important}.drive-dialog p{margin:0!important;font-size:12px!important;line-height:18px!important}.drive-dialog footer{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;margin:0!important}.drive-dialog footer button{box-sizing:border-box!important;width:100%!important;height:40px!important;border-radius:6px!important}.drive-dialog .danger-fill{background:#ff3d3d!important;color:#fff!important}.drive-dialog::backdrop{background:rgba(0,0,0,.5)!important}

/* Keep grid thumbnails and labels inside the fixed 152 x 192 tile. */
.drive-collection.grid .drive-card{overflow:visible!important}
.drive-collection.grid .drive-card-main{display:grid!important;grid-template-rows:152px 28px 0!important;align-content:start!important;gap:6px!important;height:192px!important;min-height:0!important;overflow:visible!important}
.drive-collection.grid .drive-card-preview{display:grid!important;place-items:center!important;min-width:0!important;min-height:0!important;padding:5px!important;overflow:hidden!important;border-radius:8px!important;background:#fafafa!important}
.drive-collection.grid .drive-card-preview img{display:block!important;box-sizing:border-box!important;min-width:0!important;min-height:0!important;max-width:100%!important;max-height:100%!important;width:100%!important;height:100%!important;object-fit:contain!important;border-radius:5px!important}
.drive-collection.grid .drive-card-main>span:nth-child(2){display:-webkit-box!important;height:28px!important;margin:0!important;overflow:hidden!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important;font-size:12px!important;line-height:14px!important}
.drive-collection.grid .drive-card-main>small{display:none!important}
.drive-collection.grid .drive-card>input{width:16px!important;height:16px!important;margin:0!important;border-radius:4px!important;background:#fff!important;box-shadow:0 0 0 1px #737373,0 1px 3px #0003!important}
.drive-collection.grid .drive-card>.drive-more{display:grid!important;width:26px!important;height:26px!important;padding:0!important;place-items:center!important;border:1px solid #d7d7d7!important;border-radius:7px!important;background:rgba(255,255,255,.94)!important;color:#222!important;box-shadow:0 1px 3px #0002!important}
.drive-collection.grid:has(>.drive-empty){display:flex!important;align-items:center;justify-content:center;min-height:calc(100vh - 260px)}
.drive-collection.grid>.drive-empty,.drive-collection.list>.drive-empty{box-sizing:border-box;width:100%;min-width:0;max-width:100%;padding:24px;text-align:center}.drive-collection.grid>.drive-empty{min-height:0}.drive-collection.list>.drive-empty{min-height:calc(100vh - 260px)}
.drive-collection .drive-empty b,.drive-collection .drive-empty span{max-width:min(450px,100%);overflow-wrap:anywhere}
.drive-dialog:not(.drive-picker){max-width:calc(100vw - 24px)!important;max-height:calc(100vh - 24px)!important}.drive-dialog:not(.drive-picker) form{max-width:100%;min-width:0}.drive-dialog:not(.drive-picker) p{overflow-wrap:anywhere}
@media(max-width:760px){.drive-dialog:not(.drive-picker){height:auto!important;min-height:0!important}.drive-dialog:not(.drive-picker) form{height:auto!important;min-height:0!important;display:flex!important;flex-direction:column!important;gap:10px!important;padding:16px!important}.drive-dialog:not(.drive-picker) footer{width:100%}}

@media(max-width:760px){.drive-search-wrap,.drive-search-wrap #drive-search{width:min(540px,calc(100vw - 40px))}.drive-capacity{display:none}.drive-toolbar{overflow-x:auto}.drive-collection.grid{grid-template-columns:repeat(auto-fill,minmax(132px,1fr))!important}.drive-card,.drive-card-main{width:100%!important}}
body:has(.drive-page){background:#fff}
#page:has(.drive-page){max-width:none;width:100%;margin:0;padding:0}
.drive-page .drive-card-preview{background:transparent}
.drive-page .drive-card-preview svg.folder-outline{color:#252525;stroke-width:1.8}
.drive-page .drive-search-wrap #drive-search{background:#fff;border-radius:12px}
.drive-page .drive-view button[aria-pressed="true"]{background:#fff;box-shadow:0 1px 5px #0002}
.drive-toolbar #drive-actions{min-width:0}.drive-toolbar #drive-actions strong{white-space:nowrap}.drive-toolbar #drive-actions button{display:inline-flex;height:36px;align-items:center;justify-content:center;white-space:nowrap;line-height:1}@media(max-width:1100px){.drive-toolbar #drive-actions{order:4;flex:1 0 100%;flex-wrap:wrap}.drive-toolbar #drive-actions strong{margin-right:4px}}
.drive-page{width:100%;box-sizing:border-box;margin:0;padding:30px 42px 72px;min-height:calc(100vh - 140px);background:#fff}.drive-page svg{display:block;width:20px;height:20px}.drive-section-tabs{height:60px;display:flex;align-items:flex-end;border-bottom:1px solid #ececec}.drive-section-tabs a{margin-bottom:12px;padding:8px 18px;border-radius:19px;background:#171717;color:#fff;text-decoration:none;font-size:13px;font-weight:650}.drive-search-wrap>svg{position:absolute;z-index:1;left:15px;top:13px;color:#777}.drive-search-wrap #drive-search{box-sizing:border-box;padding-left:45px;border-radius:24px;background:#f7f7f7}.drive-capacity{display:flex;align-items:baseline;gap:8px}.drive-capacity span{font-size:11px;color:#888}.drive-toolbar{border-bottom:1px solid #ededed}.drive-sort-control{display:flex;align-items:center;height:36px;border:1px solid #e5e5e5;border-radius:9px;background:#fafafa;overflow:hidden}.drive-sort-control select,.drive-sort-control button{height:100%;border:0;background:transparent}.drive-sort-control button{border-left:1px solid #e5e5e5}.drive-sort-control button.desc svg{transform:rotate(180deg)}.drive-view{padding:3px;border-radius:10px;background:#f1f1f1}.drive-view button{border:0;border-radius:7px;background:transparent}.drive-view button:focus,.drive-view button:hover{background:#fff;box-shadow:0 1px 5px #0002}.drive-primary,.drive-trash-button{display:inline-flex;align-items:center;gap:7px;border-radius:19px;text-decoration:none}.drive-trash-button{padding:9px 14px;background:#f3f3f3;color:#333}.drive-new-menu button{display:flex;align-items:center;gap:10px}.drive-new-menu svg{width:18px}.drive-card{border:0;background:transparent}.drive-card:hover,.drive-card.selected{border-color:transparent;background:#f7f7f7}.drive-card-preview{border-radius:8px;background:#fafafa}.drive-card-preview svg.folder-outline{width:76px;height:76px;color:#aaa;stroke-width:1}.drive-card-preview svg.file-outline{width:50px;height:50px;color:#aaa}.drive-card-main small{display:block;color:#999;font-size:10px}.drive-more svg{width:17px}.drive-trash-head h1{display:flex;align-items:center;gap:8px;font-size:22px}.drive-trash-head h1 a{color:#222;text-decoration:none}.drive-trash-table{border-top:1px solid #eee}.trash-columns,.trash-row{display:grid;grid-template-columns:minmax(260px,1fr) 180px minmax(210px,.6fr);align-items:center}.trash-columns{height:44px;border-bottom:1px solid #eee;color:#999;font-size:11px}.trash-row{min-height:62px;border-bottom:1px solid #f0f0f0;color:#777;font-size:11px}.trash-row:hover{background:#fafafa}.trash-row>input{margin-left:-24px}@media(max-width:760px){.drive-page{padding:18px 14px 60px}.drive-top{flex-direction:row}.drive-search-wrap{width:calc(100vw - 145px);min-width:180px}.drive-toolbar{overflow:visible}.drive-collection.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.drive-card-preview{height:96px}.trash-columns,.trash-row{grid-template-columns:minmax(140px,1fr) 120px}.trash-columns>:last-child,.trash-row>:last-child{display:none}}.drive-top{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:28px}.drive-search-wrap{position:relative;width:min(560px,60vw)}#drive-search{width:100%;height:46px;padding:0 18px;border:1px solid #dedde4;border-radius:12px;background:#fff;font-size:14px}.drive-capacity{display:grid;text-align:right;gap:4px}.drive-capacity b{font-size:13px}.drive-capacity small{color:var(--muted);font-size:10px}.drive-search-results{position:absolute;z-index:30;top:52px;left:0;width:100%;max-height:420px;overflow:auto;padding:8px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 16px 45px #211a3030}.drive-search-results header{display:flex;justify-content:space-between;padding:8px 10px;color:#777;font-size:11px}.drive-search-results button{display:flex;width:100%;align-items:center;justify-content:space-between;border:0;text-align:left}.drive-search-results button small{color:#9a96a1}.drive-toolbar{position:relative;display:flex;align-items:center;gap:15px;min-height:48px;margin-bottom:18px}.drive-crumbs{display:flex;align-items:center;gap:4px;min-width:180px;margin-right:auto}.drive-crumbs button{border:0;padding:7px 4px;background:transparent;font-size:14px;font-weight:650}.drive-crumbs button:disabled{opacity:1}.drive-toolbar>label{display:flex;align-items:center;gap:5px;padding-left:12px;color:#777;font-size:11px}.drive-toolbar select{border:0;background:transparent}.drive-toolbar #drive-direction{padding:5px 8px}.drive-view{display:flex;gap:3px}.drive-view button{padding:8px 10px;font-size:16px}.drive-new-wrap{position:relative;display:inline-block}.drive-primary{background:#19191d!important;border-color:#19191d!important;color:#fff!important;font-weight:650}.drive-popover{position:absolute;z-index:22;top:calc(100% + 6px);left:0;display:grid;min-width:160px;padding:6px;border:1px solid var(--line);border-radius:11px;background:white;box-shadow:0 14px 35px #211a3025}.drive-popover[hidden]{display:none}.drive-popover button{border:0;text-align:left}.drive-more+.drive-popover{right:4px;left:auto;top:36px}.drive-toolbar #drive-actions{display:flex;align-items:center;gap:7px}.drive-toolbar #drive-actions strong{font-size:12px}.danger{color:#c12c3a!important}.danger-fill{background:#be2636!important;border-color:#be2636!important}.drive-collection{min-height:480px}.drive-collection.list{display:grid;align-content:start}.drive-row{position:relative;display:grid;grid-template-columns:36px minmax(260px,1fr) 150px 190px 45px;align-items:center;min-height:60px;padding:0 10px;border-bottom:1px solid #efedf2;font-size:12px}.drive-row:hover,.drive-row.selected{background:#f7f5fb}.drive-row.drive-head{position:sticky;top:0;z-index:3;min-height:44px;background:#f7f7fa;color:#8b8792}.drive-head button{border:0;background:transparent;text-align:left}.drive-name,.drive-card-main{display:flex;align-items:center;gap:11px;min-width:0;border:0;background:transparent;text-align:left}.drive-name>span:last-of-type{overflow:hidden;text-overflow:ellipsis}.drive-name i{color:#d39e19}.drive-icon{display:grid;width:36px;height:36px;place-items:center;flex:0 0 36px;font-size:25px}.drive-icon img{width:36px;height:36px;object-fit:contain;border-radius:5px}.drive-more{position:relative;border:0;background:transparent;font-weight:bold}.drive-collection.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(135px,1fr));align-content:start;gap:24px 14px}.drive-card{position:relative;min-width:0;padding:7px;border:1px solid transparent;border-radius:10px}.drive-card:hover,.drive-card.selected{background:#f2f0f7;border-color:#ddd8e8}.drive-card>input{position:absolute;z-index:2;left:9px;top:9px}.drive-card>.drive-more{position:absolute;z-index:2;right:4px;top:4px}.drive-card-main{display:grid;width:100%;padding:0;white-space:normal}.drive-card-preview{display:grid;width:100%;height:104px;place-items:center;font-size:55px}.drive-card-preview img{width:100%;height:100%;object-fit:contain}.drive-card-main>span:last-child{height:36px;overflow:hidden;font-size:11px;line-height:18px}.drive-empty{display:flex;min-height:400px;align-items:center;justify-content:center;flex-direction:column;gap:12px;color:#85818d}.drive-empty b{font-size:18px;color:#4b4752}.drive-dialog{width:min(460px,calc(100vw - 24px));padding:0;border:0;border-radius:15px;box-shadow:0 25px 80px #241b3544}.drive-dialog::backdrop{background:#211b2c66}.drive-dialog form{padding:20px}.drive-dialog header,.drive-dialog footer{display:flex;align-items:center;justify-content:space-between;gap:10px}.drive-dialog h2{margin:0 0 15px;font-size:18px}.drive-dialog header button{border:0;background:transparent;font-size:20px}.drive-dialog input{width:100%;height:44px;margin:8px 0 20px;padding:0 12px;border:1px solid var(--line);border-radius:9px}.drive-dialog p{line-height:1.65;color:#686270}.drive-dialog footer{justify-content:flex-end}.drive-tasks{position:fixed;z-index:100;right:22px;bottom:22px;width:360px;max-height:460px;overflow:hidden;border:1px solid #dedce3;border-radius:13px;background:#fff;box-shadow:0 18px 50px #20182d35}.drive-tasks>header{height:48px;padding:0 13px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.drive-tasks>header button{border:0;padding:6px 9px}.drive-task-list{max-height:400px;overflow:auto}.drive-tasks.minimized .drive-task-list{display:none}.drive-task{display:grid;grid-template-columns:1fr auto;gap:5px;padding:11px 13px;border-bottom:1px solid #f0eef2}.drive-task span{display:grid;min-width:0}.drive-task b{overflow:hidden;text-overflow:ellipsis;font-size:11px}.drive-task small{color:#85808b;font-size:10px}.drive-task button{border:0;padding:4px 6px}.drive-task progress{grid-column:1/-1;width:100%;height:4px}.drive-trash-head{display:flex;align-items:center;gap:20px}.drive-trash-head h1{margin-right:auto}.drive-retention{color:#7e7884;font-size:12px}.trash-row{grid-template-columns:36px minmax(260px,1fr) 160px 260px 20px}#trash-actions{display:flex;align-items:center;gap:8px;min-height:48px}@media(max-width:800px){.drive-page{padding:22px 14px}.drive-top{align-items:stretch;flex-direction:column}.drive-search-wrap{width:100%}.drive-capacity{text-align:left}.drive-toolbar{flex-wrap:wrap}.drive-crumbs{width:100%}.drive-row{grid-template-columns:32px minmax(170px,1fr) 90px 36px}.drive-row>span:nth-of-type(2),.drive-row.drive-head button:nth-of-type(3){display:none}.drive-tasks{right:8px;bottom:8px;width:calc(100vw - 16px)}}

/* 换行后的工具栏必须撑开容器，避免覆盖文件列表。 */
.drive-sort-control{overflow:visible}
.drive-sort-menu{left:0;right:auto}
@media(max-width:1100px){
  .drive-toolbar{height:auto;flex-wrap:wrap}
}
@media(max-width:800px){
  .drive-top{height:auto;margin-bottom:0;gap:12px}
  .drive-top .drive-search-wrap,.drive-top .drive-search-wrap #drive-search{width:100%;min-width:0}
  .drive-capacity{display:flex;align-items:baseline;text-align:left}
  .drive-toolbar .drive-crumbs{flex:1 0 100%;min-width:0}
}
