/* 系统（二）：窗口缩放、通知按钮、托盘、命令面板、屏保、星星雨、生日帽、手机常用栏 */

/* 窗口缩放手柄 */
.win__grip {
  position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none;
  background:
    linear-gradient(var(--line), var(--line)) 12px 4px / 2px 10px no-repeat,
    linear-gradient(var(--line), var(--line)) 4px 12px / 10px 2px no-repeat,
    linear-gradient(var(--line), var(--line)) 8px 8px / 2px 6px no-repeat,
    linear-gradient(var(--line), var(--line)) 8px 8px / 6px 2px no-repeat;
}
.win.is-active .win__grip { filter: brightness(1.6); }
.win.is-max .win__grip { display: none; }

/* 带按钮的通知 */
.toast.has-act { pointer-events: auto; flex-wrap: wrap; }
.toast__act { margin: 4px 0 2px 54px; }

/* 托盘：月相 + 搜索 */
.tray__moon { width: 24px; height: 24px; cursor: help; }
.tray__search { width: 28px; height: 28px; padding: 0; border: 2px solid var(--line); background: var(--panel-2); font-size: 18px; line-height: 20px; }
.tray__search:hover { background: var(--stitch); }

/* 命令面板 */
.pal { position: fixed; inset: 0; z-index: 2600; display: grid; justify-items: center; align-content: start; padding-top: 16vh; background: #060920aa; animation: pop .15s steps(2); }
.pal__box {
  width: min(560px, calc(100vw - 24px)); padding: 10px; background: var(--panel);
  box-shadow: 0 -3px 0 var(--sun), 0 3px 0 var(--sun), -3px 0 0 var(--sun), 3px 0 0 var(--sun), 0 30px 80px -10px #000c;
}
.pal__in { width: 100%; padding: 6px 10px; border: 0; background: var(--ink); color: var(--sand); font-size: 24px; line-height: 1.4; outline: none; }
.pal__list { margin-top: 8px; max-height: 50vh; overflow: auto; }
.pal__item { display: flex; align-items: center; gap: 10px; padding: 3px 8px; cursor: pointer; }
.pal__item canvas { width: 24px; height: 24px; flex: none; }
.pal__item small { margin-left: auto; color: var(--dim); }
.pal__item[aria-selected="true"] { background: var(--stitch); }
.pal__item[aria-selected="true"] small { color: var(--sand); }
.pal__dot { width: 24px; text-align: center; color: var(--sun); flex: none; }
.pal__empty { padding: 6px 8px; color: var(--dim); }
.pal__tip { margin-top: 8px; color: var(--dim); text-align: right; }

/* 屏保 */
.saver { position: fixed; inset: 0; z-index: 2900; width: 100vw; height: 100vh; cursor: none; }

/* 星星雨 / 彩纸 */
.shower { position: fixed; top: -30px; z-index: 2700; pointer-events: none; color: var(--c); font-size: 24px; text-shadow: 2px 2px 0 var(--ink); animation: shower-fall linear both; }
.shower--confetti { width: 8px; height: 12px; background: var(--c); box-shadow: 2px 2px 0 #0004; }
@keyframes shower-fall { to { transform: translate(var(--drift), 110vh) rotate(540deg); } }

/* 626 生日：派对帽（像素 SVG） */
.is-birthday .pet__body::before {
  content: ''; position: absolute; left: 50%; top: -16px; width: 30px; height: 30px; transform: translateX(-30%) rotate(-14deg); pointer-events: none;
  image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' shape-rendering='crispEdges'%3E%3Crect x='4' y='0' width='2' height='2' fill='%23ffd23f'/%3E%3Crect x='4' y='2' width='2' height='1' fill='%23ff8fc8'/%3E%3Crect x='3' y='3' width='4' height='1' fill='%23ff8fc8'/%3E%3Crect x='3' y='4' width='4' height='1' fill='%234a7ff0'/%3E%3Crect x='2' y='5' width='6' height='2' fill='%23ff8fc8'/%3E%3Crect x='1' y='7' width='8' height='1' fill='%234a7ff0'/%3E%3Crect x='1' y='8' width='8' height='1' fill='%23ff8fc8'/%3E%3Crect x='0' y='9' width='10' height='1' fill='%23ff8fc8'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 矮屏幕时图标会排到第四列：主视觉再往右让一让 */
@media (min-width: 721px) and (max-height: 700px) { .hero { left: 430px; top: 9vh; } }

/* 手机常用栏：默认隐藏，仅手机且没有窗口时显示 */
.dock { display: none; }

@media (max-width: 720px) {
  .icon { border-radius: 0; }
  .icon canvas { width: 40px; height: 40px; padding: 4px; background: #0e1640b3; box-shadow: 0 0 0 2px var(--ink); }
  /* 常用栏放在任务栏那一行（开始按钮和托盘之间），不挡站在任务栏上的 626 */
  .dock { position: fixed; left: calc(50% - 16px); bottom: 7px; z-index: 1040; transform: translateX(-50%); display: flex; gap: 6px; }
  .has-win .dock { display: none; }
  .dock__app { width: 32px; height: 32px; padding: 3px; border: 0; background: var(--panel-2); box-shadow: 0 0 0 2px var(--line); }
  .dock__app canvas { width: 26px; height: 26px; }
  .dock__app:active { background: var(--stitch); }
  .tray__moon { display: none; }
  .win__grip { display: none; }
  .win__bar { height: 40px; }
  .win__btn--close { width: 30px; height: 30px; }
  .pal { padding-top: 10vh; }
}
