/* ===== 基础 ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0; background: #f5f7fa; color: #1f2733;
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: #2f6fd0; text-decoration: none; }
a:hover { color: #1d5bb8; }
.hide { display: none !important; }
.flex1 { flex: 1; }
input, select, button, textarea { font-family: inherit; font-size: 14px; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    height: 34px; padding: 0 14px; border: 1px solid #dde2ea; background: #fff; color: #2b3444;
    border-radius: 7px; cursor: pointer; white-space: nowrap; transition: .15s;
}
.btn:hover { border-color: #b9c4d4; background: #f7f9fc; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: #2f6fd0; border-color: #2f6fd0; color: #fff; }
.btn.primary:hover { background: #275fb5; }
.btn.danger { color: #d13c3c; }
.btn.danger:hover { background: #fff2f2; border-color: #f0b6b6; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #eef2f8; }
.btn.icon { width: 34px; padding: 0; font-size: 16px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ===== 顶栏 ===== */
.topbar {
    height: 56px; background: #fff; border-bottom: 1px solid #e8ecf2;
    display: flex; align-items: center; padding: 0 16px; gap: 16px;
    position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 17px; font-weight: 600; color: #1a2231; }
.brand-icon { font-size: 22px; color: #2f6fd0; }
.search { position: relative; flex: 1; max-width: 420px; }
.search input {
    width: 100%; height: 36px; padding: 0 32px 0 34px; border: 1px solid #e2e7ef;
    border-radius: 18px; background: #f5f7fa url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b95a6' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>") no-repeat 10px center;
    outline: none;
}
.search input:focus { border-color: #2f6fd0; background-color: #fff; }
.search-clear { position: absolute; right: 12px; top: 9px; cursor: pointer; color: #98a2b3; }
.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.user-tag { font-size: 13px; color: #6b7787; margin-right: 4px; }
.user-tag b { color: #2f6fd0; }

/* ===== 布局 ===== */
.layout { display: flex; align-items: flex-start; height: calc(100vh - 56px); }
.sidebar {
    width: 232px; flex: 0 0 232px; background: #fff; border-right: 1px solid #e8ecf2;
    height: 100%; overflow-y: auto; padding: 12px 0;
}
.side-title { padding: 4px 16px 8px; font-size: 12px; color: #98a2b3; letter-spacing: 1px; }
.tree { padding: 0 6px; }
.tnode { display: flex; align-items: center; height: 30px; padding: 0 6px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #3b4657; }
.tnode:hover { background: #f0f4f9; }
.tnode.active { background: #e8f0fd; color: #2f6fd0; font-weight: 600; }
.tnode .tarrow { width: 16px; text-align: center; color: #9aa5b5; font-size: 10px; flex: 0 0 16px; }
.tnode .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-stats { margin: 16px 14px 0; padding-top: 14px; border-top: 1px solid #eef1f6; font-size: 12px; color: #7c8798; line-height: 1.9; }
.bar { height: 6px; background: #eef1f6; border-radius: 3px; overflow: hidden; margin: 6px 0; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #4c8ef0, #2f6fd0); }

.main { flex: 1; height: 100%; overflow-y: auto; padding: 14px 18px 40px; position: relative; min-width: 0; }
.notice { background: #fff8e6; border: 1px solid #ffe9b0; color: #8a6100; padding: 8px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }

/* ===== 工具栏 ===== */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tb-sep { width: 1px; height: 20px; background: #e2e7ef; }
.sel-count { font-size: 13px; color: #6b7787; }
.mini-sel { height: 34px; border: 1px solid #dde2ea; border-radius: 7px; padding: 0 6px; background: #fff; outline: none; color: #2b3444; }
.sel-only { display: none; }
.has-sel .sel-only { display: inline-flex; }

/* ===== 面包屑 ===== */
.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 13px; margin-bottom: 10px; color: #6b7787; }
.crumb a { color: #4a5666; padding: 2px 4px; border-radius: 4px; }
.crumb a:hover { background: #eef2f8; color: #2f6fd0; }
.crumb .sep { color: #c3cbd8; }
.crumb .cur { color: #1f2733; font-weight: 600; }

/* ===== 文件列表 ===== */
.filelist { background: #fff; border: 1px solid #e8ecf2; border-radius: 10px; overflow: hidden; min-height: 300px; }
.lhead, .lrow { display: flex; align-items: center; padding: 0 12px; height: 44px; }
.lhead { background: #fafbfd; border-bottom: 1px solid #eef1f6; color: #8b95a6; font-size: 12.5px; position: sticky; top: 0; z-index: 5; }
.lrow { border-bottom: 1px solid #f4f6f9; cursor: default; }
.lrow:hover { background: #f7fafd; }
.lrow.sel { background: #eaf2fd; }
.lrow:last-child { border-bottom: 0; }
.c-chk { flex: 0 0 30px; }
.c-chk input { width: 15px; height: 15px; cursor: pointer; }
.c-icon { flex: 0 0 34px; font-size: 18px; text-align: center; }
.c-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.c-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.c-name .nm:hover { color: #2f6fd0; text-decoration: underline; }
.c-name .note { font-size: 12px; color: #a0aab8; flex: 0 0 auto; }
.c-size { flex: 0 0 100px; color: #6b7787; font-size: 13px; text-align: right; }
.c-time { flex: 0 0 130px; color: #8b95a6; font-size: 12.5px; text-align: right; }
.c-act { flex: 0 0 186px; text-align: right; }
.c-act a { display: inline-block; padding: 3px 6px; font-size: 12.5px; color: #6b7787; border-radius: 4px; }
.c-act a:hover { background: #eef2f8; color: #2f6fd0; }
.c-act a.hot { color: #e0663c; }
.c-act a.hot:hover { background: #fdeee8; color: #c9512a; }
.c-act a.hot.on { color: #fff; background: #e0663c; }
.lrow .c-act { visibility: hidden; }
.lrow:hover .c-act { visibility: visible; }
.ftype { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; font-size: 10px; font-weight: 700; color: #fff; background: #98a2b3; letter-spacing: -.3px; }
.ftype.folder { background: transparent; font-size: 20px; }
.ftype.img { background: #43b581; } .ftype.vid { background: #e0663c; }
.ftype.aud { background: #8c6ad6; } .ftype.doc { background: #2f6fd0; }
.ftype.zip { background: #d4a017; } .ftype.txt { background: #6b7787; }
.ftype.exe { background: #4a5666; } .ftype.pdf { background: #d13c3c; }
.loading, .empty { padding: 60px 20px; text-align: center; color: #98a2b3; }
.empty .big { font-size: 44px; opacity: .5; display: block; margin-bottom: 8px; }

/* 网格视图 */
.filelist.grid .lhead { display: none; }
.filelist.grid { display: flex; flex-wrap: wrap; padding: 12px; gap: 10px; align-content: flex-start; }
.filelist.grid .lrow {
    width: 118px; height: 122px; flex-direction: column; justify-content: center; gap: 6px;
    border: 1px solid #eef1f6; border-radius: 10px; padding: 8px; text-align: center;
}
.filelist.grid .c-chk { position: absolute; }
.filelist.grid .c-icon { flex: none; font-size: 34px; }
.filelist.grid .ftype { width: 42px; height: 42px; font-size: 12px; }
.filelist.grid .ftype.folder { font-size: 38px; }
.filelist.grid .c-name { flex: none; display: block; width: 100%; }
.filelist.grid .c-name .nm { display: block; font-size: 12.5px; }
.filelist.grid .c-size { flex: none; font-size: 11px; text-align: center; width: 100%; }
.filelist.grid .c-time, .filelist.grid .c-act { display: none; }
.filelist.grid .loading, .filelist.grid .empty { width: 100%; }

/* 拖拽提示 */
.drop-hint { position: fixed; inset: 56px 0 0 232px; background: rgba(47,111,208,.08); border: 3px dashed #2f6fd0; z-index: 50; display: none; align-items: center; justify-content: center; }
.drop-hint.on { display: flex; }
.drop-inner { background: #fff; padding: 18px 30px; border-radius: 12px; font-size: 16px; color: #2f6fd0; box-shadow: 0 8px 30px rgba(0,0,0,.12); }

/* ===== 上传队列 ===== */
.uploader {
    position: fixed; right: 20px; bottom: 20px; width: 400px; max-width: calc(100vw - 24px);
    background: #fff; border: 1px solid #e2e7ef; border-radius: 12px; box-shadow: 0 10px 40px rgba(20,32,60,.16); z-index: 60;
}
.up-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid #eef1f6; font-weight: 600; font-size: 14px; }
.up-actions { display: flex; gap: 12px; font-size: 12.5px; font-weight: 400; }
.up-body { max-height: 300px; overflow-y: auto; }
.uploader.folded .up-body, .uploader.folded .up-foot { display: none; }
.up-item { padding: 9px 14px; border-bottom: 1px solid #f4f6f9; }
.up-item:last-child { border-bottom: 0; }
.up-row1 { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.up-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-state { flex: 0 0 auto; font-size: 12px; color: #8b95a6; }
.up-state.ok { color: #18a058; } .up-state.err { color: #d13c3c; }
.up-ops { flex: 0 0 auto; display: flex; gap: 6px; }
.up-ops a { font-size: 12px; color: #8b95a6; }
.up-ops a:hover { color: #2f6fd0; }
.up-prog { height: 4px; background: #eef1f6; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.up-prog i { display: block; height: 100%; width: 0; background: #2f6fd0; transition: width .2s; }
.up-item.done .up-prog i { background: #18a058; }
.up-item.error .up-prog i { background: #d13c3c; }
.up-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: #a0aab8; margin-top: 3px; }
.up-foot { padding: 8px 14px; border-top: 1px solid #eef1f6; font-size: 12.5px; color: #6b7787; display: flex; justify-content: space-between; }

/* ===== 弹层 ===== */
.modal { position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: #fff; border-radius: 12px; width: 480px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-box.wide { width: 720px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #eef1f6; font-size: 16px; font-weight: 600; }
.modal-close { color: #98a2b3; font-size: 16px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid #eef1f6; display: flex; justify-content: flex-end; gap: 8px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #4a5666; margin-bottom: 6px; font-weight: 600; }
.field .tip { font-size: 12px; color: #98a2b3; font-weight: 400; margin-left: 4px; }
.field input[type=text], .field input[type=password], .field input[type=number], .field textarea, .field select {
    width: 100%; height: 36px; padding: 0 10px; border: 1px solid #dde2ea; border-radius: 7px; outline: none; background: #fff;
}
.field textarea { height: 70px; padding: 8px 10px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #2f6fd0; box-shadow: 0 0 0 3px rgba(47,111,208,.1); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.chk-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: #3b4657; cursor: pointer; }
.sec-title { font-size: 13px; font-weight: 700; color: #1f2733; margin: 4px 0 12px; padding-bottom: 6px; border-bottom: 1px solid #eef1f6; }
.copybox { display: flex; gap: 8px; }
.copybox input { flex: 1; }
.copybox textarea { flex: 1; resize: vertical; font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 1.6; }
.copybox .btn { flex: 0 0 auto; align-self: flex-start; }

/* ===== 外链面板 ===== */
.dl-file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 14px;
    background: #f7f9fc; border-radius: 8px; font-size: 13.5px; overflow: hidden; }
.dl-file b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dl-file .tip { color: #8b95a6; font-size: 12px; white-space: nowrap; }
.dl-note { margin-top: 4px; padding: 10px 12px; background: #fff8e6; color: #8a6100;
    border-radius: 6px; font-size: 12.5px; line-height: 1.8; }
.dl-note code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.dl-play { margin-bottom: 14px; background: #000; border-radius: 8px; overflow: hidden; }
.dl-play video { display: block; width: 100%; max-height: 300px; background: #000; }
.mtree { max-height: 320px; overflow-y: auto; border: 1px solid #eef1f6; border-radius: 8px; padding: 6px; }
.share-item { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid #f4f6f9; font-size: 13px; }
.share-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-item .p { color: #d4a017; font-family: monospace; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid #eef1f6; }
.tabs a { padding: 8px 14px; color: #6b7787; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: #2f6fd0; border-color: #2f6fd0; font-weight: 600; }

/* ===== 预览 ===== */
.viewer { position: fixed; inset: 0; background: rgba(12,16,24,.92); z-index: 90; display: flex; flex-direction: column; }
.viewer-bar { height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; color: #e6eaf0; font-size: 14px; }
.viewer-bar a { color: #c8d0dc; margin-left: 18px; font-size: 15px; }
.viewer-bar a:hover { color: #fff; }
.viewer-body { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 10px 20px 24px; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-body video { max-width: 100%; max-height: 100%; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 6px; }
.viewer-body pre { width: 100%; max-width: 1000px; height: 100%; overflow: auto; background: #171c26; color: #d5dbe6; padding: 18px; border-radius: 8px; font: 13px/1.7 Consolas, Monaco, monospace; white-space: pre-wrap; word-break: break-all; margin: 0; }

/* ===== 右键菜单 ===== */
.ctxmenu { position: fixed; z-index: 95; background: #fff; border: 1px solid #e2e7ef; border-radius: 8px; box-shadow: 0 8px 28px rgba(20,32,60,.16); padding: 5px; min-width: 150px; }
.ctxmenu a { display: block; padding: 7px 12px; border-radius: 5px; color: #2b3444; font-size: 13px; }
.ctxmenu a:hover { background: #f0f4f9; }
.ctxmenu a.danger { color: #d13c3c; }
.ctxmenu a.hot { color: #e0663c; font-weight: 600; }
.ctxmenu a.hot:hover { background: #fdeee8; }
.ctxmenu .line { height: 1px; background: #eef1f6; margin: 4px 2px; }

/* ===== 提示 ===== */
.toast-wrap { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: rgba(28,36,50,.92); color: #fff; padding: 9px 18px; border-radius: 8px; font-size: 13.5px; animation: tin .2s; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.toast.ok { background: #18a058; } .toast.err { background: #d13c3c; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* ===== 访问密码门 ===== */
.gate { position: fixed; inset: 0; background: linear-gradient(135deg, #2f6fd0, #1b3a68); z-index: 150; display: flex; align-items: center; justify-content: center; }
.gate-box { background: #fff; border-radius: 14px; padding: 34px 30px; width: 340px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.gate-logo { font-size: 40px; }
.gate-box h2 { margin: 8px 0 4px; font-size: 19px; }
.gate-box p { color: #8b95a6; font-size: 13px; margin: 0 0 18px; }
.gate-box input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #dde2ea; border-radius: 8px; margin-bottom: 12px; outline: none; text-align: center; }
.gate-box input:focus { border-color: #2f6fd0; }
.gate-alt { margin-top: 14px; font-size: 13px; }

/* ===== 分享页 ===== */
.share-page { background: #f0f3f8; }
.share-wrap { max-width: 780px; margin: 0 auto; padding: 24px 16px 40px; }
.share-head { margin-bottom: 16px; }
.share-logo { font-size: 18px; font-weight: 600; color: #1f2733; }
.share-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 3px 18px rgba(20,32,60,.06); }
.share-card.center { text-align: center; padding: 44px 24px; }
.share-card .big { font-size: 46px; }
.share-card h2 { font-size: 19px; margin: 10px 0 6px; }
.share-card p { color: #8b95a6; margin: 0 0 16px; font-size: 13.5px; }
.share-input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #dde2ea; border-radius: 8px; margin-bottom: 12px; text-align: center; outline: none; }
.share-err { color: #d13c3c; font-size: 13px; margin-bottom: 10px; }
.share-file { display: flex; align-items: center; gap: 16px; }
.fi-icon { width: 58px; height: 58px; border-radius: 10px; background: #2f6fd0; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 58px; }
.fi-meta h2 { margin: 0 0 4px; font-size: 17px; word-break: break-all; }
.fi-meta p { margin: 0; }
.share-prev { margin: 18px 0; text-align: center; }
.share-prev img, .share-prev video { max-width: 100%; max-height: 420px; border-radius: 8px; }
.share-prev audio { width: 100%; }
.big-btn { height: 44px; font-size: 15px; margin-top: 18px; }
.share-crumb { font-size: 13px; color: #6b7787; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #eef1f6; }
.share-crumb .sep { color: #c3cbd8; }
.srow { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid #f4f6f9; color: #2b3444; border-radius: 6px; }
.srow:hover { background: #f7fafd; }
.srow .ic { width: 30px; height: 30px; flex: 0 0 30px; display: flex; align-items: center; justify-content: center; background: #98a2b3; color: #fff; border-radius: 6px; font-size: 10px; font-weight: 700; }
.srow .ic.folder { background: transparent; font-size: 20px; }
.srow .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .sz { flex: 0 0 90px; text-align: right; color: #8b95a6; font-size: 12.5px; }
.srow .tm { flex: 0 0 120px; text-align: right; color: #a0aab8; font-size: 12px; }
.share-foot { text-align: center; color: #a0aab8; font-size: 12px; margin-top: 20px; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .sidebar { display: none; }
    .drop-hint { left: 0; }
    .c-time { display: none; }
    .c-act { flex: 0 0 60px; }
    .search { max-width: none; }
    .brand-name { display: none; }
    .uploader { width: auto; left: 12px; right: 12px; }
    .srow .tm { display: none; }
}
