:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #5e6673;
  --glass: rgba(248, 248, 248, 0.74);
  --line: rgba(255, 255, 255, 0.58);
  --shadow: rgba(0, 0, 0, 0.22);
  --blue: #5db7ff;
  --violet: #7a6cff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

a {
  color: inherit;
}

.mac-screen {
  min-height: 100vh;
  background: url("assets/mac-wallpaper.png") center / cover no-repeat;
}

.menu-bar {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(245, 245, 242, 0.84);
  backdrop-filter: blur(22px);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.menu-left,
.menu-right {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  white-space: nowrap;
}

.menu-right {
  gap: 14px;
  color: rgba(0, 0, 0, 0.78);
}

.apple-mark {
  border: 0;
  padding: 0;
  background: transparent;
  width: auto;
  min-width: 16px;
  display: inline-flex;
  justify-content: center;
  color: #111;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: default;
}

.desktop {
  position: relative;
  height: calc(100vh - 28px);
}

.desktop-icons {
  position: absolute;
  top: 96px;
  right: 42px;
  display: grid;
  grid-template-columns: 94px;
  gap: 30px;
}

.desktop-icon {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 6px 4px;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
}

.desktop-icon.live {
  cursor: pointer;
}

.desktop-icon.live:hover {
  background: rgba(255, 255, 255, 0.18);
}

.desktop-icon.selected {
  background: rgba(0, 98, 255, 0.34);
}

.desktop-icon.selected strong {
  color: #fff;
}

.desktop-icon:not(.live) {
  cursor: default;
}

.desktop-icon strong {
  max-width: 94px;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.92), 0 0 8px rgba(0, 0, 0, 0.35);
}

.desktop-icon small {
  padding: 2px 6px;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.desktop-icon.live small {
  background: rgba(33, 122, 88, 0.72);
}

.file-icon {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.28));
}

.finder-panel {
  position: absolute;
  left: 42px;
  top: 58px;
  width: 390px;
  padding: 18px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(246, 247, 249, 0.78);
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(24px);
}

.window-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  cursor: grab;
  user-select: none;
}

.finder-panel.is-dragging,
.about-window.is-dragging {
  cursor: grabbing;
}

.window-controls span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.window-controls span:nth-child(1) {
  background: #ff5f57;
}

.window-controls span:nth-child(2) {
  background: #febc2e;
}

.window-controls span:nth-child(3) {
  background: #28c840;
}

.eyebrow {
  margin: 0 0 14px;
  color: #4165bb;
  font-size: 14px;
  font-weight: 800;
}

.finder-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.finder-panel p {
  margin: 9px 0 0;
  color: #4d5665;
  font-size: 13px;
  line-height: 1.65;
}

.finder-meta {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #1f6c4f !important;
  background: rgba(39, 150, 108, 0.13);
  font-size: 12px !important;
  font-weight: 700;
}

.finder-panel a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-top: 14px;
  padding: 0 13px;
  border-radius: 7px;
  color: #fff;
  background: #1f7aff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.dock {
  position: absolute;
  left: 50%;
  bottom: 10px;
  display: flex;
  gap: 10px;
  align-items: end;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 20px;
  background: rgba(222, 210, 184, 0.72);
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.dock-item {
  position: relative;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 11px rgba(0, 0, 0, 0.18);
  text-decoration: none;
  transition: transform 160ms ease;
}

.image-dock {
  background: transparent;
  box-shadow: none;
}

.image-dock img {
  width: 50px;
  height: 50px;
  display: block;
}

.dock-item:hover {
  transform: translateY(-8px) scale(1.16);
}

.finder-dock {
  background: linear-gradient(90deg, #66bfff 0 50%, #f7fbff 50% 100%);
}

.finder-dock::before,
.finder-dock::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  top: 17px;
  border-radius: 50%;
  background: #111;
}

.finder-dock::before {
  left: 16px;
}

.finder-dock::after {
  right: 16px;
}

.system-menu,
.context-menu,
.about-window {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(242, 243, 245, 0.82);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(24px);
}

.system-menu,
.context-menu {
  position: absolute;
  z-index: 10;
  min-width: 168px;
  padding: 6px;
  border-radius: 8px;
}

.system-menu {
  top: 4px;
  left: 8px;
}

.context-menu {
  top: 80px;
  left: 120px;
}

.system-menu button,
.context-menu button {
  width: 100%;
  min-height: 26px;
  border: 0;
  border-radius: 5px;
  padding: 0 10px;
  color: #141414;
  background: transparent;
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.system-menu button:hover,
.context-menu button:hover {
  color: #fff;
  background: #1f7aff;
}

.about-window {
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 48%;
  width: 320px;
  padding: 18px 20px 20px;
  border-radius: 12px;
  transform: translate(-50%, -50%);
  text-align: center;
}

.about-window .window-controls {
  margin-bottom: 14px;
}

.about-window h2 {
  margin: 0;
  font-size: 22px;
}

.about-window p {
  margin: 10px 0 6px;
  color: #3f4858;
  font-size: 14px;
}

.about-window small {
  display: block;
  color: #6b7280;
  font-size: 12px;
}

.about-window button {
  min-width: 72px;
  min-height: 30px;
  margin-top: 16px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: #1f7aff;
  font-weight: 700;
}

@media (max-width: 780px) {
  body {
    overflow: auto;
  }

  .menu-bar {
    height: 32px;
  }

  .menu-left span,
  .menu-right {
    display: none;
  }

  .desktop {
    height: auto;
    min-height: calc(100vh - 32px);
    padding: 18px 12px 96px;
  }

  .finder-panel {
    position: relative;
    inset: auto;
    width: 100%;
  }

  .desktop-icons {
    position: relative;
    top: auto;
    right: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 18px;
    margin: 28px 0;
  }
}
