* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
  border-radius: 8px !important;
}

body {
  overflow: hidden;
  background-color: #F9F9F8;
  color: #000;
  -webkit-user-select: none;
  user-select: none;
}

.window-content {
  -webkit-user-select: text;
  user-select: text;
}

.wallpaper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url('background.png');
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.desktop-icons {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 48px);
  padding: 16px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fill, 80px);
  gap: 16px;
  background-color: transparent;
}

.desktop-icon {
  width: 100px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  transition: all 0.2s ease;
  border-radius: 8px !important;
}

.desktop-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.icon-image {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px !important;
}

.icon-text {
  font-size: 18px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: #000000;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  border-radius: 8px !important;
}

.taskbar {
  position: fixed;
  bottom: 4px;
  left: 4px;
  right: 4px;
  height: 48px;
  background-color: rgba(242, 242, 242, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 9999999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-radius: 8px !important;
}

.start-button {
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.2s ease;
  border-radius: 8px !important;
}

.start-button:hover {
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 8px !important;
}

.win11-start-icon {
  width: 24px;
  height: 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  border-radius: 8px !important;
}

.tile {
  background-color: #0078d4;
  border-radius: 8px !important;
}

.tile1 { grid-area: 1 / 1 / 2 / 2; }
.tile2 { grid-area: 1 / 2 / 2 / 3; }
.tile3 { grid-area: 2 / 1 / 3 / 2; }
.tile4 { grid-area: 2 / 2 / 3 / 3; }

.taskbar-apps {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
  margin-left: 16px;
  flex-shrink: 0;
}

.taskbar-apps::-webkit-scrollbar {
  height: 4px;
}

.taskbar-apps::-webkit-scrollbar-thumb {
  background-color: rgba(155, 155, 155, 0.5);
  border-radius: 2px;
}

.taskbar-apps::-webkit-scrollbar-track {
  background: transparent;
}

.taskbar-app {
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 1px;
  transition: all 0.2s ease;
  position: relative;
  border-radius: 8px !important;
}

.taskbar-app:hover {
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 8px !important;
}

.taskbar-app.active::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 24px;
  height: 2px;
  background-color: #0078d4;
  border-radius: 8px !important;
  transform: scaleX(0);
  transition: transform 0.2s ease;
  transform-origin: center;
}

.taskbar-app.active:hover::after,
.taskbar-app.active::after {
  transform: scaleX(1);
}

.datetime {
  color: #000;
  font-size: 14px;
  transition: all 0.2s ease;
  padding: 0 8px;
  height: 32px;
  display: flex;
  align-items: center;
  border-radius: 8px !important;
  margin-left: auto;
}

.datetime:hover {
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 8px !important;
}

.window {
  height: 250px;
  border: 1px solid rgba(72, 84, 96, 0.2);
  border-radius: 8px !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  background-color: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  transition: transform 0.2s ease,
              opacity 0.2s ease,
              width 0.2s ease,
              height 0.2s ease,
              left 0.2s ease,
              top 0.2s ease;
}

@media (max-width: 768px) {
  .window {
    width: 100vw !important;
    height: calc(100vh - 56px) !important;
    top: 0 !important;
    left: 0 !important;
    border-radius: 8 !important;
  }
  .window-header .window-btn[title="最大化"],
  .window-header .window-btn[title="恢复"] {
    display: none !important;
  }
}

.window.maximized {
  width: 100vw !important;
  height: calc(100vh - 56px) !important;
  top: 0 !important;
  left: 0 !important;
  border-radius: 0 !important;
  transition: transform 0.2s ease, opacity 0.2s ease, width 0.2s ease, height 0.2s ease, left 0.2s ease, top 0.2s ease;
}

.window.minimized {
  opacity: 0 !important;
  pointer-events: none !important;
}

.window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(240, 240, 240, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  -webkit-user-select: none;
  user-select: none;
  min-height: 38px;
  transition: background 0.2s ease;
  border-radius: 8px 8px 0 0 !important;
}

.url-display-container {
  flex-grow: 1;
  padding: 0 3px;
  display: flex;
  align-items: center;
  transition: padding 0.3s ease-in-out;
  min-width: 0;
}

.url-display {
  white-space: nowrap;
  overflow-x: auto;
  width: 100%;
  background: white;
  padding: 2px 6px;
}

.window-header:hover {
  background-color: rgba(240, 240, 240, 0.9);
}

@media (max-width: 768px) {
  .window-header .window-buttons .window-btn.minimize,
  .window-header .window-buttons .window-btn.maximize {
    display: none !important;
  }
}

.window-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 100px);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.loading-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 1;
  transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out, margin-right 0.3s ease-in-out;
  margin-right: 8px;
  width: auto;
  min-width: 0;
}

.loading-wrapper.hidden {
  opacity: 0;
  width: 0 !important;
  margin-right: 0 !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

.loading-text {
  font-size: 14px;
  color: #000;
}

.loading-animation {
  width: 16px;
  height: 16px;
  background-image: url('../loading_black.gif');
  background-size: cover;
  background-position: center;
  display: inline-block;
}

.separator {
  margin: 0 4px;
}

.loading-animation img {
  display: block;
}

.window-buttons {
  display: flex;
  gap: 10px;
  margin-right: 2px;
  scale: 1.05;
  margin-top: -5px;
  padding-left: 5px;
}

.window-btn svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.window-btn {
  width: 12px;
  height: 12px;
  border: none;
  outline: none;
  transition: all 0.2s ease;
  position: relative;
  zoom: 1.4;
  border-radius: 8px !important;
  background: none;
}

.window-btn:hover::before {
  content: attr(title);
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 8px !important;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.window-btn:hover::before {
  opacity: 1;
}

.window-content {
  padding: 0;
  height: calc(100% - 32px);
  overflow: hidden;
  position: relative;
  background-color: #fff;
  border-radius: 8 0 8px 8px !important;
}

.app-iframe {
  width: 100%;
  height: 100%;
  border: none;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 8px !important;
  zoom: 0.2;
}

.resize-handle {
  position: absolute;
  background: transparent;
  z-index: 10;
  border-radius: 8px !important;
}

.resize-handle-nw, .resize-handle-ne, .resize-handle-sw, .resize-handle-se {
  width: 12px;
  height: 12px;
  z-index: 20;
  border-radius: 8px !important;
}

.resize-handle-n, .resize-handle-s {
  height: 12px;
  left: 12px;
  right: 12px;
  cursor: ns-resize;
  border-radius: 8px !important;
}

.resize-handle-w, .resize-handle-e {
  width: 12px;
  top: 12px;
  bottom: 12px;
  cursor: ew-resize;
  border-radius: 8px !important;
}

.resize-handle-nw { top: 0; left: 0; cursor: nwse-resize; }
.resize-handle-n { top: 0; cursor: ns-resize; }
.resize-handle-ne { top: 0; right: 0; cursor: nesw-resize; }
.resize-handle-e { right: 0; cursor: ew-resize; }
.resize-handle-se { bottom: 0; right: 0; cursor: nwse-resize; }
.resize-handle-s { bottom: 0; cursor: ns-resize; }
.resize-handle-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.resize-handle-w { left: 0; cursor: ew-resize; }

.power-menu-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background-color: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 9999;
  max-width: 400px;
  width: 90%;
  border-radius: 8px !important;
}

.power-menu-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
  z-index: 99999;
}

.power-menu-content {
  text-align: center;
  z-index: 99998;
  border-radius: 8px !important;
}

.power-menu-content p {
  margin-bottom: 16px;
  z-index: 99997;
  border-radius: 8px !important;
}

.power-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 99996;
  border-radius: 8px !important;
}

.power-option {
  width: 100%;
  text-align: center;
  padding: 10px 12px;
  border: none;
  background-color: rgba(0, 0, 0, 0.05);
  font-size: 14px;
  border-radius: 8px !important;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99995;
}

.power-option:hover {
  background-color: rgba(0, 0, 0, 0.1);
  z-index: 99994;
  border-radius: 8px !important;
}

.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  z-index: 9999999;
  transition: opacity 0.5s ease;
  border-radius: 8px !important;
}

.splash-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('on.png');
  background-size: cover;
  background-position: center;
  border-radius: 8px !important;
}

.splash-loading {
  position: relative;
  margin-top: auto;
  margin-bottom: 20%;
  border-radius: 8px !important;
}

.splash-loading img {
  width: 40px;
  height: 40px;
  border-radius: 8px !important;
}

.splash-screen.fade-out {
  opacity: 0;
}

.power-option svg {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 8px !important;
}

.calendar-popup {
  position: absolute;
  bottom: 72px;
  right: 16px;
  background-color: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 9999;
  border-radius: 8px !important;
}

.calendar-popup.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.calendar-content {
  padding: 12px;
  min-width: 240px;
  border-radius: 8px !important;
}

.power-confirm-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background-color: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 99999 !important;
  max-width: 400px;
  width: 90%;
  border-radius: 8px !important;
}

.power-confirm-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.power-confirm-content {
  text-align: center;
  border-radius: 8px !important;
}

.power-confirm-content p {
  margin-bottom: 16px;
  border-radius: 8px !important;
}

.power-confirm-content button {
  margin: 0 8px;
  padding: 8px 16px;
  border: none;
  background-color: rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  min-width: 80px;
  border-radius: 8px !important;
}

.power-confirm-content button:hover {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 8px !important;
}

.blur-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(0px);
  background: rgba(0, 0, 0, 0);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: backdrop-filter 0.2s ease, 
              background 0.2s ease,
              opacity 0.2s ease;
  border-radius: 8px !important;
}

.blur-overlay.active {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: rgba(0, 0, 0, 0.1);
  opacity: 1;
  pointer-events: auto;
  border-radius: 8px !important;
  z-index: 100000;
}

.resize-handle {
  position: absolute;
  background: transparent;
  z-index: 10;
  border-radius: 8px !important;
}

.resize-handle-nw, .resize-handle-ne, .resize-handle-sw, .resize-handle-se {
  width: 12px;
  height: 12px;
  z-index: 20;
  border-radius: 8px !important;
}

.resize-handle-n, .resize-handle-s {
  height: 12px;
  left: 12px;
  right: 12px;
  cursor: ns-resize;
  border-radius: 8px !important;
}

.resize-handle-w, .resize-handle-e {
  width: 12px;
  top: 12px;
  bottom: 12px;
  cursor: ew-resize;
  border-radius: 8px !important;
}

.resize-handle-nw { top: 0; left: 0; cursor: nwse-resize; }
.resize-handle-n { top: 0; cursor: ns-resize; }
.resize-handle-ne { top: 0; right: 0; cursor: nesw-resize; }
.resize-handle-e { right: 0; cursor: ew-resize; }
.resize-handle-se { bottom: 0; right: 0; cursor: nwse-resize; }
.resize-handle-s { bottom: 0; cursor: ns-resize; }
.resize-handle-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.resize-handle-w { left: 0; cursor: ew-resize; }

.power-menu-popup,
.calendar-popup,
.power-confirm-popup {
  z-index: 11000 !important;
  border-radius: 8px !important;
}

.svg-icon {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  display: inline-block;
}

.start-button .svg-icon {
  font-size: 32px;
  color: #0078D4;
  fill: #0078D4;
  stroke: none;
}

.datetime .svg-icon {
  font-size: 20px;
  margin-right: 4px;
  color: #0078D4;
  stroke: none;
  fill: #0078D4;
}

.power-option .svg-icon {
  font-size: 20px;
  color: #0078D4;
}

.power-confirm-content .svg-icon {
  font-size: 18px;
  margin-right: 2px;
  color: #0078D4;
}