/* MyExplorer 窗口样式 */
.win {
    position: absolute; min-width: 480px; min-height: 320px;
    background: #fff; border-radius: 6px; overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,.4);
    display: flex; flex-direction: column;
    border: 1px solid #c5cfdd;
}
.win.maximized { border-radius: 0; }
/* 窗口缩放手柄 */
.win-resize { position: absolute; z-index: 5; }
.win-resize.n, .win-resize.s { left: 6px; right: 6px; height: 5px; cursor: ns-resize; }
.win-resize.e, .win-resize.w { top: 6px; bottom: 6px; width: 5px; cursor: ew-resize; }
.win-resize.n { top: 0; }
.win-resize.s { bottom: 0; }
.win-resize.e { right: 0; }
.win-resize.w { left: 0; }
.win-resize.ne, .win-resize.nw { width: 9px; height: 9px; top: 0; cursor: nesw-resize; }
.win-resize.se, .win-resize.sw { width: 9px; height: 9px; bottom: 0; cursor: nwse-resize; }
.win-resize.ne { right: 0; }
.win-resize.nw { left: 0; }
.win-resize.se { right: 0; }
.win-resize.sw { left: 0; }
.win-resize:hover { background: rgba(47,123,230,.5); }
.win.maximized .win-resize { display: none; }
.win-titlebar {
    height: 38px; background: linear-gradient(180deg,#f7f9fc,#e7edf5);
    display: flex; align-items: center; padding: 0 8px;
    border-bottom: 1px solid #d4dce8; cursor: default;
}
.win-title { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: bold; color: #2c3e57; font-size: 13px; overflow: hidden; }
.win-title .fi { width: 22px; height: 22px; line-height: 22px; font-size: 13px; }
.win-title .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-controls { display: flex; gap: 2px; }
.win-ctrl {
    width: 34px; height: 26px; display: flex; align-items: center; justify-content: center;
    border-radius: 4px; cursor: pointer; color: #5a6b82;
}
.win-ctrl:hover { background: rgba(0,0,0,.08); }

/* 最小化按钮：底部横线 */
.win-ctrl.win-min::before {
    content: ''; width: 11px; height: 1.5px; border-radius: 1px; background: currentColor;
}
.win-ctrl.win-min::after { content: ''; }

/* 最大化按钮：单个圆角方框 */
.win-ctrl.win-max { position: relative; }
.win-ctrl.win-max::before {
    content: ''; position: absolute; left: 50%; top: 50%;
    width: 11px; height: 11px; box-sizing: border-box;
    border: 1.5px solid currentColor; border-radius: 2.5px;
    transform: translate(-50%, -50%);
}
/* 还原按钮(最大化状态): 前方框 + 后方框只留右上两条边, 两框清晰错开不再糊在一起 */
.win.maximized .win-ctrl.win-max::before {
    width: 9.5px; height: 9.5px; border-radius: 2px;
    transform: translate(calc(-50% - 2px), calc(-50% + 2px));
}
.win.maximized .win-ctrl.win-max::after {
    content: ''; position: absolute; left: 50%; top: 50%;
    width: 9.5px; height: 9.5px; box-sizing: border-box;
    border: 1.5px solid transparent;
    border-top-color: currentColor; border-right-color: currentColor;
    border-radius: 0 3px 0 0;
    transform: translate(calc(-50% + 2px), calc(-50% - 2px));
}

/* 关闭按钮：叉号 */
.win-ctrl.win-close::before,
.win-ctrl.win-close::after {
    content: ''; position: absolute; width: 12px; height: 1px;
    background: currentColor;
}
.win-ctrl.win-close::before { transform: rotate(45deg); }
.win-ctrl.win-close::after { transform: rotate(-45deg); }
.win-ctrl.win-close { position: relative; }
.win-ctrl.win-close:hover { background: #e81123; color: #fff; }
.win-body { flex: 1; min-height: 0; min-width: 0; display: flex; overflow: hidden; position: relative; }

/* 窗口内布局 */
.explorer { display: flex; width: 100%; }
.ex-sidebar {
    width: 220px; background: #f3f6fb; border-right: 1px solid #e2e8f1;
    display: flex; flex-direction: column; overflow: hidden;
}
.ex-sidebar .side-head { padding: 8px 12px; font-weight: bold; color: #46566f; border-bottom: 1px solid #e2e8f1; }
.ex-tree { flex: 1; overflow: auto; padding: 4px 0; }
.tree-node { display: flex; align-items: center; padding: 5px 10px; cursor: pointer; color: #3d4d66; font-size: 12px; }
.tree-node:hover { background: #e6eef8; }
.tree-node.active { background: #d4e4fa; color: #1d4f9e; }
.tree-node .tw { width: 16px; text-align: center; color: #8a97ab; }
.tree-node .nm { margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-children { margin-left: 14px; }

.ex-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.ex-toolbar {
    height: 38px; display: flex; align-items: center; gap: 2px;
    padding: 0 6px; border-bottom: 1px solid #e2e8f1; background: #fafcff; flex-wrap: wrap;
}
.ex-tool {
    padding: 5px 9px; border-radius: 4px; cursor: pointer; color: #44546c;
    display: flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap;
}
.ex-tool:hover { background: #e6eef8; }
.ex-tool.disabled { color: #b9c2d0; cursor: default; }
.ex-tool.disabled:hover { background: none; }
.ex-tool .ic { font-size: 14px; }
.ex-sep { width: 1px; height: 20px; background: #dde4ee; margin: 0 4px; }

.ex-address {
    height: 34px; display: flex; align-items: center; gap: 6px;
    padding: 0 8px; border-bottom: 1px solid #eef2f7; background: #fff;
}
.ex-nav-btn { width: 26px; height: 24px; border: 1px solid #d4dce8; border-radius: 3px; cursor: pointer; text-align: center; line-height: 22px; color: #5a6b82; }
.ex-nav-btn:hover { background: #eef3f9; }
.ex-breadcrumb { flex: 1; display: flex; align-items: center; gap: 2px; overflow: hidden; font-size: 12px; }
.ex-crumb { padding: 3px 8px; border-radius: 3px; cursor: pointer; color: #2c6fd6; white-space: nowrap; }
.ex-crumb:hover { background: #e6eef8; }
.ex-crumb.sep { color: #aab4c4; cursor: default; }
.ex-search { width: 160px; height: 24px; border: 1px solid #d4dce8; border-radius: 12px; padding: 0 10px; outline: none; font-size: 12px; }

.ex-content { flex: 1; overflow: auto; position: relative; background: #fff; }
.ex-content.loading::after {
    content: "加载中..."; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center; color: #8a97ab;
    background: rgba(255,255,255,.6);
}

/* 图标视图 / 列表视图样式统一由 explorer.css 提供，此处不再重复定义，
   避免 window.css 后加载时覆盖 explorer.css 中的文件名换行/省略规则 */

/* 分栏视图 */
.view-split { display: flex; width: 100%; height: 100%; }
.view-split .pane { flex: 1; overflow: auto; border-right: 1px solid #eef2f7; }
.view-split .item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; }
.view-split .item:hover { background: #eef4fc; }
.view-split .item.selected { background: #d4e4fa; }

.ex-empty { padding: 40px; text-align: center; color: #aab4c4; }

/* 状态栏 */
.ex-statusbar { height: 26px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-top: 1px solid #e2e8f1; background: #fafcff; font-size: 11px; color: #6b7892; }

/* 窗口底部操作栏(保存/另存为等) */
.win-foot {
    border-top: 1px solid #e2e8f1; background: #fafcff; padding: 8px 12px;
    display: flex; justify-content: flex-end; gap: 8px; align-items: center;
}

/* 文本编辑器(窗口内) */
.editor-body { display: flex; flex-direction: column; width: 100%; height: 100%; background: #1e2227; }
.editor-body.ed-light { background: #fff; }
.editor-toolbar {
    display: flex; align-items: center; gap: 8px; padding: 7px 10px;
    background: #2a2f37; border-bottom: 1px solid #1a1d22; flex: 0 0 auto;
}
.editor-toolbar .editor-name { color: #e6ebf2; font-size: 13px; font-weight: 600; }
.editor-toolbar .spacer { flex: 1; }
.editor-toolbar .et-lang-label { color: #93a0b4; font-size: 12px; }
.editor-toolbar .editor-lang {
    background: #1e2227; color: #d7dee8; border: 1px solid #3a414c;
    border-radius: 5px; padding: 4px 6px; font-size: 12px; outline: none;
}
.editor-toolbar .btn { padding: 5px 12px; font-size: 12px; }

/* 编辑器菜单栏(对齐 KodExplorer) */
.editor-menubar {
    display: flex; align-items: stretch; background: #252a32; border-bottom: 1px solid #16191e;
    flex: 0 0 auto; user-select: none;
}
.editor-menubar .em-item {
    position: relative; padding: 8px 14px; color: #c7d0dc; font-size: 13px; cursor: pointer;
    border-right: 1px solid transparent; transition: background .12s, color .12s;
}
.editor-menubar .em-item:hover { background: #313845; color: #fff; }
.editor-menubar .em-drop {
    display: none; position: absolute; top: 100%; left: 0; min-width: 200px; z-index: 50;
    background: #2a2f37; border: 1px solid #16191e; border-radius: 0 6px 6px 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,.5); padding: 5px 0;
}
.editor-menubar .em-option {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 14px 7px 14px; color: #c7d0dc; font-size: 13px; cursor: pointer; white-space: nowrap;
    transition: background .1s;
}
.editor-menubar .em-option .et-ic { color: #8a97a8; flex: 0 0 auto; }
.editor-menubar .em-option .em-label { flex: 1 1 auto; }
.editor-menubar .em-option .em-key {
    flex: 0 0 auto; font-size: 11px; color: #6b7684; background: #1e2227;
    border: 1px solid #333b47; border-radius: 4px; padding: 1px 6px; letter-spacing: .5px;
}
.editor-menubar .em-option:hover { background: #3a4452; color: #fff; }
.editor-menubar .em-option:hover .et-ic { color: #c7d0dc; }
.editor-menubar .em-option:hover .em-key { color: #aab5c3; border-color: #4a5565; }

/* 编辑器工具栏按钮 */
.editor-toolbar .et-ic { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.editor-toolbar .et-ic svg { display: block; }
.editor-toolbar .et-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 11px; font-size: 12px; color: #d7dee8; background: transparent;
    border: 1px solid transparent; border-radius: 6px; cursor: pointer;
    line-height: 1; white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.editor-toolbar .et-btn .et-txt { line-height: 1; }
.editor-toolbar .et-btn:hover { background: #3c4756; color: #fff; }
.editor-toolbar .et-btn.primary { background: #2f7be6; border-color: #2f7be6; color: #fff; }
.editor-toolbar .et-btn.primary:hover { background: #3a87ef; border-color: #3a87ef; }
.editor-toolbar .et-btn.icon-only { padding: 6px 8px; }
.editor-toolbar .et-btn.on { background: #2a3f57; color: #7ab0ff; }
.editor-toolbar .et-btn.on:hover { background: #314a66; }
.editor-toolbar .et-sep { width: 1px; height: 18px; background: #3d4654; margin: 0 5px; align-self: center; }

/* 编辑器编辑区 */
.editor-main { display: flex; flex: 1; min-height: 0; width: 100%; overflow: hidden; }
.editor-ace { flex: 1; min-height: 0; min-width: 0; position: relative; overflow: hidden; }
.editor-ace .ace_editor { width: 100%; height: 100%; font-size: 14px; }

/* Markdown 预览（分栏） */
.editor-preview { display: none; }
.editor-body.md-split .editor-main > .editor-ace { flex: 0 0 50%; }
.editor-body.md-split .editor-preview {
    display: block; flex: 1; min-width: 0; overflow: auto;
    border-left: 1px solid #d6dae1; background: #fff;
    user-select: text;
}
.editor-body.ed-dark.md-split .editor-preview { background: #1e2227; border-left-color: #16191e; }
/* 纯预览模式：隐藏编辑器，预览全宽 */
.editor-body.md-preview .editor-main > .editor-ace { display: none; }
.editor-body.md-preview .editor-preview {
    display: block; flex: 1; min-width: 0; overflow: auto;
    background: #fff; border-left: none;
    user-select: text;
}
.editor-body.ed-dark.md-preview .editor-preview { background: #1e2227; }
.md-body { padding: 16px 22px; color: #24292f; font: 14px/1.7 -apple-system,"Segoe UI","Microsoft YaHei",sans-serif; user-select: text; }
.editor-body.ed-dark .md-body { color: #d7dee8; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4, .md-body h5, .md-body h6 {
    margin: 18px 0 10px; font-weight: 600; line-height: 1.3;
}
.md-body h1 { font-size: 26px; border-bottom: 1px solid #e3e6ea; padding-bottom: 8px; }
.md-body h2 { font-size: 21px; border-bottom: 1px solid #e3e6ea; padding-bottom: 6px; }
.md-body h3 { font-size: 17px; }
.editor-body.ed-dark .md-body h1, .editor-body.ed-dark .md-body h2 { border-bottom-color: #30363d; }
.md-body p { margin: 10px 0; }
.md-body ul, .md-body ol { margin: 10px 0; padding-left: 26px; }
.md-body li { margin: 4px 0; }
.md-body a { color: #2f7be6; text-decoration: none; }
.md-body a:hover { text-decoration: underline; }
.md-body code {
    background: #f0f2f5; border-radius: 4px; padding: 2px 6px;
    font: 13px/1.5 Consolas,Menlo,monospace; color: #c7254e;
}
.editor-body.ed-dark .md-body code { background: #2a2f37; color: #f6c453; }
.md-body pre {
    background: #f6f8fa; border: 1px solid #e3e6ea; border-radius: 6px;
    padding: 12px 14px; overflow: auto; margin: 12px 0;
}
.md-body pre code { background: none; padding: 0; color: #24292f; }
.editor-body.ed-dark .md-body pre { background: #161a1f; border-color: #30363d; }
.editor-body.ed-dark .md-body pre code { color: #d7dee8; }
.md-body blockquote {
    margin: 12px 0; padding: 6px 14px; color: #6a737d;
    border-left: 4px solid #d0d7de; background: #f8f9fb;
}
.editor-body.ed-dark .md-body blockquote { color: #8a97a8; border-left-color: #3d4654; background: #22262c; }
.md-body hr { border: none; border-top: 1px solid #e3e6ea; margin: 18px 0; }
.editor-body.ed-dark .md-body hr { border-top-color: #30363d; }
.md-body img { max-width: 100%; border-radius: 4px; }
.md-body table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.md-body table th, .md-body table td { border: 1px solid #d0d7de; padding: 8px 12px; }
.md-body table th { background: #f6f8fa; font-weight: 600; }
.editor-body.ed-dark .md-body table th,
.editor-body.ed-dark .md-body table td { border-color: #30363d; }
.editor-body.ed-dark .md-body table th { background: #161a1f; }

/* ============ 文件操作任务窗（仿宝塔） ============ */
.util-taskwin {
    position: fixed; right: 24px; bottom: 24px; z-index: 9999;
    width: 460px; max-width: 92vw; max-height: 70vh;
    background: #fff; border-radius: 8px; overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,.45);
    display: flex; flex-direction: column; font-size: 13px; color: #24292f;
}
.util-taskwin-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: linear-gradient(180deg,#f7f9fc,#e7edf5);
    color: #2c3e57; font-weight: bold; font-size: 13px;
    border-bottom: 1px solid #d4dce8; cursor: move; user-select: none;
}
.util-taskwin-x { cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.util-taskwin-sum { padding: 8px 14px; background: #f6f8fa; border-bottom: 1px solid #e1e4e8; }
.util-taskwin-sum .ok { color: #1a7f37; }
.util-taskwin-sum .bad { color: #cf222e; }
.util-taskwin-note { margin-top: 4px; font-size: 12px; color: #57606a; }
.util-taskwin-list { flex: 1; overflow-y: auto; padding: 6px 0; min-height: 80px; max-height: 46vh; }
.util-taskwin-row {
    display: flex; align-items: baseline; gap: 8px; padding: 4px 14px;
    border-bottom: 1px solid #f0f0f0; line-height: 1.4;
}
.util-taskwin-row[data-status="fail"] { background: #fff5f5; }
.util-taskwin-row[data-status="ok"] { color: #57606a; }
.util-taskwin-st { flex: 0 0 18px; text-align: center; }
.util-taskwin-lb { flex: 1 1 auto; word-break: break-all; }
.util-taskwin-msg { flex: 0 0 auto; max-width: 50%; color: #cf222e; font-size: 12px; word-break: break-all; text-align: right; }
.util-taskwin-retry {
    margin-left: 6px; color: #2f7be6; cursor: pointer; font-size: 12px;
    border: 1px solid #b9d2f7; border-radius: 3px; padding: 0 4px; display: inline-block; line-height: 16px;
}
.util-taskwin-retry:hover { background: #e8f1fe; color: #1d4f9e; }
.util-taskwin-foot { display: flex; gap: 8px; padding: 8px 14px; border-top: 1px solid #e1e4e8; background: #f6f8fa; }
.util-taskwin-btn {
    padding: 5px 12px; border: 1px solid #d0d7de; border-radius: 5px;
    background: #fff; cursor: pointer; font-size: 12px; color: #24292f;
}
.util-taskwin-btn:hover { background: #f3f4f6; }
.util-taskwin-btn:disabled { opacity: .5; cursor: default; }

/* 编辑器状态栏 */
.editor-statusbar {
    display: flex; align-items: center; gap: 16px; padding: 0 14px; height: 26px; flex: 0 0 auto;
    background: #252a32; border-top: 1px solid #16191e; color: #8a97a8; font-size: 12px;
}
.editor-statusbar .st-item { color: #8a97a8; }
.editor-statusbar .spacer { flex: 1; }
.editor-statusbar .st-state.dirty { color: #f6c453; }
.editor-statusbar .st-state.saving { color: #4f9bff; }
.win-body .editor-area {
    flex: 1; width: 100% !important; height: auto !important; min-height: 120px;
    border: none; outline: none; resize: none; padding: 12px 14px;
    font: 13px/1.6 "Consolas","Menlo","Courier New",monospace; color: #2c3e57;
    box-sizing: border-box; background: #1e2227; color: #d7dee8;
}

/* 媒体播放器 (DPlayer) */
.dp-layout { display: flex; flex-direction: row; }
.dp-box {
    flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center;
    background: #000; padding: 6px; overflow: hidden; position: relative;
}
/* 视频无法解码时的提示浮层(编码不支持/文件损坏) */
.dp-error {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    z-index: 6; max-width: 80%; padding: 18px 24px; border-radius: 8px;
    background: rgba(0, 0, 0, .62); color: #fff; text-align: center; line-height: 1.9;
}
.dp-error .dp-error-title { font-size: 15px; }
.dp-error .dp-error-tip { font-size: 12px; opacity: .78; margin-top: 4px; }
.dp-error .dp-error-dl { display: inline-block; margin-top: 8px; color: #4f9bff; font-size: 12px; }
/* 错误提示里的操作区: "转换后播放" 按钮 + 下载链接 */
.dp-error .dp-error-acts {
    margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 14px;
}
.dp-error .dp-error-acts .btn { font-size: 12px; padding: 5px 14px; }
.dp-error .btn.disabled { opacity: .6; pointer-events: none; }
/* 自动转换时的提示: 此时服务端在转, 播放器只会一直转圈, 得说明白在等什么 */
.dp-converting {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    z-index: 7; max-width: 80%; padding: 16px 22px; border-radius: 8px;
    background: rgba(0, 0, 0, .62); color: #fff; text-align: center; line-height: 1.9;
}
.dp-converting .dp-error-title { font-size: 15px; }
.dp-converting .dp-error-tip { font-size: 12px; opacity: .78; margin-top: 4px; }
/* 音频无法解码时的提示(与视频提示保持同一观感) */
.jp-error {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    z-index: 6; max-width: 80%; padding: 16px 22px; border-radius: 8px;
    background: rgba(0, 0, 0, .66); color: #fff; text-align: center; line-height: 1.9;
}
.jp-error .dp-error-title { font-size: 15px; }
.jp-error .dp-error-tip { font-size: 12px; opacity: .78; margin-top: 4px; }
.jp-error .dp-error-dl { display: inline-block; margin-top: 8px; color: #4f9bff; font-size: 12px; }
.dp-box .dplayer { width: 100%; max-width: 100%; border-radius: 6px; overflow: hidden; }
.player-list {
    flex: 0 0 240px; width: 240px; height: 100%; overflow-y: auto; background: #11151c;
    border-left: 1px solid #232a34; padding: 4px 0;
}
.player-list .pl-item {
    display: flex; align-items: center; gap: 8px; padding: 6px 14px;
    color: #aeb9c7; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-list .pl-item:hover { background: #1a2029; color: #e6ebf2; }
.player-list .pl-item.active { background: #243447; color: #fff; }
.player-list .pl-item .pl-ic { color: #4f9bff; width: 14px; text-align: center; flex: 0 0 14px; }
.player-list .pl-item .pl-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* 视频播放列表顶部循环按钮 */
.player-list .pl-loop {
    display: flex; justify-content: flex-end; padding: 6px 10px;
    border-bottom: 1px solid #232a34;
}
.player-list .pl-loop-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
    color: #aeb9c7; background: rgba(255,255,255,.06);
    transition: background .15s, color .15s;
}
.player-list .pl-loop-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.player-list .pl-loop-btn.on { color: #4f9bff; background: rgba(79,155,255,.18); }
.player-list .pl-loop-btn .et-ic { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.player-list .pl-loop-btn .et-ic svg { display: block; }

/* m3u 播放列表音视频混排: 当前播放器不支持的条目灰显并跳过 */
.player-list .pl-item.pl-disabled { opacity: .4; cursor: not-allowed; }
.player-list .pl-item.pl-disabled:hover { background: none; color: #aeb9c7; }
.player-list .pl-item.pl-disabled .pl-ic { color: #6b7686; }
.jPlayer-music .play-list .item.disabled { opacity: .4; cursor: not-allowed; }
.jPlayer-music .play-list .item.disabled .name { border-left-color: transparent; }
.jPlayer-music .play-list .item.disabled:hover { background: none; }

/* 播放列表编辑: 条目缺失(标红) / 移除按钮 / 拖拽排序 */
.player-list .pl-item.pl-missing { color: #ff7b7b; }
.player-list .pl-item.pl-missing .pl-ic { color: #ff7b7b; }
.jPlayer-music .play-list .item.missing { color: #ff9a9a; }
.jPlayer-music .play-list .item.missing .name { border-left-color: rgba(255,123,123,.7); }
.player-list .pl-item .pl-rm,
.jPlayer-music .play-list .item .remove {
    margin-left: auto; padding: 0 6px; opacity: .55; cursor: pointer; flex: 0 0 auto;
}
.player-list .pl-item .pl-rm:hover { opacity: 1; color: #ff7b7b; }
.pl-dragging { opacity: .6; background: rgba(79, 155, 255, .16) !important; cursor: grabbing; }
.pl-drop-target { box-shadow: inset 0 2px 0 #4f9bff; }
.player-list .pl-rows { display: block; }
.pl-empty { padding: 12px 14px; color: #8c98a8; font-size: 12px; line-height: 1.7; }
.player-list .pl-loop-btn { font-size: 16px; line-height: 1; }

/* 视频播放列表顶部「＋」按钮文字对齐 */
.player-list .pl-loop-btn[title*="添加"] { padding-bottom: 1px; }

/* ---- 回收站窗口 ---- */
.trash-wrap { display: flex; flex-direction: column; gap: 6px; }
.trash-head {
    font-size: 12px; color: #6b7892; padding: 2px 2px 8px;
    border-bottom: 1px solid #eef2f8;
}
.trash-list { max-height: 420px; overflow-y: auto; }
.trash-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; cursor: pointer; }
.trash-row:hover { background: #f4f8ff; }
.trash-row.selected { background: #e6f0ff; box-shadow: inset 0 0 0 1px #9dc2f5; }
.trash-ic { flex: 0 0 28px; width: 28px; height: 28px; }
.trash-mid { flex: 1 1 auto; min-width: 0; }
.trash-name { font-size: 13px; color: #2b3648; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-meta {
    font-size: 11px; color: #8d9aad; margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trash-tip { flex: 1 1 auto; font-size: 12px; color: #8d9aad; }

/* ---- 添加文件到播放列表 对话框 ---- */
.pladd { display: flex; flex-direction: column; gap: 8px; }
.pladd-bar { display: flex; gap: 8px; align-items: center; }
.pladd-bar .input { flex: 1; }
.pladd-list { max-height: 320px; overflow-y: auto; border: 1px solid #e6ebf3; border-radius: 6px; }
.pladd-row {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px;
    font-size: 13px; color: #2b3648; cursor: pointer;
}
.pladd-row:hover { background: #f2f7ff; }
.pladd-row.pladd-up { color: #2f7be6; }
.pladd-ic { flex: 0 0 16px; text-align: center; }
.pladd-name { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pladd-cb { flex: 0 0 auto; }
.pladd-tip { padding: 12px; color: #8c98a8; font-size: 12px; }
.pladd-hint { font-size: 12px; color: #6b7892; }

/* 新建文件对话框 */
.nf-dialog { padding: 4px 2px; }
.nf-dialog .nf-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nf-dialog .nf-row label { color: #4a5670; font-size: 13px; }
.nf-dialog .nf-type {
    background: #fff; color: #2c3e57; border: 1px solid #cdd6e3;
    border-radius: 5px; padding: 6px 8px; font-size: 13px; outline: none;
}
.nf-dialog .nf-name { flex: 1; min-width: 160px; }

/* 媒体/图片预览(窗口内) */
.preview-body { flex: 1; min-height: 0; min-width: 0; width: 100%; display: flex; align-items: center; justify-content: center; background: #11151c; color: #c9d3e0; overflow: hidden; }
.preview-body .prev-img, .preview-body img.preview-media, .preview-body video.preview-media { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.preview-body audio.preview-media { width: 90%; max-width: 420px; height: auto; }
.preview-body .prev-err { color: #ff9b9b; font-size: 13px; padding: 20px; text-align: center; }

/* ===== 图片查看器 (apps_image.js) =====
   工具栏 + 舞台 + 画布三层。画布用绝对定位 + transform 做缩放/旋转/平移,
   不用 width/height 直接改尺寸 —— 后者每帧都要重排, 拖动时会顿。 */
.img-view {
    flex: 1; min-height: 0; min-width: 0;
    display: flex; flex-direction: column;
    background: #1b2028;
}
.img-bar {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 5px;
    padding: 6px 10px;
    background: #232a34; border-bottom: 1px solid #2f3742;
    color: #c9d3e0; font-size: 13px;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.img-bar > * { flex: 0 0 auto; }                 /* 窄屏横向滚动而不是换行挤压 */
.img-bar .ib {
    min-width: 30px; height: 28px; padding: 0 6px;
    line-height: 28px; text-align: center;
    border-radius: 6px; cursor: pointer; user-select: none;
    background: rgba(255,255,255,.06); color: #dbe4f0;
}
.img-bar .ib:hover { background: rgba(255,255,255,.16); }
.img-bar .ib:active { background: rgba(47,123,230,.4); }
/* 首张/末张: 置灰并禁用指针事件 —— 位置不跳动, 也能看出已经到底 */
.img-bar .ib.off { opacity: .3; cursor: default; pointer-events: none; }
.img-bar .ib-info { padding: 0 3px; color: #8fa0b6; white-space: nowrap; }
.img-bar .ib-meta { color: #6f7f93; }
.img-bar .ib-sep { width: 1px; height: 18px; background: #38414e; margin: 0 2px; }
.img-bar .ib-spacer { flex: 1 1 auto; }

.img-stage {
    flex: 1; min-height: 0; position: relative; overflow: hidden;
    background: #11151c; cursor: grab;
    /* 手势全部自己处理(捏合缩放/滑动切换/拖动平移), 不让浏览器抢走 */
    touch-action: none;
    user-select: none;
}
.img-stage.grabbing { cursor: grabbing; }
.img-stage.loading::after {
    content: '加载中…';
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    color: #8fa0b6; font-size: 13px;
}
.img-canvas {
    position: absolute; left: 50%; top: 50%;
    transform-origin: center center;
    /* 必须放开尺寸限制: 默认的 max-width:100% 会让图片永远撑不大于视口,
       滚轮放大就成了空操作 */
    max-width: none; max-height: none;
    user-select: none; -webkit-user-drag: none;
    will-change: transform;
    opacity: 0; transition: opacity .12s;
}
.img-canvas.ready { opacity: 1; }
.img-err {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
}

/* 空媒体播放器(拖入) */.player-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; transition: box-shadow .15s; cursor: default; }
.player-hint { color: #8fa0b6; font-size: 14px; line-height: 1.9; text-align: center; user-select: none; }
.player-link { color: #4f9bff; text-decoration: underline; cursor: pointer; }

/* ===== 编辑器亮色主题覆盖（须置于文件末尾以覆盖默认暗色） ===== */
.editor-body.ed-light .editor-menubar { background: #f3f4f6; border-bottom-color: #d6dae1; }
.editor-body.ed-light .editor-menubar .em-item { color: #3a4453; }
.editor-body.ed-light .editor-menubar .em-item:hover,
.editor-body.ed-light .editor-menubar .em-item.on { background: #e3e6ea; color: #111; }
.editor-body.ed-light .editor-menubar .em-drop { background: #fff; border-color: #d6dae1; box-shadow: 0 10px 28px rgba(0,0,0,.16); }
.editor-body.ed-light .editor-menubar .em-option { color: #3a4453; }
.editor-body.ed-light .editor-menubar .em-option .et-ic { color: #8a97a8; }
.editor-body.ed-light .editor-menubar .em-option .em-key { color: #7a8696; background: #f0f2f5; border-color: #d6dae1; }
.editor-body.ed-light .editor-menubar .em-option:hover { background: #eef1f5; color: #111; }
.editor-body.ed-light .editor-menubar .em-option:hover .et-ic { color: #3a4453; }
.editor-body.ed-light .editor-toolbar { background: #fafbfc; border-bottom-color: #d6dae1; }
.editor-body.ed-light .editor-toolbar .et-btn { background: transparent; border-color: transparent; color: #3a4453; }
.editor-body.ed-light .editor-toolbar .et-btn:hover { background: #e9edf2; color: #111; }
.editor-body.ed-light .editor-toolbar .et-btn.primary { background: #2f7be6; border-color: #2f7be6; color: #fff; }
.editor-body.ed-light .editor-toolbar .et-btn.primary:hover { background: #3a87ef; }
.editor-body.ed-light .editor-toolbar .et-btn.on { background: #dbe9fd; color: #1d5fc0; }
.editor-body.ed-light .editor-toolbar .et-sep { background: #d6dae1; }
.editor-body.ed-light .editor-statusbar { background: #f3f4f6; border-top-color: #d6dae1; color: #6a737d; }
.editor-body.ed-light .editor-statusbar .st-item { color: #6a737d; }
.editor-body.ed-light .editor-statusbar .st-state.dirty { color: #e0863a; }
.editor-body.ed-light .editor-statusbar .st-state.saved { color: #2e9e5b; }

/* 快捷键说明对话框 */
.ed-help { display: flex; flex-direction: column; gap: 2px; }
.ed-help-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 2px; border-bottom: 1px solid #eef0f3; }
.ed-help-row:last-child { border-bottom: none; }
.ed-help-key {
    font: 12px/1 Consolas, Menlo, monospace; color: #44506b; background: #eef1f5;
    border: 1px solid #d6dae1; border-radius: 4px; padding: 4px 8px; white-space: nowrap;
}
.ed-help-val { color: #57606a; font-size: 13px; }
