/* 电脑版。窗口、按钮、表单的 98 外观来自 vendor/98.css，这里是桌面本身。 */
#desktop {
  position: fixed;
  inset: 0;
  user-select: none;
  --hl: #000080;
}

#desktop[data-wallpaper='teal'] {
  background: #008080;
}

#desktop[data-wallpaper='forest'] {
  background:
    radial-gradient(circle at 20% 110%, #1d5c2a 0 30%, transparent 31%),
    radial-gradient(circle at 75% 120%, #174d22 0 35%, transparent 36%),
    linear-gradient(#5a8f5e, #2f6b3a);
}

#desktop[data-wallpaper='sky'] {
  background:
    radial-gradient(ellipse 120px 40px at 25% 30%, #fff 60%, transparent 62%),
    radial-gradient(ellipse 160px 50px at 70% 18%, #fff 60%, transparent 62%),
    radial-gradient(ellipse 100px 30px at 55% 55%, #fff 60%, transparent 62%),
    linear-gradient(#3a7bd5, #9cc9f5);
}

/* 98.css 给按钮、窗口用的是英文像素字体，中文落到 Px12 */
#desktop,
#desktop button,
#desktop input,
#desktop select,
#desktop textarea,
#desktop label,
#desktop legend,
#desktop .title-bar-text {
  font-family: 'Pixelated MS Sans Serif', var(--px);
  font-size: 12px;
}

.px-icon {
  image-rendering: pixelated;
  flex: none;
}

/* ── 桌面图标 ── */
.icons {
  position: absolute;
  top: 6px;
  left: 6px;
  bottom: 34px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
}

#desktop .dicon {
  width: 84px;
  min-width: 0;
  min-height: 0;
  padding: 2px;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #fff;
  text-shadow: none;
  cursor: default;
}

#desktop .dicon span {
  padding: 1px 2px;
  line-height: 14px;
  text-align: center;
  word-break: break-all;
}

#desktop .dicon:focus {
  outline: none;
}

#desktop .dicon:focus span {
  background: var(--hl);
  outline: 1px dotted #ff0;
}

#desktop .dicon:focus .px-icon {
  filter: sepia(1) hue-rotate(190deg) saturate(4) brightness(0.7);
}

#desktop .dicon.dark {
  color: #000;
}

#desktop .dicon.dark:focus span {
  color: #fff;
}

/* ── 窗口 ── */
#desktop .window {
  position: absolute;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
}

#desktop .window:not(.active) .title-bar {
  background: linear-gradient(90deg, #808080, #b5b5b5);
}

#desktop .window.max {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: calc(100% - 28px) !important;
  max-height: none;
  box-sizing: border-box;
}

#desktop .title-bar {
  touch-action: none;
}

#desktop .title-bar-text {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  white-space: nowrap;
}

#desktop .window-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.msg-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 8px 4px 12px;
}

.msg-row p {
  margin: 0;
  white-space: pre-line;
  line-height: 1.5;
  user-select: text;
}

.msg-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
}

#desktop .note {
  color: #444;
}

.sysinfo {
  display: flex;
  gap: 12px;
  padding: 8px;
}

.sysinfo dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 8px;
  line-height: 1.5;
}

.sysinfo dd {
  margin: 0;
}

/* 文件夹窗口：白底，图标黑字 */
.folder {
  background: #fff;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #808080, inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
  padding: 8px;
  min-height: 140px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
}

.bin-bar {
  margin-bottom: 6px;
}

#desktop textarea.notepad {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  resize: none;
  line-height: 1.5;
  white-space: pre;
}

.browser {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 4px;
}

.browser .addr input {
  flex: 1;
}

#desktop a.button {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  min-height: 21px;
  background: silver;
  color: #000;
  text-decoration: none;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
  white-space: nowrap;
}

.browser iframe {
  flex: 1;
  border: none;
  background: #fff;
  box-shadow: inset 1px 1px #808080;
}

/* 彩蛋图鉴 */
.eggs {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 6px;
}

.eggs p {
  margin: 0;
}

.eggs .bar {
  height: 14px;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #808080;
  padding: 2px;
}

.eggs .bar i {
  display: block;
  height: 100%;
  background: repeating-linear-gradient(90deg, #000080 0 8px, transparent 8px 10px);
}

.eggs ul {
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #808080, inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
}

.eggs li {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  padding: 3px 2px;
  color: #808080;
}

.eggs li.got {
  color: #000;
}

.eggs li small {
  grid-column: 2;
  font-size: 12px;
}

.clockprops .bigtime {
  font-size: 24px;
  text-align: center;
  margin: 8px 0 0;
}

.clockprops > p {
  text-align: center;
}

/* 扫雷 */
.mines {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  box-shadow: inset -2px -2px #808080, inset 2px 2px #fff;
}

.mines-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px;
  box-shadow: inset 1px 1px #808080, inset -1px -1px #fff;
}

.led {
  background: #000;
  color: #f00;
  font-family: monospace !important;
  font-size: 18px !important;
  padding: 0 2px;
  letter-spacing: 1px;
}

#desktop .face {
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  font-size: 15px;
  color: #000;
  text-shadow: none;
}

.mines-grid {
  display: grid;
  box-shadow: inset 1px 1px #808080, inset -1px -1px #fff;
  padding: 2px;
}

#desktop .cell {
  min-width: 16px;
  min-height: 16px;
  width: 16px;
  height: 16px;
  padding: 0;
  font-size: 11px;
  font-weight: bold;
  line-height: 16px;
  text-shadow: none;
  color: #000;
}

#desktop .cell.open {
  background: #c0c0c0;
  box-shadow: inset 1px 1px #808080;
}

#desktop .cell.hit {
  background: #f00;
}

/* ── 任务栏 ── */
.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  box-sizing: border-box;
  padding: 2px;
  display: flex;
  gap: 4px;
  background: silver;
  box-shadow: inset 0 1px #dfdfdf, inset 0 2px #fff;
  z-index: 9000;
}

#desktop .taskbar button {
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  color: #000;
  text-shadow: none;
}

#desktop .start.pressed,
#desktop .task.active {
  box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px grey;
}

#desktop .task.active {
  background: repeating-conic-gradient(#c0c0c0 0 25%, #fff 0 50%) 0 0 / 2px 2px;
  font-weight: bold;
}

.tasks {
  flex: 1;
  display: flex;
  gap: 3px;
  overflow: hidden;
}

#desktop .task {
  flex: 0 1 160px;
  min-width: 0;
  justify-content: flex-start;
  overflow: hidden;
  white-space: nowrap;
}

.tray {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 4px;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #808080;
}

#desktop .tray .trophy {
  min-width: 0;
  min-height: 0;
  padding: 0 2px;
  background: transparent;
  box-shadow: none;
}

.clock {
  cursor: default;
}

/* ── 开始菜单 / 右键菜单 ── */
.startmenu,
.ctxmenu {
  position: absolute;
  z-index: 9500;
  background: silver;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px grey, inset 2px 2px #fff;
  padding: 3px;
}

.startmenu {
  left: 2px;
  bottom: 28px;
  display: flex;
}

.startmenu .banner {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background: linear-gradient(#1084d0, #000080);
  color: #c0c0c0;
  font-size: 18px;
  padding: 6px 3px;
  letter-spacing: 1px;
}

.startmenu .banner b {
  color: #fff;
}

.startmenu ul,
.ctxmenu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.startmenu li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 24px 4px 6px;
  min-width: 170px;
}

.ctxmenu li {
  padding: 3px 24px 3px 18px;
}

.startmenu li:hover,
.ctxmenu li:hover {
  background: var(--hl);
  color: #fff;
}

.startmenu li.sep,
.ctxmenu li.sep {
  padding: 0;
  margin: 3px 2px;
  height: 0;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
  pointer-events: none;
}

/* 发现彩蛋时的气泡，仿「发现新硬件」 */
.balloon {
  position: absolute;
  right: 8px;
  bottom: 36px;
  z-index: 9600;
  max-width: 240px;
  padding: 8px 10px;
  background: #ffffe1;
  border: 1px solid #000;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  animation: pop 0.2s;
}

.balloon::after {
  content: '';
  position: absolute;
  right: 40px;
  bottom: -9px;
  border: 8px solid transparent;
  border-top-color: #000;
  border-bottom: 0;
}

.balloon small {
  color: #555;
}

@keyframes pop {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}
