/* The interactive desktop on the home page: a 1280×800 stage scaled to fit its frame. */

.desk {
  --tb-h: 48px;
  --tb-bg: rgba(243, 243, 246, 0.82);
  --tb-ink: #1c1c1e;
  --tb-ink-2: #6b6b70;
  --tb-hover: rgba(0, 0, 0, 0.06);
  --tb-active: rgba(0, 0, 0, 0.1);
  --fly-bg: rgba(248, 248, 250, 0.9);
  --fly-line: rgba(0, 0, 0, 0.08);
  --win-bg: #ffffff;
  --win-bar: #f1f1f3;
  --win-ink: #1c1c1e;
  --win-ink-2: #6e6e73;
  --accent: #0a84ff;
  position: absolute; left: 0; top: 0; width: 1280px; height: 800px; transform-origin: 0 0;
  overflow: hidden; user-select: none; -webkit-user-select: none; cursor: default; text-align: left; line-height: 1.35;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Helvetica Neue", sans-serif; font-size: 13px; letter-spacing: 0;
  color: var(--tb-ink); outline: none;
}
.desk.dark {
  --tb-bg: rgba(32, 32, 36, 0.82);
  --tb-ink: #f2f2f7;
  --tb-ink-2: #a1a1a6;
  --tb-hover: rgba(255, 255, 255, 0.08);
  --tb-active: rgba(255, 255, 255, 0.14);
  --fly-bg: rgba(40, 40, 44, 0.9);
  --fly-line: rgba(255, 255, 255, 0.1);
  --win-bg: #1e1e20;
  --win-bar: #2a2a2d;
  --win-ink: #f2f2f7;
  --win-ink-2: #a1a1a6;
}

/* Wallpaper: two desktops, slid sideways when switching. */
.wallpapers { position: absolute; inset: 0; display: flex; width: 200%; transition: transform 0.55s cubic-bezier(.3,.7,.2,1); }
.wallpaper { flex: 1; height: 100%; position: relative; overflow: hidden; }
.wp1 { background: radial-gradient(90% 80% at 15% 15%, #8ec5fc 0%, transparent 60%), radial-gradient(80% 90% at 85% 30%, #e0c3fc 0%, transparent 55%), radial-gradient(90% 90% at 50% 100%, #f9a8d4 0%, transparent 60%), linear-gradient(160deg, #6a85f1, #b06ab3); }
.wp2 { background: radial-gradient(80% 80% at 20% 80%, #fdd6a2 0%, transparent 60%), radial-gradient(70% 80% at 80% 20%, #84fab0 0%, transparent 55%), linear-gradient(200deg, #0f766e, #1e3a8a); }
.desk.dark .wp1 { filter: brightness(0.55) saturate(1.1); }
.desk.dark .wp2 { filter: brightness(0.55) saturate(1.1); }
.desk.on2 .wallpapers { transform: translateX(-50%); }

/* Windows */
.win {
  position: absolute; background: var(--win-bg); color: var(--win-ink); border-radius: 12px; overflow: hidden;
  box-shadow: 0 22px 60px rgba(0,0,0,0.28), 0 0 0 0.5px rgba(0,0,0,0.25);
  transition: opacity 0.25s, transform 0.35s cubic-bezier(.3,.7,.2,1), filter 0.25s;
  display: flex; flex-direction: column;
}
.win.focused { box-shadow: 0 30px 80px rgba(0,0,0,0.38), 0 0 0 0.5px rgba(0,0,0,0.3); }
.win.min { opacity: 0; pointer-events: none; }
.win.off { opacity: 0; pointer-events: none; transform: translateX(-60px); }
.win.closing { opacity: 0; transform: scale(0.92); }
.win.opening { opacity: 0; transform: scale(0.94); }
.win.max { border-radius: 0; }
.win .bar { height: 34px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--win-bar); font-weight: 600; font-size: 12.5px; color: var(--win-ink-2); }
.win.focused .bar { color: var(--win-ink); }
.win .lights { display: flex; gap: 7px; }
.win .lights i { width: 12px; height: 12px; border-radius: 50%; display: block; cursor: pointer; background: #d1d1d6; }
.win.focused .lights i:nth-child(1) { background: #ff5f57; }
.win.focused .lights i:nth-child(2) { background: #febc2e; }
.win.focused .lights i:nth-child(3) { background: #28c840; }
.win .bar .t { flex: 1; text-align: center; margin-right: 52px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win .body { flex: 1; position: relative; overflow: hidden; }

/* Aero Peek: everything but the peeked window fades away (no outline). */
.desk.peeking .layer > .win:not(.peek) { opacity: 0 !important; }
.desk.peeking .win.peek { opacity: 1 !important; }
.desk.peeking .win.min.peek { transform: none; }

/* ---------- Taskbar ---------- */

.tb {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--tb-h); z-index: 1000;
  background: var(--tb-bg); backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%);
  border-top: 1px solid var(--fly-line); display: flex; align-items: stretch; transition: height 0.2s, background 0.3s;
}
.tb .group { display: flex; align-items: stretch; gap: 2px; position: absolute; top: 0; bottom: 0; transition: left 0.35s cubic-bezier(.3,.7,.2,1); }
.tbtn {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 0 10px; margin: 4px 0; border-radius: 6px;
  cursor: default; color: var(--tb-ink); transition: background 0.15s; max-width: 170px; min-width: 0;
}
.tbtn:hover { background: var(--tb-hover); }
.tbtn.focused { background: var(--tb-active); }
.tbtn .ic { width: calc(var(--tb-h) * 0.55); height: calc(var(--tb-h) * 0.55); flex: none; }
.tbtn .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.tbtn::after { /* running indicator */
  content: ""; position: absolute; left: 50%; bottom: 1px; width: 6px; height: 3px; margin-left: -3px; border-radius: 2px;
  background: var(--tb-ink-2); opacity: 0; transition: width 0.2s, margin 0.2s, opacity 0.2s, background 0.2s;
}
.tbtn.running::after { opacity: 1; }
.tbtn.focused::after { width: 16px; margin-left: -8px; background: var(--accent); }
.tbtn.minimized .ic { opacity: 0.6; }
.tbtn.launcher { padding: 0 8px; }
.desk.iconsonly .tbtn .lbl { display: none; }
.desk.iconsonly .tbtn { padding: 0 9px; }
.tbtn.start .ic, .tbtn.tv .ic { width: calc(var(--tb-h) * 0.48); height: calc(var(--tb-h) * 0.48); }
/* The image has room for its shadow around the dots and bar, which fill about 80% of it (as in the app). */
.tbtn.start .glyph { width: calc(var(--tb-h) * 0.6); height: calc(var(--tb-h) * 0.6); background: url(start-dark.png) center / contain no-repeat; }
.desk.dark .tbtn.start .glyph { background-image: url(start-light.png); }
.tbtn.tv svg { color: var(--tb-ink); }

.tray { position: absolute; right: 0; top: 0; bottom: 0; display: flex; align-items: stretch; }
.tray .ti { display: flex; align-items: center; justify-content: center; padding: 0 8px; margin: 4px 0; border-radius: 6px; color: var(--tb-ink); gap: 6px; }
.tray .ti:hover { background: var(--tb-hover); }
.tray .ti.on { background: var(--tb-active); }
.tray .ti svg { width: 17px; height: 17px; }
.tray .clock { flex-direction: column; gap: 0; line-height: 1.25; font-size: 12px; text-align: center; padding: 0 10px; }
.tray .ime { font-weight: 600; font-size: 13px; width: 30px; }
.tray .sliver { width: 8px; margin: 0 0 0 4px; border-left: 1px solid var(--fly-line); }
.tray .sliver:hover { background: var(--tb-hover); }

/* ---------- Flyouts ---------- */

.fly {
  position: absolute; z-index: 1100; background: var(--fly-bg); color: var(--tb-ink);
  backdrop-filter: blur(40px) saturate(170%); -webkit-backdrop-filter: blur(40px) saturate(170%);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.3), 0 0 0 0.5px var(--fly-line);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.2s, transform 0.25s cubic-bezier(.3,.7,.2,1);
}
.fly.open { opacity: 1; transform: none; pointer-events: auto; }
.fly h4 { margin: 0; padding: 14px 16px 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.fly h4 .sp { flex: 1; }
.fly h4 > svg { width: 18px; height: 18px; flex: none; }
.fly .sec { font-size: 11px; font-weight: 600; color: var(--tb-ink-2); padding: 8px 16px 4px; }
.fly .row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 0 6px; border-radius: 8px; cursor: default; }
.fly .row:hover { background: var(--tb-hover); }
.fly .row .nm { flex: 1; }
.fly .row .st { font-size: 11px; color: var(--tb-ink-2); }
.fly .row.cur .nm { font-weight: 600; }
.fly .row svg { width: 18px; height: 18px; flex: none; }
.fly .row.cur svg { color: var(--accent); }
.fly .foot { border-top: 1px solid var(--fly-line); padding: 10px 16px; font-size: 12px; color: var(--accent); margin-top: 8px; }
.fly .tg { width: 34px; height: 20px; border-radius: 10px; background: var(--accent); position: relative; cursor: pointer; flex: none; transition: background 0.2s; }
.fly .tg::after { content: ""; position: absolute; top: 2px; left: 16px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 0.2s; }
.fly .tg.offs { background: #8e8e93; }
.fly .tg.offs::after { left: 2px; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--tb-ink-2); border-top-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fly input[type=range] { flex: 1; accent-color: var(--accent); }

/* Start menu */
.start-menu { width: 560px; height: 560px; display: flex; flex-direction: column; }
.start-menu .search { margin: 16px 16px 6px; display: flex; align-items: center; gap: 8px; background: var(--tb-hover); border-radius: 9px; padding: 9px 12px; }
.start-menu .search input { border: 0; outline: 0; background: transparent; flex: 1; font: inherit; font-size: 14px; color: var(--tb-ink); }
.start-menu .cols { flex: 1; display: grid; grid-template-columns: 220px 1fr; min-height: 0; }
.start-menu .list { overflow-y: auto; padding: 4px 10px 10px; }
.start-menu .list .row { margin: 0; }
.start-menu .letter { font-size: 11px; font-weight: 600; color: var(--tb-ink-2); padding: 8px 12px 2px; }
.start-menu .pins { padding: 4px 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; align-content: start; }
.start-menu .pin { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 10px; font-size: 11.5px; }
.start-menu .pin:hover { background: var(--tb-hover); }
.start-menu .pin svg { width: 40px; height: 40px; }
.start-menu .hd { font-size: 12px; font-weight: 600; color: var(--tb-ink-2); padding: 8px 16px 4px; grid-column: 1 / -1; }
.start-menu .user { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--fly-line); background: var(--tb-hover); border-radius: 0 0 14px 14px; }
.start-menu .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; }
.start-menu .user .sp { flex: 1; }
.start-menu .user svg { width: 16px; height: 16px; }
.start-menu .sel { background: var(--tb-hover); }

/* Hover preview above a button */
.preview { width: 230px; padding: 10px; }
.preview .pt { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; }
.preview .pt svg { width: 16px; height: 16px; flex: none; }
.preview .pt span { overflow: hidden; text-overflow: ellipsis; }
.preview .thumb { height: 128px; border-radius: 8px; overflow: hidden; position: relative; background: var(--tb-hover); }
.preview .thumb > .win { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-shadow: none; pointer-events: none; transition: none; opacity: 1 !important; }
.preview .thumb:hover { box-shadow: 0 0 0 2px var(--accent); }

/* Calendar */
.cal { width: 330px; padding: 16px 18px 14px; }
.cal .now { font-size: 30px; font-weight: 300; }
.cal .date { color: var(--tb-ink-2); margin-bottom: 12px; }
.cal .mh { display: flex; justify-content: space-between; font-weight: 600; margin: 10px 0 6px; }
.cal .grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; gap: 2px; font-size: 12px; }
.cal .grid .wd { color: var(--tb-ink-2); font-size: 11px; padding-bottom: 4px; }
.cal .grid .d { height: 34px; display: grid; place-items: center; border-radius: 50%; }
.cal .grid .d.o { color: var(--tb-ink-2); opacity: 0.5; }
.cal .grid .d.t { background: var(--accent); color: #fff; font-weight: 600; }

/* Task View strip */
.tvstrip { padding: 14px; display: flex; gap: 14px; }
.tvstrip .card { width: 190px; cursor: pointer; text-align: center; font-size: 12px; }
.tvstrip .card .shot { height: 118px; border-radius: 8px; margin-bottom: 6px; position: relative; overflow: hidden; box-shadow: 0 0 0 2px transparent; transition: box-shadow 0.2s, transform 0.2s; }
.tvstrip .card.cur .shot { box-shadow: 0 0 0 2px var(--accent); }
.tvstrip .card:hover .shot { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--tb-ink-2); }
.tvstrip .card .shot i { position: absolute; background: rgba(255,255,255,0.9); border-radius: 3px; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.tvstrip .card.add .shot { display: grid; place-items: center; font-size: 30px; color: var(--tb-ink-2); background: var(--tb-hover); }

/* Alt+Tab switcher */
.switcher { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.96); z-index: 1200; display: flex; gap: 10px; padding: 16px;
  background: var(--fly-bg); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.2s; }
.switcher.open { opacity: 1; transform: translate(-50%, -50%); }
.switcher .it { width: 150px; padding: 8px; border-radius: 12px; text-align: center; font-size: 12px; }
.switcher .it.sel { background: rgba(10, 132, 255, 0.3); }
.switcher .it .tn { height: 92px; border-radius: 8px; overflow: hidden; position: relative; margin-bottom: 6px; background: var(--tb-hover); }
.switcher .it .tn > .win { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-shadow: none; transition: none; opacity: 1 !important; pointer-events: none; }

/* Context menu */
.ctx { position: absolute; z-index: 1300; min-width: 190px; padding: 5px; border-radius: 10px; background: var(--fly-bg); color: var(--tb-ink);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); box-shadow: 0 14px 40px rgba(0,0,0,0.3), 0 0 0 0.5px var(--fly-line); display: none; }
.ctx.open { display: block; }
.ctx div { padding: 6px 10px; border-radius: 6px; }
.ctx div:hover { background: var(--accent); color: #fff; }
.ctx hr { border: 0; border-top: 1px solid var(--fly-line); margin: 4px 6px; }

/* Toast that explains what just happened */
.hint { position: absolute; left: 50%; top: 22px; transform: translate(-50%, -10px); z-index: 1400; padding: 8px 16px; border-radius: 980px;
  background: rgba(0,0,0,0.72); color: #fff; font-size: 13px; opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; white-space: nowrap; }
.hint.show { opacity: 1; transform: translate(-50%, 0); }

/* Liquid Glass: clearer, brighter material with a light rim, like macOS 26. */
.desk.glass { --tb-bg: rgba(255,255,255,0.22); --fly-bg: rgba(255,255,255,0.32); }
.desk.glass.dark { --tb-bg: rgba(30,30,34,0.28); --fly-bg: rgba(30,30,34,0.42); }
.desk.glass .tb { backdrop-filter: blur(14px) saturate(220%) brightness(1.08); -webkit-backdrop-filter: blur(14px) saturate(220%) brightness(1.08);
  border-top: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -1px 0 rgba(255,255,255,0.15); }
.desk.glass .fly, .desk.glass .switcher, .desk.glass .ctx {
  backdrop-filter: blur(18px) saturate(220%) brightness(1.06); -webkit-backdrop-filter: blur(18px) saturate(220%) brightness(1.06);
  border-radius: 22px; box-shadow: 0 24px 60px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.6), inset 0 0 0 1px rgba(255,255,255,0.25); }
.desk.glass .start-menu .user { border-radius: 0 0 22px 22px; }
@keyframes wtblink { 50% { opacity: 0; } }
