﻿.win-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;

  
  --win-chrome-bg: #e9e9e9;
  --win-chrome-border: #c8c8c8;
  --win-chrome-text: #2a2a2a;
  --win-border: #6e6e6e;
  --win-body-bg: #ffffff;
  --win-btn-hover: rgba(0, 0, 0, 0.08);
  --win-taskbar-bg: #e9e9e9;
  --win-taskbar-bg-hover: #d8d8d8;
  --win-taskbar-text: #1f1f1f;
  --win-radius: 0px;
}

@media (prefers-color-scheme: dark) {
  .win-root {
    --win-chrome-bg: #000000;
    --win-chrome-border: #3a3a3b;
    --win-chrome-text: #f3f3f3;
    --win-border: #3a3a3b;
    --win-body-bg: #000000;
    --win-btn-hover: rgba(255, 255, 255, 0.1);
    --win-taskbar-bg: #000000;
    --win-taskbar-bg-hover: #1a1a1a;
    --win-taskbar-text: #f3f3f3;
  }
}


.win-root.is-chrome {
  --win-chrome-bg: #d3deef;
  --win-chrome-border: #b9c3d6;
  --win-chrome-text: #1f1f1f;
  --win-border: #a8b1c0;
  --win-body-bg: #ffffff;
  --win-btn-hover: rgba(0, 0, 0, 0.08);
  --win-taskbar-bg: #d3deef;
  --win-taskbar-bg-hover: #c3cee0;
  --win-taskbar-text: #1f1f1f;
  --win-radius: 10px;
}

@media (prefers-color-scheme: dark) {
  .win-root.is-chrome {
    --win-chrome-bg: #000000;
    --win-chrome-border: #2a2c2e;
    --win-chrome-text: #f3f3f3;
    --win-border: #5f6368;
    --win-body-bg: #2a2c2e;
    --win-btn-hover: rgba(255, 255, 255, 0.1);
    --win-taskbar-bg: #3c4043;
    --win-taskbar-bg-hover: #4f5256;
    --win-taskbar-text: #f3f3f3;
  }
}

.win-root[data-theme="light"] {
  --win-chrome-bg: #e9e9e9;
  --win-chrome-border: #c8c8c8;
  --win-chrome-text: #2a2a2a;
  --win-border: #6e6e6e;
  --win-body-bg: #ffffff;
  --win-btn-hover: rgba(0, 0, 0, 0.08);
  --win-taskbar-bg: #e9e9e9;
  --win-taskbar-bg-hover: #d8d8d8;
  --win-taskbar-text: #1f1f1f;
  --win-radius: 0px;
}

.win-root[data-theme="light"].is-chrome {
  --win-chrome-bg: #d3deef;
  --win-chrome-border: #b9c3d6;
  --win-chrome-text: #1f1f1f;
  --win-border: #a8b1c0;
  --win-body-bg: #ffffff;
  --win-btn-hover: rgba(0, 0, 0, 0.08);
  --win-taskbar-bg: #d3deef;
  --win-taskbar-bg-hover: #c3cee0;
  --win-taskbar-text: #1f1f1f;
  --win-radius: 10px;
}

.win-root[data-theme="dark"] {
  --win-chrome-bg: #000000;
  --win-chrome-border: #3a3a3b;
  --win-chrome-text: #f3f3f3;
  --win-border: #3a3a3b;
  --win-body-bg: #000000;
  --win-btn-hover: rgba(255, 255, 255, 0.1);
  --win-taskbar-bg: #000000;
  --win-taskbar-bg-hover: #1a1a1a;
  --win-taskbar-text: #f3f3f3;
  --win-radius: 0px;
}

.win-root[data-theme="dark"].is-chrome {
  --win-chrome-bg: #000000;
  --win-chrome-border: #2a2c2e;
  --win-chrome-text: #f3f3f3;
  --win-border: #5f6368;
  --win-body-bg: #2a2c2e;
  --win-btn-hover: rgba(255, 255, 255, 0.1);
  --win-taskbar-bg: #3c4043;
  --win-taskbar-bg-hover: #4f5256;
  --win-taskbar-text: #f3f3f3;
  --win-radius: 10px;
}


.win-root.is-maximized {
  --win-radius: 0px;
}

.win-root[hidden] {
  display: none;
}

.win-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 13, 18, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.win-root.is-open .win-backdrop {
  opacity: 1;
}

.win-root.is-minimized .win-backdrop {
  opacity: 0;
  pointer-events: none;
}

.win {
  position: absolute;
  background: var(--win-body-bg);
  color: var(--win-chrome-text);
  border: 1px solid var(--win-border);
  border-radius: var(--win-radius);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s ease;
  user-select: none;
}

.win-root.is-open .win {
  opacity: 1;
  transform: scale(1);
}

.win-root.is-minimized .win {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}


.win__chrome {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  background: var(--win-chrome-bg);
  border-bottom: 1px solid var(--win-chrome-border);
  cursor: grab;
  font-size: 12px;
  color: var(--win-chrome-text);
  font-family: Verdana, Geneva, Tahoma, sans-serif;
}

.win__chrome:active {
  cursor: grabbing;
}

.win__title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  pointer-events: none;
  overflow: hidden;
}

.win__title-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.win__title-icon::before {
  content: attr(data-fallback);
  display: block;
}

.win__title-icon.has-image {
  background: transparent;
}

.win__title-icon.has-image::before {
  display: none;
}

.win__title-icon img,
.win__title-icon svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.win__title-icon.is-rounded {
  border-radius: 1px;
}

.win__title-icon.is-rounded img {
  border-radius: 2px;
}

.win__title-text {
  font-family: Verdana, Geneva, Tahoma, sans-serif !important;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win__controls {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: stretch;
  height: 100%;
  pointer-events: auto;
}

.win__btn {
  position: relative;
  z-index: 6;
  width: 46px;
  height: 100%;
  min-width: 46px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: var(--win-chrome-text);
  cursor: pointer;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  pointer-events: auto;
  transition: background 0.12s ease, color 0.12s ease;
}

.win__btn::before,
.win__btn::after {
  content: none !important;
  display: none !important;
}

.win__btn-icon {
  position: static;
  width: 12px;
  height: 12px;
  display: block;
  margin: 0;
  flex: 0 0 auto;
  pointer-events: none;
  overflow: visible;
}

.win__btn-icon * {
  vector-effect: non-scaling-stroke;
}


.win__btn-glyph {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-family: "Segoe Fluent Icons", "Segoe MDL2 Assets";
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: inherit;
  user-select: none;
  pointer-events: none;
}

.win-root.is-windows .win__btn-glyph {
  display: flex;
}

.win-root.is-windows .win__btn-icon {
  display: none;
}

.win__btn:hover {
  background: var(--win-btn-hover);
}

.win__btn--close:hover {
  background: #e81123;
  color: #ffffff;
}

.win__body {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  background: var(--win-body-bg);
  overflow: hidden;
}


.win__iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: var(--win-body-bg);
  scrollbar-width: none;
  color-scheme: light dark;
}

.win-root[data-theme="light"] .win__iframe {
  color-scheme: light;
}

.win-root[data-theme="dark"] .win__iframe {
  color-scheme: dark;
}

.win__iframe::-webkit-scrollbar {
  display: none;
}

.win__drag-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: inherit;
}

.win__drag-shield[hidden] {
  display: none;
}

.win__close-frame {
  position: absolute;
  inset: 0;
  z-index: 40;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
  color-scheme: light dark;
}

.win-root[data-theme="light"] .win__close-frame {
  color-scheme: light;
}

.win-root[data-theme="dark"] .win__close-frame {
  color-scheme: dark;
}

.win__close-frame[hidden] {
  display: none;
}

.win__resize {
  position: absolute;
  z-index: 3;
}

.win-root.is-maximized .win__resize {
  display: none;
}

.win-root.is-mobile .win {
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.win-root.is-mobile.is-open .win {
  transform: none;
}

.win-root.is-mobile .win__controls,
.win-root.is-mobile .win__resize,
.win-root.is-mobile .win-taskbar {
  display: none !important;
}

.win__resize--n { top: -3px; left: 6px; right: 6px; height: 6px; cursor: ns-resize; }
.win__resize--s { bottom: -3px; left: 6px; right: 6px; height: 6px; cursor: ns-resize; }
.win__resize--e { right: -3px; top: 6px; bottom: 6px; width: 6px; cursor: ew-resize; }
.win__resize--w { left: -3px; top: 6px; bottom: 6px; width: 6px; cursor: ew-resize; }
.win__resize--ne { top: -3px; right: -3px; width: 10px; height: 10px; cursor: nesw-resize; }
.win__resize--nw { top: -3px; left: -3px; width: 10px; height: 10px; cursor: nwse-resize; }
.win__resize--se { bottom: -3px; right: -3px; width: 10px; height: 10px; cursor: nwse-resize; }
.win__resize--sw { bottom: -3px; left: -3px; width: 10px; height: 10px; cursor: nesw-resize; }

.win-taskbar {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--win-taskbar-bg);
  color: var(--win-taskbar-text);
  border: 1px solid var(--win-border);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: background 0.12s ease;
}

.win-taskbar[hidden] {
  display: none;
}

.win-taskbar:hover {
  background: var(--win-taskbar-bg-hover);
}

.win-taskbar__icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
}


@keyframes win-bump-left {
  0%, 100% { transform: translate(0, 0); }
  45%      { transform: translate(-5px, 0); }
}
@keyframes win-bump-right {
  0%, 100% { transform: translate(0, 0); }
  45%      { transform: translate(5px, 0); }
}
@keyframes win-bump-top {
  0%, 100% { transform: translate(0, 0); }
  45%      { transform: translate(0, -5px); }
}
@keyframes win-bump-bottom {
  0%, 100% { transform: translate(0, 0); }
  45%      { transform: translate(0, 5px); }
}
.win-root.is-open .win.is-bump-left   { animation: win-bump-left   180ms ease-out; }
.win-root.is-open .win.is-bump-right  { animation: win-bump-right  180ms ease-out; }
.win-root.is-open .win.is-bump-top    { animation: win-bump-top    180ms ease-out; }
.win-root.is-open .win.is-bump-bottom { animation: win-bump-bottom 180ms ease-out; }


.win-confirm {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  display: grid;
  place-items: center;
  padding: 12px;
}
.win-confirm[hidden] {
  display: none;
}


.win-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.win-confirm.is-open {
  pointer-events: auto;
}
.win-confirm.is-open .win-confirm__backdrop {
  opacity: 1;
  animation: overlay-breath 4.8s ease-in-out infinite;
}
@keyframes overlay-breath {
  0%, 100% { background-color: rgba(0, 0, 0, 0.74); }
  50%      { background-color: rgba(0, 0, 0, 0.80); }
}


.win-confirm__panel {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: #FFFFFF;
  border-radius: 14px;
  padding: 22px 22px 18px;
  overflow: hidden;
  color: #374151;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.60),
    0 0 0 0 rgba(220, 38, 38, 0.0);
  opacity: 0;
  transform: translateY(8px) scale(0.985);
}
.win-confirm.is-open .win-confirm__panel {
  animation:
    modal-enter 220ms cubic-bezier(0.2, 0.9, 0.25, 1) both,
    pulse-glow 1.8s ease-in-out 220ms infinite;
}


.win-confirm__panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: #DC2626;
}

@keyframes modal-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}


@keyframes pulse-glow {
  0%, 100% {
    box-shadow:
      0 40px 80px -20px rgba(0, 0, 0, 0.60),
      0 0 0 0 rgba(220, 38, 38, 0.0);
  }
  50% {
    box-shadow:
      0 40px 80px -20px rgba(0, 0, 0, 0.60),
      0 0 0 12px rgba(220, 38, 38, 0.25);
  }
}

.win-confirm__icon-wrap {
  display: flex;
  justify-content: center;
  margin-top: 6px;
  margin-bottom: 14px;
}
.win-confirm__icon {
  width: 42px;
  height: 42px;
  color: #DC2626;
  display: block;
  animation: icon-breath 1.8s ease-in-out infinite;
  transform-origin: center;
}
@keyframes icon-breath {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(220, 38, 38, 0)); }
  50%      { transform: scale(1.04); filter: drop-shadow(0 2px 6px rgba(220, 38, 38, 0.25)); }
}

.win-confirm__title {
  margin: 0;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: #0F172A;
}
.win-confirm__title em {
  font-style: normal;
  letter-spacing: -0.005em;
}

.win-confirm__text {
  margin: 10px 0 0;
  text-align: center;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.55;
  color: #374151;
}


.win-confirm__callout {
  margin-top: 18px;
  background: #FEF2F2;
  border-left: 4px solid #DC2626;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: #7F1D1D;
  display: flex;
  align-items: center;
  gap: 8px;
}
.win-confirm__callout svg {
  flex: 0 0 auto;
  color: #DC2626;
}

.win-confirm__actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.win-confirm__btn {
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    transform 80ms ease,
    box-shadow 140ms ease;
}
.win-confirm__btn:focus-visible {
  outline: 2px solid #DC2626;
  outline-offset: 3px;
}


.win-confirm__btn--ghost {
  background: transparent;
  border: 0;
  color: #9CA3AF;
  font-size: 13px;
  font-weight: 400;
  padding: 10px 6px;
}
.win-confirm__btn--ghost:hover { color: #6B7280; }


.win-confirm__btn--primary {
  background: #DC2626;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  padding: 12px 22px;
  border-radius: 10px;
  box-shadow:
    0 1px 2px rgba(17, 24, 39, 0.08),
    0 8px 20px -8px rgba(220, 38, 38, 0.55);
}
.win-confirm__btn--primary:hover { background: #B91C1C; }
.win-confirm__btn--primary:active { transform: translateY(1px); }


@media (prefers-reduced-motion: reduce) {
  .win-confirm__panel,
  .win-confirm__icon,
  .win-confirm__backdrop {
    animation: none !important;
  }
  .win-confirm__panel {
    opacity: 1;
    transform: none;
    box-shadow:
      0 40px 80px -20px rgba(0, 0, 0, 0.60),
      0 0 0 8px rgba(220, 38, 38, 0.18);
  }
}
