/* ==========================================================
   windows.css — 窗口外壳 / 标题栏 / 缩放 / 应用骨架
   ========================================================== */

#window-layer{
  position:absolute; inset:0;
  z-index:100;
  pointer-events:none;
}
.win{
  position:absolute;
  display:flex; flex-direction:column;
  min-width: 420px; min-height: 260px;
  background: var(--win-bg);
  border-radius: var(--r-win);
  box-shadow: var(--sh-win);
  overflow:hidden;
  pointer-events:auto;
  transition: opacity .16s ease, transform .16s cubic-bezier(.2,1,.3,1), box-shadow .18s;
  /* 以前这里是 will-change:left,top,width,height —— 那四个都是布局属性，
     等于告诉浏览器「每帧都重建布局」，反而是弱机卡顿的来源。开窗和拖拽
     走的是逐帧改 left/top，浏览器本来就要布局，不需要这个提示。 */
}
.win.active{ box-shadow: var(--sh-win-active); }
.win.dragging{ transition:none; }
.win.minimized{ opacity:0; transform: scale(.72) translateY(180px); pointer-events:none; }
.win.closing{ opacity:0; transform: scale(.96); }

/* ---------- 标题栏 ---------- */
.win-titlebar{
  height: 38px; flex:0 0 38px;
  display:flex; align-items:center;
  padding: 0 12px;
  background: var(--win-titlebar);
  border-bottom: .5px solid var(--line);
  position:relative;
  cursor: default;
  -webkit-user-select:none; user-select:none;
}
.win:not(.active) .win-titlebar{ background: var(--titlebar-inactive); }
.win-titlebar::after{
  content:""; position:absolute; left:0; right:0; bottom:-.5px; height:.5px;
  background: rgba(0,0,0,.05);
}

.tl-group{ display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.tl{
  width:12px; height:12px; border-radius:50%;
  position:relative;
  box-shadow: inset 0 0 0 .5px rgba(0,0,0,.12);
  display:flex; align-items:center; justify-content:center;
}
.tl-close{ background: var(--tl-red); }
.tl-min{ background: var(--tl-yellow); }
.tl-max{ background: var(--tl-green); }
.win:not(.active) .tl{ background:#d2d2d6; }
.win:not(.active) .tl::before{ opacity:0; }
.tl::before{
  content:""; opacity:0;
  transition: opacity .1s;
}
.tl-group:hover .tl::before{ opacity:.55; }
.tl-close::before{
  width:7px; height:7px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7'%3E%3Cpath d='M1 1l5 5M6 1L1 6' stroke='%23000' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E") center/7px 7px no-repeat;
}
.tl-min::before{
  width:7px; height:7px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7'%3E%3Cpath d='M1 3.5h5' stroke='%23000' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E") center/7px 7px no-repeat;
}
.tl-max::before{
  width:7px; height:7px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7'%3E%3Cpath d='M1.5 1.5h4v4' fill='none' stroke='%23000' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E") center/7px 7px no-repeat;
}

.win-title{
  position:absolute; left:0; right:0;
  text-align:center; pointer-events:none;
  font-size:13px; font-weight:600; color: var(--ink);
  letter-spacing:.1px;
  display:flex; align-items:center; justify-content:center; gap:6px;
}
.win:not(.active) .win-title{ color: var(--ink-3); font-weight:500; }
.win-title .sub{ font-weight:400; color: var(--ink-3); font-size:12px; }

.win-acts{ margin-left:auto; display:flex; align-items:center; gap:6px; z-index:2; }
.win-acts .btn{ height:22px; }

/* ---------- 主体 ---------- */
.win-body{
  flex:1; min-height:0;
  display:flex; flex-direction:column;
  overflow:hidden;
  background: var(--win-bg);
}

/* ---------- 缩放手柄 ---------- */
.rz{ position:absolute; z-index:5; }
.rz-n{ top:0; left:10px; right:10px; height:5px; cursor: ns-resize; }
.rz-s{ bottom:0; left:10px; right:10px; height:5px; cursor: ns-resize; }
.rz-w{ left:0; top:10px; bottom:10px; width:5px; cursor: ew-resize; }
.rz-e{ right:0; top:10px; bottom:10px; width:5px; cursor: ew-resize; }
.rz-nw{ left:0; top:0; width:12px; height:12px; cursor: nwse-resize; }
.rz-ne{ right:0; top:0; width:12px; height:12px; cursor: nesw-resize; }
.rz-sw{ left:0; bottom:0; width:12px; height:12px; cursor: nesw-resize; }
.rz-se{ right:0; bottom:0; width:12px; height:12px; cursor: nwse-resize; }

/* ==========================================================
   应用通用骨架
   ========================================================== */
.app-shell{
  flex:1; min-height:0; display:flex;
  background: var(--win-bg);
}

/* 左侧栏 */
.app-side{
  width: 186px; flex:0 0 186px;
  background: var(--win-side);
  border-right: .5px solid var(--line);
  display:flex; flex-direction:column;
  overflow:hidden;
}
.app-side.wide{ width: 214px; flex-basis:214px; }.side-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.side-list{ padding: 2px 7px 8px; overflow:auto; }.side-item{
  margin-bottom:1px;
}
.side-item .si-ic{ width:14px; height:14px; color: var(--ink-3); display:flex; align-items:center; }
.side-item.on .si-ic{ color:#fff; }
.side-item .si-meta{ margin-left:auto; font-size:10.5px; color: var(--ink-3); font-variant-numeric:tabular-nums; }
.side-item.on .si-meta{ color: rgba(255,255,255,.8); }
.side-item .si-badge{
  margin-left:auto; min-width:15px; height:15px; padding:0 4px; border-radius:8px;
  background: rgba(0,0,0,.08); color: var(--ink-2);
  font-size:9.5px; font-weight:600; line-height:15px; text-align:center;
}
.side-item.on .si-badge{ background: rgba(255,255,255,.26); color:#fff; }.side-group{
  font-size:10.5px;
  color: var(--ink-4);
  font-weight:600;
  letter-spacing:.4px;
}

/* 主区 */
.app-main{ flex:1; min-width:0; display:flex; flex-direction:column; }

/* 工具条 */
.app-toolbar{
  flex:0 0 auto; height:40px;
  display:flex; align-items:center; gap:7px;
  padding: 0 12px;
  border-bottom:.5px solid var(--line);
  background: #fdfdfe;
}
.app-toolbar .tl-title{ font-size:13px; font-weight:600; margin-right:4px; }
.app-toolbar .tl-sub{ font-size:11.5px; color: var(--ink-3); }
.app-toolbar .grow{ flex:1; }

/* 内容区 */
.app-content{ flex:1; min-height:0; overflow:auto; position:relative; }
.app-content.pad{ padding: 14px 16px 18px; }

/* 底部状态条 */
.app-statusbar{
  flex:0 0 auto; height: 24px;
  display:flex; align-items:center; gap:12px;
  padding: 0 12px;
  border-top:.5px solid var(--line);
  background: var(--win-bg-soft);
  font-size:11px; color: var(--ink-3);
}

/* ---------- 内嵌抽屉（详情面板） ---------- */
.app-body-wrap{ flex:1; min-height:0; display:flex; position:relative; overflow:hidden; }.drawer{
  flex:0 0 384px;
  overflow:hidden;
  animation: drawerIn .18s cubic-bezier(.2,1,.3,1);
}
@keyframes drawerIn{ from{ transform: translateX(16px); opacity:.6; } }
.drawer-head h4{ margin:0; font-size:13px; font-weight:600; }
.drawer-head .dh-sub{ font-size:11px; color: var(--ink-3); margin-top:3px; }
.drawer-close{ margin-left:auto; color: var(--ink-3); font-size:15px; line-height:1; padding:1px 4px; border-radius:4px; }
.drawer-close:hover{ background: rgba(0,0,0,.07); }

/* ---------- 分节 ---------- */
.sec{ margin-bottom: 16px; }
.sec:last-child{ margin-bottom:0; }
.sec-title{
  font-size:11.5px; font-weight:600; color: var(--ink-2);
  margin: 0 0 8px; display:flex; align-items:center; gap:6px;
}
.sec-title .st-meta{ margin-left:auto; font-weight:400; color: var(--ink-3); font-size:11px; }

/* ---------- 空态 ---------- */
.empty{
  padding: 40px 20px; text-align:center; color: var(--ink-3); font-size:12.5px;
}

/* ==========================================================
   窗口打开微特效（试用版：?fx=a|b|c|d|e 切换，正式版会固化成一种）
   原则：只动 transform 和 opacity 两个合成器属性。
   不碰 width/height/top/left（会触发重排）、不碰 box-shadow / filter /
   backdrop-filter（会触发重绘，弱机最怕这个）。因此这几档在核显机器上
   的开销几乎一样，都是「一张已经画好的图层做位移/缩放」。
   ========================================================== */
@keyframes zx-fx-rise{ from{ opacity:0; transform: scale(.985); } to{ opacity:1; transform:none; } }
@keyframes zx-fx-up  { from{ opacity:0; transform: translateY(10px); } to{ opacity:1; transform:none; } }
@keyframes zx-fx-zoom{ from{ opacity:0; transform: scale(.94); }  to{ opacity:1; transform:none; } }
@keyframes zx-fx-in  { from{ opacity:0; transform: translateY(8px); }  to{ opacity:1; transform:none; } }

/* A 轻托起：最克制，像被手托了一下 */
.win.fx-a{ animation: zx-fx-rise .15s cubic-bezier(.2,.8,.3,1) both; }

/* B 微升：从下方浮上来，有「出现」的方向感 */
.win.fx-b{ animation: zx-fx-up .17s cubic-bezier(.2,.8,.3,1) both; }

/* C 由小放大：从 94% 长到 100%，原点偏左上，像从图标位置展开 */
.win.fx-c{ animation: zx-fx-zoom .18s cubic-bezier(.22,.9,.28,1) both; transform-origin: 34% 12%; }

/* D 框静内容浮：外壳不动，只有里面的内容淡入上浮
   —— 窗口边界一点不闪，观感最「稳」，代价是内容晚半拍 */
.win.fx-d .win-body > *{ animation: zx-fx-in .19s cubic-bezier(.2,.8,.3,1) both; animation-delay:.03s; }

/* 系统开了「减少动态效果」就全部关掉，这是无障碍的硬要求 */
@media (prefers-reduced-motion: reduce){
  .win.fx-a, .win.fx-b, .win.fx-c{ animation: none !important; }
  .win.fx-d .win-body > *{ animation: none !important; }
}

/* ---------- 试用期的切换条（不带 ?fx= 时不会出现） ---------- */
#fx-pill{
  position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%);
  z-index: 9600; display: flex; align-items: baseline; gap: 7px;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  background: rgba(18,19,23,.86); color: #fff;
  font-size: 11.5px; letter-spacing: .2px; line-height: 1.2;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
  user-select: none;
}
#fx-pill b{ font-weight: 600; }
#fx-pill span{ color: rgba(255,255,255,.62); font-size: 11px; }
#fx-pill:hover{ background: rgba(18,19,23,.95); }
