/* =============================================================
   Win11 Desktop Mode — Windows 11 桌面风格
   ============================================================= */

/* ---- Win11 Shell ---- */
.win11-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.win11-shell.on { pointer-events: auto; }

/* hide original chrome when win11 is on */
.win11-on .topbar,
.win11-on .subbar,
.win11-on .main > .cover,
.win11-on .main > .taskbar,
.win11-on .main > .layer-switch { display: none !important; }

.win11-on .main { background: none !important; }
.win11-on .main > .content { display: none !important; }
.win11-on .main > .desktop-icons { display: none !important; }

/* ---- Desktop ---- */
.win11-desktop {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.win11-desktop::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
  pointer-events: none;
}
.win11-desk-icons {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  max-height: calc(100% - 4rem);
}
.win11-desk-icon {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: all 0.12s;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  width: 13rem;
  pointer-events: auto;
  user-select: none;
}
.win11-desk-icon:hover { background: rgba(255,255,255,0.1); }
.win11-desk-icon:active { background: rgba(255,255,255,0.18); }
.win11-desk-icon-img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.0625rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.win11-desk-icon-label {
  font-size: 0.8125rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* ---- Taskbar ---- */
.win11-taskbar {
  height: 3rem;
  background: rgba(245,245,245,0.7);
  backdrop-filter: blur(60px) saturate(180%);
  -webkit-backdrop-filter: blur(60px) saturate(180%);
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  pointer-events: auto;
}
.win11-taskbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.125rem;
}
.win11-tb-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  border-radius: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 1rem;
  transition: all 0.12s;
  position: relative;
}
.win11-tb-btn:hover { background: rgba(0,0,0,0.06); }
.win11-tb-btn:active { background: rgba(0,0,0,0.1); transform:scale(0.92); }
.win11-tb-btn .tb-indicator {
  position: absolute;
  bottom: 0.1875rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0.5rem;
  height: 0.125rem;
  border-radius: 0.0625rem;
  background: rgba(0,0,0,0.35);
  transition: width 0.2s;
}
.win11-tb-btn .tb-indicator.active {
  width: 1rem;
  background: #005fb8;
}
.win11-tb-btn.tb-active { background: rgba(0,0,0,0.08); }
/* System tray */
.win11-tray {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  margin-left: auto;
  height: 100%;
}
.win11-tray-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  border-radius: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 0.8125rem;
  transition: all 0.12s;
}
.win11-tray-btn:hover { background: rgba(0,0,0,0.05); }
.win11-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0 0.375rem 0 0.5rem;
  cursor: pointer;
  border-radius: 0.25rem;
  line-height: 1.15;
  transition: all 0.12s;
  height: 2.5rem;
  justify-content: center;
}
.win11-clock:hover { background: rgba(0,0,0,0.05); }
.win11-clock-time { font-weight: 600; font-size: 0.75rem; color: #333; }
.win11-clock-date { font-size: 0.625rem; color: #666; }

/* ---- Start Menu ---- */
.win11-start-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0,0,0,0.15);
}
.win11-start-menu {
  position: fixed;
  bottom: 3.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 32rem;
  max-width: calc(100vw - 1rem);
  max-height: 30rem;
  background: rgba(242,242,242,0.75);
  backdrop-filter: blur(60px) saturate(180%);
  -webkit-backdrop-filter: blur(60px) saturate(180%);
  border-radius: 0.5rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
  z-index: 151;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: w11startIn 0.2s cubic-bezier(0.22,1,0.36,1);
}
@keyframes w11startIn {
  from { opacity: 0; transform: translateX(-50%) translateY(1rem); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.win11-start-search {
  padding: 0.75rem 1rem 0.375rem;
}
.win11-start-search input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  outline: none;
  background: rgba(255,255,255,0.5);
  font-family: inherit;
  transition: 0.15s;
}
.win11-start-search input:focus {
  border-color: #005fb8;
  box-shadow: 0 0 0 2px rgba(0,95,184,0.12);
}
.win11-start-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.75rem 0.5rem;
}
.win11-start-section-title {
  font-size: 0.75rem;
  color: #666;
  font-weight: 600;
  padding: 0.625rem 0.25rem 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.win11-start-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.1s;
  font-size: 0.875rem;
  color: #333;
}
.win11-start-item:hover { background: rgba(0,0,0,0.05); }
.win11-start-item-icon {
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
  flex-shrink: 0;
}
.win11-start-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.05);
}
.win11-start-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
  color: #333;
}
.win11-start-user:hover { background: rgba(0,0,0,0.05); }
.win11-start-user-avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--primary, #166534);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 600;
  flex-shrink: 0;
}
.win11-start-power {
  display: flex;
  gap: 0.0625rem;
}
.win11-start-power button {
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  border-radius: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 0.875rem;
  transition: 0.12s;
}
.win11-start-power button:hover { background: rgba(0,0,0,0.06); }

/* ---- Win11 Window ---- */
.win11-window {
  position: absolute;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: rgba(245,247,250,0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 0.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
  overflow: hidden;
  pointer-events: auto;
}
.win11-window.maximized { border-radius: 0; }
.win11-window.minimized { display: none; }
.win11-win-hd {
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  height: 2rem;
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
}
.win11-win-hd:active { cursor: grabbing; }
.win11-win-title {
  font-size: 0.75rem;
  color: #333;
  font-weight: 500;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0.5rem;
}
.win11-win-controls {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}
.win11-win-btn {
  width: 1.625rem;
  height: 1.625rem;
  border: none;
  background: transparent;
  border-radius: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 0.625rem;
  transition: 0.12s;
}
.win11-win-btn:hover { background: rgba(0,0,0,0.06); }
.win11-win-btn.close:hover { background: #e81123; color: #fff; }
.win11-win-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Win11 window state for restored content */
.win11-on .content {
  display: none !important;
}

/* ---- Search Panel ---- */
.win11-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  padding-top: 1.5rem;
}
.win11-search-panel {
  width: 34rem;
  max-width: calc(100vw - 1rem);
  max-height: 70vh;
  background: rgba(242,242,242,0.75);
  backdrop-filter: blur(60px) saturate(180%);
  -webkit-backdrop-filter: blur(60px) saturate(180%);
  border-radius: 0.5rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: w11startIn 0.15s ease;
}
.win11-search-panel input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 1rem;
  outline: none;
  background: transparent;
  font-family: inherit;
}
.win11-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 0.375rem;
}
.win11-search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: 0.1s;
  font-size: 0.875rem;
  color: #333;
}
.win11-search-item:hover { background: rgba(0,0,0,0.05); }

/* ---- Widgets Panel ---- */
.win11-widgets {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 24rem;
  max-width: 90vw;
  background: rgba(242,242,242,0.75);
  backdrop-filter: blur(60px) saturate(180%);
  -webkit-backdrop-filter: blur(60px) saturate(180%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  animation: w11slideLeft 0.2s ease;
  border-right: 1px solid rgba(0,0,0,0.06);
  box-shadow: 4px 0 24px rgba(0,0,0,0.08);
}
@keyframes w11slideLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
.win11-widgets-hd {
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.win11-widgets-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* ---- Settings toggle in style panel ---- */
.win11-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 0.5rem;
}
.win11-toggle-wrap label {
  font-size: 0.875rem;
  color: var(--text-secondary,#555);
  font-weight: 500;
}
.win11-toggle {
  position: relative;
  width: 2.5rem;
  height: 1.375rem;
  background: #ccc;
  border-radius: 0.6875rem;
  cursor: pointer;
  transition: 0.2s;
  border: none;
  padding: 0;
}
.win11-toggle.on { background: var(--primary, #166534); }
.win11-toggle::after {
  content: '';
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.win11-toggle.on::after { left: 1.25rem; }

/* =============================================================
   Win11 Login Screen — 全屏平面 Windows 11 登录界面
   ============================================================= */

.win11-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  animation: w11loginFadeIn 0.25s ease;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}
@keyframes w11loginFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Dim — lets wallpaper show through */
.win11-login-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ---- Content (vertically centered) ---- */
.win11-login-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  max-width: 22rem;
  padding: 4rem 1rem;
  animation: w11loginContentIn 0.35s ease;
}
@keyframes w11loginContentIn {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Time ---- */
.win11-login-time {
  text-align: center;
  color: #fff;
  pointer-events: none;
  margin-bottom: 1.75rem;
}
.win11-login-time-clock {
  font-size: 4.5rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: 6px;
}
.win11-login-time-date {
  font-size: 1rem;
  font-weight: 350;
  margin-top: 0.5rem;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

/* ---- Avatar ---- */
.win11-login-avatar-wrap {
  margin-bottom: 1.5rem;
}
.win11-login-avatar {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.2);
}
.win11-login-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.win11-login-avatar i {
  font-size: 2rem;
  color: rgba(255,255,255,0.7);
}

/* ---- Form (flat, no card) ---- */
.win11-login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.win11-login-form input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #fff;
  outline: none;
  transition: border 0.15s;
  box-sizing: border-box;
}
.win11-login-form input::placeholder {
  color: rgba(255,255,255,0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}
.win11-login-form input:focus {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.14);
}

.win11-login-error {
  font-size: 0.8125rem;
  color: #ff6b6b;
  text-align: center;
  min-height: 1.25rem;
  line-height: 1.25rem;
}

.win11-login-btn {
  width: 100%;
  padding: 0.625rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 0.375rem;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 4px;
}
.win11-login-btn:hover {
  background: rgba(255,255,255,0.18);
}
.win11-login-btn:active {
  background: rgba(255,255,255,0.22);
}

/* ---- Links ---- */
.win11-login-links {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.4);
}
.win11-login-links span {
  cursor: pointer;
  transition: color 0.15s;
}
.win11-login-links span:hover {
  color: rgba(255,255,255,0.85);
}
.win11-login-dot {
  opacity: 0.35;
  cursor: default !important;
}

/* ---- Footer ---- */
.win11-login-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  box-sizing: border-box;
}
.win11-login-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  color: rgba(255,255,255,0.55);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.12s;
}
.win11-login-footer-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.win11-login-footer-btn:active {
  background: rgba(255,255,255,0.15);
}
.win11-login-footer-right {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}
.win11-login-footer-right .win11-login-footer-btn {
  width: auto;
  padding: 0 0.625rem;
  gap: 0.25rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .win11-login-time-clock {
    font-size: 3.5rem;
    letter-spacing: 4px;
  }
  .win11-login-content {
    max-width: 20rem;
  }
}
@media (max-width: 480px) {
  .win11-login-time-clock {
    font-size: 2.5rem;
    letter-spacing: 2px;
  }
  .win11-login-time-date {
    font-size: 0.875rem;
  }
  .win11-login-content {
    max-width: 100%;
    padding: 2rem 1.25rem;
  }
  .win11-login-footer-right .win11-login-footer-btn span {
    display: none;
  }
}
@media (max-height: 520px) {
  .win11-login-time {
    display: none;
  }
  .win11-login-avatar-wrap {
    margin-bottom: 0.75rem;
  }
  .win11-login-avatar {
    width: 3rem;
    height: 3rem;
  }
  .win11-login-avatar i {
    font-size: 1.5rem;
  }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .win11-window {
    left: 0.5rem !important;
    right: 0.5rem !important;
    top: 1rem !important;
    bottom: 3.25rem !important;
    width: auto !important;
    height: auto !important;
  }
  .win11-window.maximized {
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 2.75rem !important;
  }
  .win11-taskbar { height: 2.75rem; padding: 0 0.375rem; }
  .win11-tb-btn { width: 2.25rem; height: 2.25rem; font-size: 0.875rem; }
  .win11-start-menu { width: calc(100vw - 0.5rem); max-height: 70vh; bottom: 3rem; }
  .win11-desk-icon { width: 11rem; }
  .win11-clock .win11-clock-date { display: none; }
}
@media (max-width: 480px) {
  .win11-desk-icons { top: 0.25rem; left: 0.25rem; gap: 0.125rem; padding: 0.25rem; }
  .win11-desk-icon { width: auto; flex-direction: column; gap: 0.125rem; padding: 0.3125rem; }
  .win11-desk-icon-img { width: 2rem; height: 2rem; font-size: 0.875rem; }
  .win11-desk-icon-label { font-size: 0.625rem; text-align: center; }
  .win11-start-menu { bottom: 3rem; max-height: 75vh; }
  .win11-start-section-title { font-size: 0.6875rem; }
  .win11-start-item { font-size: 0.8125rem; padding: 0.375rem 0.625rem; }
}
