/* macOS 桌面应用窗口外壳 */

.mac-desktop {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #e8ecf1 0%, #d1d9e6 100%);
  padding: 24px;
}

body.embed-mode.mac-desktop,
body.embed-mode {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0;
  background: transparent;
}

body.embed-mode .mac-desktop {
  min-height: 0;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 4px;
  align-items: center;
  justify-content: center;
  overflow: visible;
  /* 官网 Hero 白底：不要桌面渐变 */
  background: transparent;
}

.mac-window {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  background: #f5f5f5;
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 24px 48px rgba(15, 23, 42, 0.18),
    0 8px 16px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

body.embed-mode .mac-window {
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.08),
    0 12px 32px rgba(37, 99, 235, 0.07),
    0 4px 16px rgba(37, 99, 235, 0.05);
  height: 100%;
  max-height: 100%;
  width: 100%;
}

.mac-titlebar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  background: linear-gradient(180deg, #f6f6f6 0%, #ececec 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  user-select: none;
}

.mac-traffic {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mac-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
}

.mac-dot--close {
  background: #ff5f57;
}

.mac-dot--min {
  background: #febc2e;
}

.mac-dot--max {
  background: #28c840;
}

.mac-titlebar__center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  pointer-events: none;
}

.mac-titlebar__logo {
  width: 20px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.mac-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.72);
  letter-spacing: 0.01em;
}

.mac-titlebar__spacer {
  width: 52px;
}

.mac-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--page-background);
}

.mac-content .app-shell {
  flex: 1;
  min-height: 0;
  height: auto;
}

body.embed-mode .mac-content,
body.embed-mode .mac-content .app-shell {
  height: 100%;
  min-height: 0;
}

/* 自动拖入动画 */
.market-card.is-fly-to-composer {
  position: relative;
  z-index: 50;
  animation: card-fly-to-composer 1s cubic-bezier(0.33, 1, 0.68, 1) forwards;
  pointer-events: none;
}

@keyframes card-fly-to-composer {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
  }
  70% {
    transform: translate(280px, 220px) scale(0.75);
    opacity: 0.85;
  }
  100% {
    transform: translate(360px, 320px) scale(0.35);
    opacity: 0;
  }
}

.composer.is-receive-pulse {
  animation: composer-receive 0.6s ease 0.85s;
}

@keyframes composer-receive {
  0% {
    box-shadow: 0 0 0 0 rgba(21, 101, 192, 0.45);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(21, 101, 192, 0);
  }
}

body.embed-mode .promo-toolbar {
  display: none !important;
}

body.embed-mode .extract-overlay {
  /* 嵌入时连线仍可用 */
}
