/* ═════════════════ HCOS · 深色毛玻璃设计系统 ═════════════════
   窗口部分尽量模仿 Win10：直角窗口、纯平实色铬区（无渐变无毛玻璃）、
   激活窗口一圈主题色细边、标题栏与工具栏同色无缝、全高方形窗口按钮、
   输入框是比底更亮的实色块；层级只靠 1px 实色发丝线与轻微明度差
   主题色仅用于选中/按钮等交互高亮，可通过 --accent 切换
   毛玻璃分层规则（不要到处乱用，按层级给强弱）：
   · 弹出浮层（开始菜单/右键菜单/Kimi 面板/通知/toast/模态框）：强毛玻璃 blur(28px)
   · 任务栏（常驻系统层）：blur(24px)
   · 窗口（大面积工作区）：Win10 式不透明纯色分层，不用 backdrop-filter，
     内容清晰、性能也更好，实底窗口与透底浮层形成质感对比                    */

@font-face {
  font-family: 'HMSymbol';
  src: url('/fonts/HMSymbol-sub.ttf?v=21') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

:root {
  --accent: #0078d4;
  --accent2: #0078d4;
  --accent-ink: #ffffff;
  --ink: #f2f4f9;
  --ink-2: #b9c0d0;
  --ink-3: #828ba0;
  /* 毛玻璃基底：仅给弹出浮层与任务栏用，透出壁纸色调 */
  --glass-strong: rgba(13, 14, 18, 0.86);
  /* 窗口层次：Win10 深色式纯平实色——标题栏/工具栏/状态栏同色无缝，
     侧边栏微亮、内容区微暗，靠 1px 实色发丝线分层，不用渐变与毛玻璃 */
  --win-bg: #1c1c1c;
  --chrome-2: #1c1c1c;
  --panel: #1a1a1a;
  --canvas: #141414;
  --well: #2d2d2d;
  --line: #3a3a3a;
  --line-2: #2b2b2b;
  --sel: rgba(0, 120, 212, 0.3);
  --danger: #ff6b5e;
  --ok: #3fce8f;
  --radius: 0px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.4);
  /* 图标尺寸变量（由 JS 按用户细调设置到 body 内联样式，此处为默认值）
     缩略图与普通 PNG 图标共用同一方框，保证视觉大小一致 */
  --di-w: 60px;   --di-img: 48px; --di-hm: 40px; --di-fs: 11px;
  --fi-w: 60px;   --thumb: 52px;  --fi-fs: 11px;
  --fi-gap-x: 8px; --fi-gap-y: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 12.5px; color: var(--ink);
  user-select: none; -webkit-user-select: none;
  background: #0d0e12;
}
.hidden { display: none !important; }
button { font: inherit; color: inherit; }
input { font: inherit; }

/* ── 字形图标 ── */
.hm {
  font-family: 'HMSymbol'; font-style: normal; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; flex: none;
}
/* 文件类型配色 */
.ic-folder { color: #f2b84b; }
.ic-file   { color: #9aa6c0; }
.ic-txt    { color: #6ea8ff; }
.ic-image  { color: #b78cff; }
.ic-media  { color: #ff7d9c; }
.ic-audio  { color: #54d6e8; }
.ic-zip    { color: #ff9d5c; }
.ic-exe    { color: #3fce8f; }
.ic-app    { color: #8f9dff; }

/* ═════════════════ 壁纸层（Win10 纯色大色块） ═════════════════ */
#wallpaper { position: fixed; inset: 0; z-index: 0; background-size: cover; background-position: center; }
.wp-aurora   { background: #005a9e; }   /* 湛蓝（默认） */
.wp-dusk     { background: #8764b8; }   /* 紫 */
.wp-forest   { background: #107c10; }   /* 绿 */
.wp-ocean    { background: #004275; }   /* 深海 */
.wp-graphite { background: #2b2b2b; }   /* 石墨 */
.wp-sunrise  { background: #ca5010; }   /* 橙 */

/* ═════════════════ 启动加载（菊花） ═════════════════ */
#bootLoader {
  position: fixed; inset: 0; z-index: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px;
  background: #000;
}
.bl-spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .16);
  border-top-color: var(--accent);
  animation: blspin .9s linear infinite;
}
@keyframes blspin { to { transform: rotate(360deg); } }

/* ═════════════════ 登录屏（极简深色 · 无卡片 · 发丝线） ═════════════════ */
#loginScreen {
  position: fixed; inset: 0; z-index: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #08090d;
  overflow: hidden;
}
/* 极弱的环境光：一抹主题色微光 + 四周暗角，静止纯 CSS */
#loginScreen::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 520px at 50% 118%, rgba(0, 120, 212, .14), transparent 62%),
    radial-gradient(1200px 800px at 50% 42%, transparent 55%, rgba(0, 0, 0, .5) 100%);
}
/* 角落小品牌 */
.login-brand {
  position: absolute; top: 28px; left: 32px; z-index: 1;
  display: flex; align-items: center; gap: 9px;
}
.brand-mark {
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 10.5px; color: #fff; letter-spacing: .02em;
}
.login-brand .bt { font-size: 12px; font-weight: 600; letter-spacing: .3em; color: rgba(255,255,255,.85); }
.login-brand .bs { display: none; }   /* 副标语收起来，画面只留必要信息 */
/* 中央登录组：无卡片，靠留白、发丝线与排版分层 */
.login-card {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  width: 280px;
  animation: lgin .55s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes lgin { from { opacity: 0; transform: translateY(12px); } }
.login-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  display: flex; align-items: center; justify-content: center;
}
.login-avatar .hm { font-size: 44px; color: rgba(255, 255, 255, .82); }
.login-name { font-size: 20px; font-weight: 300; letter-spacing: .08em; color: #fff; }
/* 下划线密码行：输入即显箭头 */
.login-pwdrow {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, .22);
  padding-bottom: 9px; margin-top: 8px;
  transition: border-color .25s;
}
.login-pwdrow:focus-within { border-bottom-color: var(--accent); }
#loginPwd {
  flex: 1; min-width: 0; padding: 3px 0; font-size: 14px; color: #fff;
  letter-spacing: .12em; text-align: center;
  background: transparent; border: 0; outline: none;
}
#loginPwd::placeholder {
  color: rgba(255, 255, 255, .32);
  font-size: 12px; letter-spacing: .18em;
}
.login-go {
  width: 28px; height: 28px; flex: none; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .3);
  background: transparent; color: rgba(255, 255, 255, .9);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateX(-8px); pointer-events: none;
  transition: opacity .2s, transform .2s, background .15s, border-color .15s;
}
/* 有内容时箭头才浮出（input 与按钮是相邻兄弟，无需 :has） */
#loginPwd:not(:placeholder-shown) + .login-go {
  opacity: 1; transform: none; pointer-events: auto;
}
.login-go:hover { background: var(--accent); border-color: var(--accent); }
.login-go:active { transform: scale(.9); }
.login-go .hm { font-size: 14px; }
.login-err { color: #ff9d8a; font-size: 11px; min-height: 14px; letter-spacing: .06em; }
.login-foot {
  position: absolute; bottom: 24px; z-index: 1;
  font-size: 9.5px; color: rgba(255, 255, 255, .28); letter-spacing: .3em;
}

/* ═════════════════ 桌面 ═════════════════ */
#desktop { position: fixed; inset: 0 0 calc(44px + var(--tb-top, 5px) + var(--tb-gap, 5px)) 0; z-index: 1; overflow: hidden; }
#deskIcons { position: absolute; inset: 0; }

/* 图标尺寸与间距：由设置 · 外观 滑杆细调，经 body 内联 CSS 变量生效（见 main.js Desktop.applySize） */

.dicon {
  position: absolute; width: var(--di-w); padding: 3px 2px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: default; border: 1px solid transparent; border-radius: 3px;
  transition: background .12s;
}
.dicon:hover { background: rgba(255,255,255,.12); }
.dicon .di-img { position: relative; width: var(--di-img); height: var(--di-img); display: flex; align-items: center; justify-content: center; }
/* 快捷方式角标：磨砂玻璃圆角块（backdrop-filter 模糊背后图标）+ 灰色蚀刻箭头的 SVG（见 main.js Desktop.LNK），图标约 30% 大 */
.dicon .di-img .di-lnk {
  position: absolute; left: -1px; bottom: -1px; pointer-events: none;
  width: calc(var(--di-img) * .3); height: calc(var(--di-img) * .3);
  border-radius: 28%;
  background: rgba(255,255,255,.3);
  -webkit-backdrop-filter: blur(5px) saturate(1.5);
  backdrop-filter: blur(5px) saturate(1.5);
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 1px 3px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.4);
}
.dicon .di-img .di-lnk svg { display: block; width: 100%; height: 100%; }
.dicon .di-img .hm { font-size: var(--di-hm); filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.dicon .di-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.dicon .di-name {
  font-size: var(--di-fs); color: #fff; text-align: center; line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,.8); word-break: break-all;
  max-height: calc(var(--di-fs) * 2.6 + 2px); overflow: hidden; padding: 1px 4px; border-radius: 2px;
}
.dicon.sel { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); }
.dicon.sel .di-name { background: var(--accent); color: #fff; text-shadow: none; }

.rubber {
  position: absolute; z-index: 400; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 2px;
}

/* ═════════════════ 任务栏（居左 · 毛玻璃） ═════════════════ */
#taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(44px + var(--tb-top, 5px) + var(--tb-gap, 5px)); z-index: 600;
  /* Win10 式任务栏：高不透明度实色，不用背景模糊 */
  background: rgba(18, 18, 18, 0.96);
  border-top: 1px solid #3a3a3a;
  display: flex; flex-direction: column; padding: var(--tb-top, 5px) 0 0;
}
/* 纵向布局：内容行在上，底部 inner spacer 把内容顶起、下缘留出空隙
 * （顶部间距由 --tb-top、底部间距由 --tb-gap 控制，可在设置中调整） */
.tb-row { flex: none; height: 44px; display: flex; align-items: center; gap: 5px; }
.tb-fill { flex: 1; }
.tb-spacer { flex: none; width: var(--tb-side, 10px); height: 100%; }
#startBtn {
  flex: none; display: flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 12px; border: 0; border-radius: 0;
  color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .04em; cursor: pointer;
  background: transparent; transition: background .15s;
}
#startBtn:hover { background: rgba(255,255,255,.1); }
#startBtn.on { background: rgba(255,255,255,.16); }
#startBtn .start-ic { display: flex; }
#startBtn .start-ic .hm { font-size: 22px; color: var(--accent); }
#startBtn .start-ic svg { display: block; }
#taskBtns { flex: 1; display: flex; align-items: center; gap: 4px; overflow: hidden; }
.tbtn-win {
  position: relative;
  flex: 0 1 200px; min-width: 44px; max-width: 200px; height: 38px;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1px solid transparent; border-radius: 0;
  color: var(--ink-2); font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden;
  background: rgba(255,255,255,.05); transition: all .15s;
}
.tbtn-win:hover { background: rgba(255,255,255,.12); color: var(--ink); }
.tbtn-win.active { background: rgba(255,255,255,.16); color: #fff; }
.tbtn-win.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--accent);
}
.tbtn-win .tb-ic { display: flex; flex: none; }
.tbtn-win .tb-ic img { width: 16px; height: 16px; }
.tbtn-win .tb-ic .hm { font-size: 16px; }
.tbtn-win span.tb-t { overflow: hidden; text-overflow: ellipsis; }
#tray {
  flex: none;
  display: flex; align-items: center; gap: 3px; padding: 3px 8px;
  color: var(--ink-2); font-size: 12px; border-radius: 3px;
}
#tray .tray-ic {
  width: 28px; height: 28px; border-radius: 3px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
}
#tray .tray-ic:hover { background: rgba(255,255,255,.12); color: #fff; }
#tray .tray-ic .hm { font-size: 16px; }
#clock { text-align: center; line-height: 1.25; cursor: default; padding-left: 6px; }
#clock:hover { color: #fff; }
#clock .ck-t { display: block; font-size: 12px; font-weight: 600; }
#clock .ck-d { display: block; font-size: 10px; color: var(--ink-3); }

/* ═════════════════ 开始菜单（Win10 式扁平亚克力：直角、磁贴网格、悬停描边） ═════════════════ */
#startMenu {
  position: fixed; left: 8px; bottom: calc(50px + var(--tb-top, 5px) + var(--tb-gap, 5px)); z-index: 650; width: 436px;
  background: var(--glass-strong); border: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  backdrop-filter: blur(28px) saturate(1.4);
  border-radius: 3px; box-shadow: var(--shadow);
  overflow: hidden;
  /* 菜单本体永不滚动：限高后头/尾固定，只有中间内容区在真正超高时可滚 */
  max-height: calc(100vh - 64px); display: flex; flex-direction: column;
  animation: smIn .16s ease-out;
}
@keyframes smIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
/* 头部：账户信息条，底缘发丝线与内容分区 */
.sm-head {
  display: flex; align-items: center; gap: 12px; padding: 15px 20px 13px;
  border-bottom: 1px solid var(--line-2); flex: none;
}
.sm-avatar {
  width: 40px; height: 40px; border-radius: 3px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.sm-avatar .hm { font-size: 21px; color: #fff; }
.sm-user { font-size: 14px; font-weight: 600; color: #fff; }
.sm-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.sm-body { padding: 8px 0 12px; flex: 1; min-height: 0; overflow-y: auto; }
.sm-sec {
  font-size: 10.5px; font-weight: 600; color: var(--ink-3);
  letter-spacing: .14em; text-transform: uppercase; padding: 10px 22px 7px;
}
.sm-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 0 14px; }
/* 磁贴：透明描边常态，悬停亮底 + 亮边（Win10 磁贴悬停反馈） */
.sm-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 2px 10px; border-radius: 2px; border: 1px solid transparent;
  cursor: default; transition: background .1s, border-color .1s;
}
.sm-tile:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); }
.sm-tile:active { background: rgba(255,255,255,.11); }
.sm-tile .sm-ic { width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center; }
.sm-tile .sm-ic img { width: 42px; height: 42px; filter: drop-shadow(0 2px 5px rgba(0,0,0,.35)); }
.sm-lb {
  font-size: 11.5px; color: var(--ink); text-align: center; line-height: 1.25;
  max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sm-foot {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 10px; border-top: 1px solid var(--line-2); flex: none;
}
.sm-fsp { flex: 1; }
.sm-fbtn {
  display: flex; align-items: center; gap: 7px; padding: 6px 11px;
  border-radius: 2px; font-size: 12px; color: var(--ink-2); cursor: default;
  transition: background .1s;
}
.sm-fbtn:hover { background: rgba(255,255,255,.08); color: #fff; }
.sm-fbtn .sm-ic { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; }
.sm-fbtn .sm-ic .hm { font-size: 15px; }

/* ═════════════════ 窗口 ═════════════════ */
#winLayer { position: fixed; inset: 0 0 calc(44px + var(--tb-top, 5px) + var(--tb-gap, 5px)) 0; z-index: 100; pointer-events: none; }
.win {
  position: absolute; pointer-events: auto;
  display: flex; flex-direction: column;
  /* Win10 式窗口：直角、纯平实色、激活时一圈主题色细边，投影收敛 */
  background: var(--win-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 65%, #000);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 300px; min-height: 200px;
  overflow: hidden;
}
/* 失焦窗口：边框褪为灰色、投影减弱、标题变暗 */
.win.blur { border-color: #4a4a4a; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.win.blur .win-title .wt-t { color: var(--ink-3); }
/* 标题栏：Win10 纯平实色（与工具栏同色无缝），左图标 + 常规字重标题 */
.win-title {
  flex: none; height: 32px; display: flex; align-items: center; gap: 8px;
  padding: 0 0 0 12px; cursor: default;
  background: var(--win-bg);
}
.win-title .wt-ic { display: flex; flex: none; cursor: nwse-resize; touch-action: none; }
.win-title .wt-ic img { width: 16px; height: 16px; }
.win-title .wt-ic .hm { font-size: 15px; color: var(--accent); }
.win.blur .win-title .wt-ic .hm { color: var(--ink-3); }
.win-title .wt-t {
  flex: 1; font-size: 12px; font-weight: 400; color: #fff;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
/* 窗口按钮：Win10 全高方形块，最小化/最大化悬停浅灰，关闭悬停正红 */
.wt-btns { flex: none; display: flex; align-self: stretch; }
.wt-btn {
  width: 46px; border: 0; border-radius: 0; background: transparent;
  color: var(--ink-2); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .1s;
}
.wt-btn .hm { font-size: 13px; }
.wt-btn:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.wt-btn.close:hover { background: #e81123; color: #fff; }
.win-body { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.win.maxed { border: 0; box-shadow: none; }
.rz { position: absolute; z-index: 5; }
.rz.n  { top: -3px; left: 10px; right: 10px; height: 7px; cursor: n-resize; }
.rz.s  { bottom: -3px; left: 10px; right: 10px; height: 7px; cursor: s-resize; }
.rz.e  { right: -3px; top: 10px; bottom: 10px; width: 7px; cursor: e-resize; }
.rz.w  { left: -3px; top: 10px; bottom: 10px; width: 7px; cursor: w-resize; }
.rz.ne { top: -3px; right: -3px; width: 12px; height: 12px; cursor: ne-resize; }
.rz.nw { top: -3px; left: -3px; width: 12px; height: 12px; cursor: nw-resize; }
.rz.se { bottom: -3px; right: -3px; width: 12px; height: 12px; cursor: se-resize; }
.rz.sw { bottom: -3px; left: -3px; width: 12px; height: 12px; cursor: sw-resize; }
.win.maxed .rz { display: none; }

/* ═════════════════ 资源管理器 ═════════════════ */
.xp { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.xp-toolbar {
  flex: none; display: flex; align-items: center; gap: 2px; padding: 6px 10px;
  background: var(--chrome-2);
  border-bottom: 1px solid var(--line-2); flex-wrap: nowrap; overflow: hidden;
}
.xp-tbtn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px;
  border: 1px solid transparent; border-radius: 2px; background: none;
  font-size: 12px; color: var(--ink-2); cursor: default; white-space: nowrap;
  transition: all .12s; flex: none;
}
.xp-tbtn .xic { display: flex; }
.xp-tbtn .xic .hm { font-size: 16px; }
.xp-tbtn .xmore { font-size: 15px; font-weight: 700; line-height: 1; }
/* 文字标签：仅窗口足够宽（.tb-wide）时显示 */
.xp-tbtn .xt { display: none; }
.xp.tb-wide .xp-tbtn .xt { display: inline; }
/* 窄窗口（.tb-compact）：收起带 data-c 的按钮与分隔线，露出“更多 ⋯” */
.xp-tbtn[data-t="more"] { display: none; }
.xp.tb-compact .xp-tbtn[data-t="more"] { display: inline-flex; }
.xp.tb-compact .xp-toolbar [data-c] { display: none; }
.xp.tb-compact .xp-tbtn[data-t="menu"] .xtm { display: none; }
.xp-tbtn:hover:not(:disabled) { background: rgba(255,255,255,.08); color: #fff; }
.xp-tbtn:active:not(:disabled) { background: rgba(255,255,255,.13); }
.xp-tbtn:disabled { opacity: .3; }
.xp-tbtn.accent { color: var(--accent); }
.xp-tbtn.on { background: color-mix(in srgb, var(--accent) 26%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: #fff; }
.xp-sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; flex: none; }
.xp-addrbar {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--chrome-2);
  border-bottom: 1px solid var(--line); position: relative;
}
.addr-copied {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: var(--accent); color: #fff; font-size: 11px; line-height: 1.4;
  padding: 2px 8px; border-radius: 6px; pointer-events: none; z-index: 5;
}
.xp-addr {
  flex: 1; display: flex; align-items: center; gap: 2px; min-width: 0;
  /* Win10 深色输入框：比底更亮的实色块，直角，聚焦时主题色描边 */
  background: var(--well); border: 1px solid #4a4a4a;
  border-radius: 2px; padding: 5px 10px; overflow: hidden; white-space: nowrap;
  font-size: 12px;
}
.xp-addr a { color: var(--accent); cursor: pointer; padding: 1px 3px; border-radius: 5px; }
.xp-addr a:hover { background: rgba(255,255,255,.08); }
.xp-addr .sep { color: var(--ink-3); font-size: 10px; }
.xp-addr .cur { padding: 1px 3px; color: var(--ink); }
/* Kimi 运行横幅：此文件夹有后台任务时显示，点击查看进度 */
.xp-kimi {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  font-size: 12.5px; color: var(--ink); cursor: pointer; user-select: none;
}
.xp-kimi:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.xp-kimi .xk-time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.xp-kimi .xk-go { color: var(--accent); font-weight: 600; }
.xp-search {
  flex: none; width: 160px; display: flex; align-items: center; gap: 6px;
  background: var(--well); border: 1px solid #4a4a4a;
  border-radius: 2px; padding: 5px 10px; color: var(--ink-3);
}
.xp-search .hm { font-size: 13px; }
.xp-search input { border: 0; outline: 0; font: inherit; width: 100%; background: none; color: var(--ink); font-size: 12px; }
.xp-search input::placeholder { color: var(--ink-3); }
.xp-search:focus-within { border-color: var(--accent); color: var(--ink-2); }
.xp-main { flex: 1; display: flex; min-height: 0; }
.xp-side {
  flex: none; width: 168px; overflow: auto; padding: 10px 8px;
  border-right: 1px solid var(--line-2);
  background: var(--panel);
}
.xp-side .side-box { margin-bottom: 12px; }
.xp-side .side-h {
  font-size: 10px; color: var(--ink-3); letter-spacing: .14em; text-transform: uppercase;
  padding: 3px 10px 5px;
}
.xp-side .side-i {
  display: flex; align-items: center; gap: 9px; padding: 6px 10px;
  font-size: 12px; color: var(--ink-2); cursor: pointer; border-radius: 2px;
  transition: all .12s;
}
.xp-side .side-i:hover { background: rgba(255,255,255,.07); color: #fff; }
/* 当前所在位置：主题色高亮 */
.xp-side .side-i.on { background: color-mix(in srgb, var(--accent) 24%, transparent); color: #fff; }
.xp-side .side-i.on .xic .hm { color: #fff; }
.xp-side .side-i .xic { display: flex; }
.xp-side .side-i .xic .hm { font-size: 15px; color: var(--accent); }
.xp-side .side-i .xic img { width: 15px; height: 15px; }
.xp-side .side-qa-empty { font-size: 11px; color: var(--ink-3); padding: 4px 10px; }
/* 窗口宽度 ≤300px 时隐藏侧边栏（由 explorer.js 按窗口宽度切换 .no-side） */
.xp.no-side .xp-side { display: none; }
.xp-side .disk-box { padding: 2px 10px; }
.xp-side .disk-bar { height: 5px; background: rgba(255,255,255,.09); border-radius: 3px; overflow: hidden; margin: 6px 0 7px; }
.xp-side .disk-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.xp-side .disk-lbl { font-size: 10.5px; color: var(--ink-3); line-height: 1.6; }
.xp-content { flex: 1; min-width: 0; position: relative; outline: none; background: var(--canvas); }
.xp-filearea { position: absolute; inset: 0; overflow: auto; padding: 10px; }
.xp-filearea.drop-hint { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 6px; }
#desktop.drop-hint { background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }

/* 图标视图 */
.xp-filearea.icons { display: flex; flex-wrap: wrap; align-content: flex-start; gap: var(--fi-gap-y) var(--fi-gap-x); }
.fi { position: relative; cursor: default; border: 1px solid transparent; border-radius: 3px; display: flex; flex-direction: column; align-items: center; gap: 5px; transition: background .1s; }
.xp-filearea.icons .fi { width: var(--fi-w); padding: 6px 4px; }
.fi .fi-ic { display: flex; align-items: center; justify-content: center; width: var(--thumb); height: var(--thumb); }
.xp-filearea.icons .fi .fi-ic .hm { font-size: calc(var(--thumb) * .8); filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.fi .fi-ic .pngic { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.fi .fi-ic .thumb {
  width: 100%; height: 100%; object-fit: cover; border-radius: 2px;
  border: 1px solid rgba(255,255,255,.12); background: #16171d;
}
.fi .fi-nm { font-size: var(--fi-fs); text-align: center; line-height: 1.3; word-break: break-all; max-height: calc(var(--fi-fs) * 3.9 + 2px); overflow: hidden; padding: 1px 4px; border-radius: 5px; color: var(--ink); }
.fi .fi-meta { display: none; }
.fi:hover { background: rgba(255,255,255,.05); }
.fi.sel { background: color-mix(in srgb, var(--accent) 24%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.xp-filearea.icons .fi.sel .fi-nm { color: #fff; }
.fi.drop-target { background: color-mix(in srgb, var(--accent) 32%, transparent); border-color: var(--accent); }
.fi.cut { opacity: .42; }
.fi.hidden2 { display: none; }

/* 多选模式：每个条目左上角显示圆形勾选框 */
.xp-filearea.multi .fi::before {
  content: ""; position: absolute; z-index: 1; top: 4px; left: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.6); background: rgba(0,0,0,.35);
}
.xp-filearea.multi .fi.sel::before { background: var(--accent); border-color: var(--accent); }
.xp-filearea.multi .fi.sel::after {
  content: ""; position: absolute; z-index: 1; top: 8px; left: 7.5px;
  width: 7px; height: 4px; transform: rotate(-45deg);
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
}
.xp-filearea.list.multi .fi { padding-left: 26px; }
.xp-filearea.list.multi .fi::before { top: 50%; margin-top: -7px; left: 6px; }
.xp-filearea.list.multi .fi.sel::after { top: 50%; margin-top: -3px; left: 9.5px; }
.fi-renaming { width: 100%; }
.fi-renaming input { width: 100%; font: inherit; font-size: 11.5px; text-align: center; background: rgba(0,0,0,.4); color: #fff; border: 1px solid var(--accent); border-radius: 5px; outline: none; padding: 2px; }

/* 列表视图 */
.xp-filearea.list { display: flex; flex-direction: column; gap: 0; padding: 0; }
.xp-filearea.list .list-head {
  flex: none; display: flex; font-size: 11px; color: var(--ink-3);
  border-bottom: 1px solid var(--line-2); position: sticky; top: 0; z-index: 2;
  /* sticky 遮挡用与内容区一致的不透明色，滚动时无缝盖住下方条目 */
  background: var(--canvas);
}
.list-head > div { padding: 7px 12px; cursor: pointer; transition: color .12s; }
.list-head > div:hover { color: #fff; }
.list-head .lh-nm { flex: 1; }
.list-head .lh-size { width: 90px; text-align: right; flex: none; }
.list-head .lh-type { width: 96px; flex: none; }
.list-head .lh-time { width: 140px; flex: none; }
.xp-filearea.list .fi {
  flex: none; flex-direction: row; align-items: center; width: 100%;
  padding: 4px 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--line-2);
}
.xp-filearea.list .fi:hover { background: rgba(255,255,255,.04); }
.xp-filearea.list .fi.sel { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.xp-filearea.list .fi.sel .fi-nm, .xp-filearea.list .fi.sel .fi-meta { color: #fff; }
.xp-filearea.list .fi-ic { margin: 0 6px 0 12px; flex: none; display: flex; }
.xp-filearea.list .fi-ic .hm { font-size: 17px; }
.xp-filearea.list .fi-nm { flex: 1; text-align: left; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-height: none; font-size: 12px; padding: 0 6px; }
.xp-filearea.list .fi-meta { display: flex; flex: none; font-size: 11.5px; color: var(--ink-3); }
.xp-filearea.list .fi-meta .fm-size { width: 90px; text-align: right; padding-right: 12px; font-variant-numeric: tabular-nums; }
.xp-filearea.list .fi-meta .fm-type { width: 96px; padding-left: 6px; }
.xp-filearea.list .fi-meta .fm-time { width: 140px; padding-left: 6px; }
.xp-empty { padding: 50px 0; text-align: center; color: var(--ink-3); width: 100%; font-size: 12px; }

/* 状态栏 */
.xp-status {
  flex: none; height: 26px; display: flex; align-items: center; gap: 16px;
  padding: 0 12px; font-size: 11px; color: var(--ink-3);
  background: var(--chrome-2);
  border-top: 1px solid var(--line);
}
.xp-status .sp { flex: 1; }

/* ═════════════════ 右键菜单 ═════════════════ */
#ctxmenu {
  position: fixed; z-index: 900; min-width: 200px;
  background: var(--glass-strong); border: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  backdrop-filter: blur(28px) saturate(1.4);
  border-radius: 10px; box-shadow: var(--shadow); padding: 5px;
  animation: ctxIn .1s ease-out;
}
@keyframes ctxIn { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.cmi {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 9px;
  font-size: 12px; cursor: default; color: var(--ink); border-radius: 3px;
  transition: background .1s;
}
.cmi:hover:not(.dis) { background: var(--accent); color: #fff; }
.cmi.dis { color: var(--ink-3); opacity: .55; }
.cmi .cm-ic { display: flex; flex: none; width: 18px; justify-content: center; }
/* 菜单图标统一使用系统设置的主题色，悬停反白 */
.cmi .cm-ic .hm { font-size: 15px; color: var(--accent); }
.cmi:hover:not(.dis) .cm-ic .hm { color: #fff; }
.cmi .cm-key { margin-left: auto; font-size: 10px; color: var(--ink-3); padding-left: 20px; }
.cmi:hover:not(.dis) .cm-key { color: rgba(255,255,255,.75); }
.cmi.bold { font-weight: 600; }
.cmsep { height: 1px; background: var(--line-2); margin: 4px 8px; }
/* 条目内联删除按钮（如 Kimi 历史会话），不随条目点击触发 */
.cmi .cm-del { margin-left: auto; display: flex; flex: none; padding: 1px 5px; border-radius: 3px; color: var(--ink-3); }
.cmi .cm-del .hm { font-size: 13px; }
.cmi:hover:not(.dis) .cm-del { color: rgba(255,255,255,.8); }
.cmi .cm-del:hover { background: #e81123; color: #fff; }

/* ═════════════════ 拖拽幽灵 ═════════════════ */
#dragGhost {
  position: fixed; z-index: 950; pointer-events: none;
  display: flex; align-items: center; gap: 7px; padding: 6px 12px;
  background: var(--glass-strong); border: 1px solid var(--line);
  backdrop-filter: blur(20px); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); font-size: 12px; max-width: 280px;
}
#dragGhost .dg-ic { display: flex; flex: none; }
#dragGhost .dg-ic .hm { font-size: 17px; color: var(--accent); }
#dragGhost .dg-badge { background: var(--accent); color: #fff; border-radius: 9px; font-size: 10px; padding: 1px 7px; }
#dragGhost .dg-mode { color: var(--ok); font-weight: 600; font-size: 11px; }

/* ═════════════════ 模态框 ═════════════════ */
.overlay {
  position: fixed; inset: 0; z-index: 950; background: rgba(5, 8, 15, .5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  width: min(440px, 92vw); background: var(--glass-strong);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.12); border-radius: 12px; box-shadow: var(--shadow);
  padding: 20px 20px 16px;
  animation: ctxIn .14s ease-out;
}
.modal-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 5px; }
.modal-desc { font-size: 12px; color: var(--ink-2); margin-bottom: 12px; word-break: break-all; }
.modal-list {
  max-height: 210px; overflow: auto; background: rgba(0,0,0,.25); border: 1px solid var(--line);
  border-radius: 10px; font-size: 12px; padding: 6px; margin-bottom: 12px; user-select: text;
}
.modal-list .mdir { padding: 5px 6px; cursor: pointer; display: flex; align-items: center; gap: 8px; border-radius: 6px; color: var(--ink); }
.modal-list .mdir .hm { font-size: 14px; color: #f2b84b; }
.modal-list .mdir:hover { background: rgba(255,255,255,.07); }
.modal-list .mdir.on { background: var(--accent); color: #fff; }
.modal-list .mdir.on .hm { color: #fff; }
/* 文件夹样式选择器网格（右键文件夹 · 选择样式） */
.fst-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 2px; }
.fst-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 2px 6px; border-radius: 8px; border: 2px solid transparent;
  cursor: pointer; font-size: 10.5px; color: var(--ink-2); transition: all .12s;
}
.fst-cell img { width: 44px; height: 44px; object-fit: contain; }
.fst-cell:hover { background: rgba(255,255,255,.07); color: #fff; }
.fst-cell.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); color: #fff; }
#modalInput {
  width: 100%; font: inherit; font-size: 13px; padding: 9px 12px; color: #fff;
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
  border-radius: 9px; outline: none; margin-bottom: 10px; transition: all .15s;
}
#modalInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.modal-err { color: #ff9d8a; font-size: 11.5px; min-height: 15px; margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn {
  padding: 7px 18px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 3px;
  background: rgba(255,255,255,.08); cursor: pointer; color: var(--ink); transition: all .13s;
}
.btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn.primary { background: var(--accent); border: 0; color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.15); color: #fff; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); color: #ff8a7e; }

/* ═════════════════ 传输管理器 ═════════════════ */
.tm { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tm-head {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: var(--chrome-2);
  border-bottom: 1px solid var(--line-2); font-size: 12px; color: var(--ink);
}
.tm-head .btn { padding: 4px 12px; font-size: 11.5px; }
.tm-list { flex: 1; overflow: auto; padding: 4px 0; background: var(--canvas); }
.tm-empty { padding: 36px; text-align: center; color: var(--ink-3); font-size: 12px; }
.tm-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line-2); }
.tm-row .tm-ic { display: flex; flex: none; }
.tm-row .tm-ic .hm { font-size: 17px; color: var(--accent); }
.tm-row .tm-info { flex: 1; min-width: 0; }
.tm-row .tm-nm { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.tm-row .tm-sub { font-size: 10.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.tm-row .tm-bar { height: 5px; background: rgba(255,255,255,.09); border-radius: 3px; overflow: hidden; margin-top: 5px; }
.tm-row .tm-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .15s; }
.tm-row.done .tm-bar i { background: var(--ok); }
.tm-row.err .tm-bar i { background: var(--danger); }
.tm-row .tm-st { width: 130px; flex: none; text-align: right; font-size: 10.5px; color: var(--ink-3); }
.tm-row .tm-x { flex: none; width: 22px; height: 22px; border: 0; background: none; border-radius: 6px; color: var(--ink-3); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tm-row .tm-x:hover { color: var(--danger); background: rgba(255,255,255,.07); }
.tm-row .tm-x .hm { font-size: 12px; }

/* ═════════════════ 查看器 / 应用窗口 ═════════════════ */
.viewer, .appframe { flex: 1; min-height: 0; border: 0; width: 100%; background: #0d0f16; }
div.viewer, div.appframe { display: flex; }
div.appframe { position: relative; background: #000; }
iframe.viewer { flex: 1; height: 100%; background: #fff; }
iframe.appframe { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
/* 应用 iframe 加载提示层（纯黑 + 菊花），iframe 就绪后盖在其上 */
.appframe-load {
  position: absolute; inset: 0; z-index: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: #000; color: #8a8a8a; font-size: 13px; letter-spacing: .15em;
}
.appframe-load .afl-spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .14); border-top-color: var(--accent);
  animation: blspin .9s linear infinite;
}
.viewer-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; background: #10131c; overflow: auto; }
.viewer-wrap img { max-width: 100%; max-height: 100%; }
.viewer-wrap video, .viewer-wrap audio { max-width: 100%; max-height: 100%; outline: none; }
.viewer-wrap .vld { color: var(--ink-2); font-size: 13px; letter-spacing: .05em; }

/* ═════════════════ 设置面板（Win10 设置页风格：左侧竖排导航 + 右側内容卡片） ═════════════════ */
.set { flex: 1; display: flex; min-height: 0; }
.set-side {
  flex: none; width: 188px; border-right: 1px solid var(--line-2);
  padding: 12px 8px; background: var(--panel);
  display: flex; flex-direction: column; gap: 1px;
}
.set-side .side-i {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 14px; border-radius: 2px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; transition: background .1s;
}
.set-side .side-i:hover { background: rgba(255,255,255,.06); color: #fff; }
/* 当前页：浅底 + 左侧主题色指示条（Win10 设置的标志性样式） */
.set-side .side-i.on { background: rgba(255,255,255,.09); color: #fff; }
.set-side .side-i.on::before {
  content: ""; position: absolute; left: 2px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 2px; background: var(--accent);
}
.set-side .side-i .hm { font-size: 15px; color: var(--accent); }
.set-body { flex: 1; overflow: auto; padding: 22px 26px; background: var(--canvas); }
.set-h { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.set-sub { font-size: 11.5px; color: var(--ink-3); margin-bottom: 18px; }
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.wp-cell { cursor: pointer; border-radius: 3px; overflow: hidden; border: 1px solid var(--line-2); transition: all .12s; position: relative; }
.wp-cell:hover { border-color: rgba(255,255,255,.3); }
.wp-cell.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wp-cell .wp-thumb { height: 76px; background-size: cover; background-position: center; }
.wp-cell .wp-name { padding: 6px 9px; font-size: 11px; color: var(--ink-2); background: rgba(0,0,0,.35); }
.wp-cell.on .wp-name { color: #fff; }
.wp-cell .wp-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); display: none; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.wp-cell.on .wp-check { display: flex; }
.wp-check .hm { font-size: 11px; color: #fff; }
.ac-row { display: flex; gap: 10px; margin-top: 6px; }
.ac-dot { width: 32px; height: 32px; border-radius: 2px; cursor: pointer; border: 2px solid transparent; transition: all .12s; }
.ac-dot:hover { transform: scale(1.1); }
.ac-dot.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.22); }
.set-card { background: rgba(255,255,255,.03); border: 1px solid var(--line-2); border-radius: 3px; padding: 14px 18px; margin-bottom: 12px; }
.set-card .sc-t { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.set-card .sc-t .hm { color: var(--accent); font-size: 15px; }
.set-about { font-size: 12px; color: var(--ink-2); line-height: 2; }
.set-about b { color: #fff; }
.set-note { font-size: 11px; color: var(--ink-3); margin-top: 8px; }
/* 分段选择器（图标大小） */
.seg { display: inline-flex; background: rgba(0,0,0,.25); border: 1px solid var(--line-2); border-radius: 3px; padding: 3px; gap: 2px; }
.seg-i {
  padding: 5px 22px; font-size: 12px; color: var(--ink-2); border-radius: 2px;
  cursor: pointer; transition: all .13s; text-align: center;
}
.seg-i:hover { color: #fff; }
.seg-i.on { background: rgba(255,255,255,.12); color: #fff; }
/* 数值滑杆（图标大小/间距细调） */
.sl-row { display: flex; align-items: center; gap: 12px; margin: 9px 0; }
.sl-row .sl-name { flex: none; width: 60px; font-size: 12px; color: var(--ink-2); }
.sl-row .sl-val { flex: none; width: 44px; text-align: right; font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.sl-row input[type=range] { flex: 1; min-width: 0; height: 22px; accent-color: var(--accent); cursor: pointer; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }

/* ═════════════════ Kimi 助手 ═════════════════ */
.kimi { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.kimi-head {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  background: var(--chrome-2);
  border-bottom: 1px solid var(--line-2); font-size: 12px; color: var(--ink);
}
.kimi-path {
  font-size: 11px; color: var(--ink-3); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 60%;
}
.kimi-list { flex: 1; overflow: auto; overflow-x: hidden; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--canvas); }
/* 关键：子项禁止 flex 收缩——否则内容超出后带 overflow 的卡片（工具/思考/元信息）
   会被压扁成一条线、文字被裁掉；保持自然高度让列表正常滚动 */
.kimi-list > * { flex: none; }
.kimi-msg { display: flex; min-width: 0; }
.kimi-msg.user { justify-content: flex-end; }
.kimi-bub {
  max-width: 88%; min-width: 0; padding: 8px 12px; border-radius: 12px; font-size: 12.5px;
  line-height: 1.65; word-break: break-word; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text;
}
.kimi-msg.user .kimi-bub {
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px;
}
.kimi-msg.assistant .kimi-bub {
  background: rgba(255,255,255,.06); border: 1px solid var(--line-2);
  color: var(--ink); border-bottom-left-radius: 4px;
}
.kimi-pre {
  margin: 6px 0; padding: 8px 10px; background: rgba(0,0,0,.35);
  border: 1px solid var(--line-2); border-radius: 8px; overflow-x: auto;
  max-width: 100%; box-sizing: border-box;
  font-family: Consolas, "Cascadia Mono", monospace; font-size: 11.5px; line-height: 1.5;
  white-space: pre;
}
.kimi-code {
  padding: 1px 5px; background: rgba(0,0,0,.35); border-radius: 5px;
  font-family: Consolas, "Cascadia Mono", monospace; font-size: 11.5px;
}
.kimi-meta {
  align-self: center; max-width: 92%; font-size: 10.5px; color: var(--ink-3);
  background: rgba(255,255,255,.04); border-radius: 7px; padding: 3px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  user-select: text; -webkit-user-select: text;
}
.kimi-input {
  flex: none; display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--line-2);
  background: var(--chrome-2);
}
.kimi-input textarea {
  flex: 1; min-width: 0; resize: none; font: inherit; font-size: 12.5px; color: #fff;
  background: var(--well); border: 1px solid #4a4a4a;
  border-radius: 2px; padding: 8px 11px; outline: none; line-height: 1.5;
  max-height: 120px;
}
.kimi-input textarea:focus { border-color: var(--accent); }
.kimi-input .btn { flex: none; padding: 8px 16px; }

/* Kimi · 状态栏（进度反馈） */
.kimi-status {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; font-size: 11.5px; color: var(--accent);
  border-bottom: 1px solid var(--line-2); background: rgba(255,255,255,.03);
}
.kimi-status .ks-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kimi-status .ks-time { flex: none; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ks-spin {
  flex: none; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-top-color: var(--accent);
  animation: ksspin .8s linear infinite;
}
@keyframes ksspin { to { transform: rotate(360deg); } }

/* Kimi · 工具调用卡片 */
.kimi-tool {
  align-self: stretch; min-width: 0; border: 1px solid var(--line-2); border-radius: 10px;
  background: rgba(255,255,255,.03); overflow: hidden; font-size: 12px;
}
.kimi-tool.run { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.kimi-tool.err { border-color: rgba(224, 68, 52, .5); }
.kt-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
.kt-head:hover { background: rgba(255,255,255,.04); }
.kt-ic { flex: none; display: flex; color: var(--accent); }
.kt-ic .hm { font-size: 14px; }
.kimi-tool.err .kt-ic { color: #e04434; }
.kt-name { flex: none; font-weight: 600; color: #fff; }
.kt-arg {
  flex: 1; min-width: 0; color: var(--ink-3); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: Consolas, "Cascadia Mono", monospace;
}
.kt-st { flex: none; display: flex; align-items: center; color: var(--ink-3); font-size: 11px; }
.kimi-tool.done .kt-st { color: #3fce8f; }
.kimi-tool.err .kt-st { color: #ff9d8a; }
.kt-chev { flex: none; display: flex; color: var(--ink-3); transition: transform .12s; }
.kt-chev .hm { font-size: 12px; }
.kimi-tool:has(.kt-body:not(.hidden)) .kt-chev { transform: rotate(90deg); }
.kt-body { border-top: 1px solid var(--line-2); padding: 8px 10px; }
.kt-sec { font-size: 10.5px; color: var(--ink-3); margin: 4px 0 3px; }
.kt-sec:first-child { margin-top: 0; }
.kt-args, .kt-out {
  margin: 0; padding: 7px 9px; background: rgba(0,0,0,.35);
  border: 1px solid var(--line-2); border-radius: 7px;
  font-family: Consolas, "Cascadia Mono", monospace; font-size: 11px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow-y: auto;
  user-select: text; -webkit-user-select: text; color: var(--ink-2);
}

/* Kimi · 原始输出（工具 stdout 等） */
.kimi-raw {
  align-self: stretch; padding: 6px 10px; border-radius: 8px;
  background: rgba(0,0,0,.25); color: var(--ink-3);
  font-family: Consolas, "Cascadia Mono", monospace; font-size: 11px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-all; max-height: 160px; overflow-y: auto;
  user-select: text; -webkit-user-select: text;
}

/* Kimi · 行内标题 */
.kimi-h { display: inline-block; font-weight: 700; color: #fff; font-size: 13px; margin: 2px 0; }

/* Kimi · 超长消息折叠气泡（默认只显示开头，渐变遮罩提示还有更多） */
.kimi-bub.folded .kf-body {
  max-height: 180px; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}
.kf-btn {
  display: flex; align-items: center; gap: 5px; margin-top: 7px; padding: 3px 10px;
  border: 1px solid var(--line-2); border-radius: 7px; background: rgba(255,255,255,.05);
  color: var(--accent); font-size: 11px; cursor: pointer;
}
.kf-btn:hover { background: rgba(255,255,255,.12); }
.kf-btn .hm { font-size: 11px; }
.kimi-msg.user .kf-btn { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.12); }
.kimi-msg.user .kf-btn:hover { background: rgba(255,255,255,.22); }

/* Kimi · 思考过程（历史会话还原，默认折叠） */
.kimi-think {
  align-self: stretch; border: 1px dashed var(--line-2); border-radius: 10px;
  background: rgba(255,255,255,.02); font-size: 12px; overflow: hidden;
}
.kth-head {
  display: flex; align-items: center; gap: 7px; padding: 6px 10px;
  cursor: pointer; color: var(--ink-3); user-select: none; -webkit-user-select: none;
}
.kth-head:hover { background: rgba(255,255,255,.04); color: var(--ink-2); }
.kth-ic { display: flex; color: var(--accent); }
.kth-ic .hm { font-size: 13px; }
.kth-chev { display: flex; transition: transform .12s; }
.kth-chev .hm { font-size: 12px; }
.kimi-think:has(.kth-body:not(.hidden)) .kth-chev { transform: rotate(90deg); }
.kth-body {
  border-top: 1px dashed var(--line-2); padding: 8px 12px; color: var(--ink-3);
  font-size: 11.5px; line-height: 1.6; max-height: 260px; overflow-y: auto;
  word-break: break-word; user-select: text; -webkit-user-select: text;
}

/* 任务栏 · Kimi 全局统筹：有任务运行时呼吸式动画 */
#trayKimi.breath { color: var(--accent); animation: ktbreath 1.6s ease-in-out infinite; }
@keyframes ktbreath {
  0%, 100% { opacity: .45; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Kimi 任务面板（任务栏上方弹出） */
#kimiPanel {
  position: fixed; right: 8px; bottom: calc(50px + var(--tb-top, 5px) + var(--tb-gap, 5px));
  z-index: 650; width: 320px; max-height: 60vh; overflow-y: auto;
  background: var(--glass-strong); border: 1px solid rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  backdrop-filter: blur(28px) saturate(1.4);
  border-radius: 14px; box-shadow: var(--shadow); padding: 8px;
  animation: smIn .16s ease-out;
}
.kp-title { display: flex; align-items: baseline; gap: 8px; padding: 4px 8px 8px; font-size: 12px; font-weight: 600; color: #fff; }
.kp-title span { font-weight: 400; font-size: 10.5px; color: var(--ink-3); }
.kp-empty { padding: 18px 10px; text-align: center; font-size: 12px; color: var(--ink-3); }
.kp-item { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 9px; cursor: pointer; }
.kp-item:hover { background: rgba(255,255,255,.07); }
.kp-ic { flex: none; display: flex; color: var(--accent); animation: ktbreath 1.6s ease-in-out infinite; }
.kp-ic .hm { font-size: 17px; }
.kp-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kp-path { font-size: 12px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-prompt { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-time { flex: none; font-size: 11px; color: var(--accent); font-variant-numeric: tabular-nums; }

/* Kimi 面板：分区标题 / 历史任务入口 / 已完成条目 */
.kp-sec { padding: 6px 8px 3px; font-size: 10.5px; font-weight: 600; color: var(--ink-3); }
.kp-title button {
  border: 0; background: none; cursor: pointer; color: var(--ink-3);
  font-size: 10.5px; display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 6px; font-family: inherit;
}
.kp-title button:hover { background: rgba(255,255,255,.09); color: #fff; }
.kp-title button .hm { font-size: 12px; }
.kp-title .kp-hist { margin-left: auto; }
.kp-item.done .kp-ic { animation: none; color: #34c759; }
.kp-item.done .kp-time { color: #34c759; }

/* Kimi 面板：已完成条目的删除按钮（悬停显现） */
.kp-del { flex: none; display: none; color: var(--ink-3); border-radius: 5px; padding: 1px; cursor: pointer; }
.kp-item:hover .kp-del { display: inline-flex; }
.kp-del:hover { background: rgba(255,255,255,.12); color: #ff5f57; }
.kp-del .hm { font-size: 12px; }

/* 托盘 Kimi 图标：有已完成未查看任务时右上角显示圆点 */
#trayKimi { position: relative; }
#trayKimi.has-done::after {
  content: ''; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px;
  border-radius: 50%; background: #34c759; box-shadow: 0 0 0 1.5px rgba(0,0,0,.35);
}

/* Kimi 任务完成提醒（右下角，可点击查看内容） */
#kimiNotice {
  position: fixed; right: 10px; bottom: calc(60px + var(--tb-top, 5px) + var(--tb-gap, 5px));
  z-index: 1100; display: flex; flex-direction: column; gap: 8px;
}
.kimi-notice {
  display: flex; align-items: center; gap: 10px; width: 280px; cursor: pointer;
  background: var(--glass-strong); border: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  backdrop-filter: blur(28px) saturate(1.4);
  border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px;
  animation: toastIn .18s ease-out;
}
.kimi-notice:hover { border-color: rgba(255,255,255,.25); }
.kimi-notice.out { opacity: 0; transition: opacity .25s; }
.kn-ic { flex: none; display: flex; color: var(--accent); }
.kn-ic .hm { font-size: 18px; }
.kn-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kn-tx b { font-size: 12px; color: #fff; font-weight: 600; }
.kn-tx i {
  font-style: normal; font-size: 11px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kn-x { flex: none; display: flex; color: var(--ink-3); border-radius: 5px; padding: 2px; }
.kn-x:hover { color: #fff; background: rgba(255,255,255,.1); }
.kn-x .hm { font-size: 11px; }

/* 轻提示（复制地址等操作反馈） */
#toastHost {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 1200;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.toast {
  background: var(--glass-strong); border: 1px solid rgba(255,255,255,.12); color: var(--ink);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  backdrop-filter: blur(28px) saturate(1.4);
  padding: 6px 14px; border-radius: 8px; font-size: 12px; box-shadow: var(--shadow);
  animation: toastIn .18s ease-out;
}
.toast.out { opacity: 0; transition: opacity .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ═════════════════ 触控适配（手机 / 平板） ═════════════════ */
body { touch-action: manipulation; }              /* 禁双击缩放，保留双指缩放 */

/* 拖动/缩放窗口期间屏蔽 iframe（Photopea 等内部页面会吃掉指针事件） */
.wm-drag iframe { pointer-events: none !important; }

/* 桌面与窗口交互区：拖动时禁止浏览器手势滚动 */
#desktop { touch-action: none; -webkit-touch-callout: none; }
.win-title, .rz { touch-action: none; }
.xp-filearea { -webkit-touch-callout: none; }     /* 文件区保留原生滚动，禁 iOS 长按弹窗 */

/* 粗指针（触屏）放大可点区域 */
@media (pointer: coarse) {
  .win-title { height: 42px; }
  .wt-btn { width: 56px; }
  .wt-btn .hm { font-size: 15px; }

  /* 加粗窗口缩放手柄 */
  .rz.n  { top: -7px; height: 15px; }
  .rz.s  { bottom: -7px; height: 15px; }
  .rz.e  { right: -7px; width: 15px; }
  .rz.w  { left: -7px; width: 15px; }
  .rz.ne, .rz.nw, .rz.se, .rz.sw { width: 24px; height: 24px; }
  .rz.ne { top: -7px; right: -7px; }
  .rz.nw { top: -7px; left: -7px; }
  .rz.se { bottom: -7px; right: -7px; }
  .rz.sw { bottom: -7px; left: -7px; }

  /* 资源管理器工具栏按钮更易点 */
  .xp-tbtn { padding: 8px 12px; }
}

/* 窄屏：开始菜单与模态框适配 */
@media (max-width: 640px) {
  #startMenu { left: 8px; right: 8px; bottom: calc(56px + var(--tb-top, 5px) + var(--tb-gap, 5px)); width: auto; }
  .modal { width: calc(100vw - 32px); }
  #ctxmenu { max-width: calc(100vw - 16px); }
}
