:root {
  --win-glass: rgba(24, 28, 38, 0.82);
  --win-glass-solid: rgba(28, 32, 44, 0.96);
  --win-border: rgba(255, 255, 255, 0.14);
  --win-hover: rgba(255, 255, 255, 0.1);
  --win-text: #f8fafc;
  --win-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-orange: #f97316;
  --accent-purple: #a855f7;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1120;
  color: var(--win-text);
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}

#stage {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: default;
}

/* 顶部简洁测试模式切换胶囊 */
.control-dock {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--win-glass);
  border: 1px solid var(--win-border);
  border-radius: 12px;
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 20;
  flex-wrap: wrap;
  max-width: calc(100vw - 24px);
}

.dock-label {
  font-size: 11.5px;
  color: var(--win-muted);
  padding: 0 4px;
  font-weight: 600;
}

.dock-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dock-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 2px;
}

.pill-btn {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.pill-btn.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #082f49;
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.pill-btn.active[data-mode="recycle_bin"] {
  background: linear-gradient(135deg, #ea580c, #fb923c);
  color: #fff7ed;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}

.pill-btn.active[data-mode="hide_in_folder"] {
  background: linear-gradient(135deg, #7e22ce, #c084fc);
  color: #faf5ff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  font-size: 10.5px;
}

/* Windows 11 风格任务栏 */
.win-taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(20, 24, 34, 0.84);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(22px) saturate(150%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 12px;
  z-index: 25;
}

.tb-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #cbd5e1;
}

.tb-weather {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.tb-weather:hover {
  background: var(--win-hover);
}

.tb-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tb-app-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #f8fafc;
  font-size: 19px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.12s ease, transform 0.1s ease;
}

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

.tb-app-btn:active {
  transform: scale(0.92);
}

.tb-app-btn.running::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 14px;
  height: 3px;
  border-radius: 99px;
  background: #38bdf8;
}

.tb-search {
  height: 32px;
  padding: 0 12px;
  margin: 0 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tb-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.tray-pill {
  height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tray-pill:hover {
  background: var(--win-hover);
}

.tray-hoop-btn {
  background: rgba(249, 115, 22, 0.18);
  border: 1px solid rgba(249, 115, 22, 0.45);
  color: #fed7aa;
  font-weight: 600;
}

.tray-hoop-btn:hover {
  background: rgba(249, 115, 22, 0.32);
}

.tb-clock-box {
  text-align: right;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1.25;
  cursor: default;
}

.tb-clock-box:hover {
  background: var(--win-hover);
}

.tb-time {
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.tb-date {
  font-size: 11px;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}

/* Windows 风格右键菜单与托盘弹出菜单 */
.win-menu {
  position: fixed;
  min-width: 224px;
  padding: 6px;
  background: var(--win-glass-solid);
  border: 1px solid var(--win-border);
  border-radius: 10px;
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.58);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
}

.win-menu.open {
  display: flex;
}

.win-menu-item {
  border: none;
  background: transparent;
  color: #f1f5f9;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.win-menu-item:hover {
  background: rgba(56, 189, 248, 0.22);
}

.win-menu-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 6px;
}

/* 右侧物理调参抽屉 */
.tuner-panel {
  position: fixed;
  top: 66px;
  right: 14px;
  width: 276px;
  background: var(--win-glass-solid);
  border: 1px solid var(--win-border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
  z-index: 30;
  display: none;
  flex-direction: column;
  gap: 11px;
}

.tuner-panel.open {
  display: flex;
}

.tuner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 700;
}

.tuner-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #cbd5e1;
}

.tuner-row-top {
  display: flex;
  justify-content: space-between;
}

.tuner-row input[type="range"] {
  width: 100%;
  accent-color: #38bdf8;
}

/* Windows 11 文件资源管理器弹窗（回收站 / 隐藏文件夹） */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.42);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-backdrop.open {
  display: flex;
}

.explorer-window {
  width: min(560px, calc(100vw - 32px));
  max-height: 76vh;
  background: #191d28;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.explorer-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #131722;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.explorer-titlebar h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.explorer-pathbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  background: #1e2433;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  color: #94a3b8;
}

.explorer-body {
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.storage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.storage-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storage-emoji {
  font-size: 22px;
}

.storage-name {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
}

.storage-time {
  font-size: 11px;
  color: #94a3b8;
}

.folder-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.folder-input-row input {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 7px;
  color: #f8fafc;
  padding: 6px 10px;
  font-size: 12.5px;
  user-select: text;
  -webkit-user-select: text;
}

.empty-state {
  text-align: center;
  padding: 30px 12px;
  color: #64748b;
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #f8fafc;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 70;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
