:root {
  --taskbar-h: 62px;
  --desktop-pad: 18px;
  --text: #f4f8ff;
  --muted: rgba(244, 248, 255, 0.72);
  --glass: rgba(14, 20, 32, 0.55);
  --glass-strong: rgba(20, 28, 43, 0.75);
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(17, 27, 46, 0.08);
  --panel: rgba(248, 251, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.97);
  --panel-text: #182235;
  --accent: #75d5ff;
  --accent-2: #2f8cff;
  --danger: #cb4747;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.22);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  font-family: "Segoe UI Variable", "Segoe UI", Inter, Roboto, Arial, sans-serif;
  color: var(--text);
  overflow: hidden;
  background:
    linear-gradient(rgba(8, 16, 28, 0.18), rgba(7, 13, 25, 0.36)),
    url("assets/images/misc/wallpaper.jpg") center/cover no-repeat fixed;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: #0a63c9; }
[hidden] { display: none !important; }

.desktop-shell { position: relative; width: 100%; height: 100%; }
.desktop {
  position: absolute;
  inset: 0 0 calc(var(--taskbar-h) + 12px) 0;
  padding: var(--desktop-pad);
  overflow: hidden;
}
.desktop-selection-layer { position: absolute; inset: 0; pointer-events: none; }

.desktop-icon {
  position: absolute;
  width: 92px;
  min-height: 88px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  color: var(--text);
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  user-select: none;
}

.desktop-icon:hover,
.desktop-icon:focus-visible,
.desktop-icon.selected {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.16);
  outline: none;
}

.desktop-icon-image {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
}

.desktop-icon-label { font-size: .82rem; line-height: 1.25; }

.taskbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  height: var(--taskbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.15);
  z-index: 2000;
}

.taskbar-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.taskbar-primary {
  justify-content: flex-start;
  flex: 1 1 auto;
  min-width: 0;
}

.taskbar-secondary { flex: 0 0 auto; }

.taskbar-apps {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  max-width: min(62vw, 980px);
}
.taskbar-apps::-webkit-scrollbar { display: none; }

.taskbar-app,
.system-button,
.toolbar-button,
.ghost-button,
.link-list button,
.start-tile,
.recommended-item,
.context-item {
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.taskbar-app,
.system-button {
  height: 42px;
  min-width: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.taskbar-app:hover,
.system-button:hover,
.taskbar-app.active,
.toolbar-button:hover,
.ghost-button:hover,
.link-list button:hover,
.start-tile:hover,
.recommended-item:hover,
.context-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.taskbar-app { position: relative; }
.taskbar-app.open::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateX(-50%);
}

.taskbar-app img { width: 18px; height: 18px; }
.taskbar-label {
  font-size: .83rem;
  max-width: 116px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.start-button { width: 48px; padding: 0; }
.win-logo {
  width: 16px; height: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.win-logo span { background: linear-gradient(180deg, #b7e8ff, #64baff); border-radius: 1px; }
.clock { padding: 0 8px; text-align: right; font-size: .85rem; color: var(--muted); min-width: 120px; }

.start-menu {
  position: absolute;
  left: 18px;
  bottom: calc(var(--taskbar-h) + 24px);
  width: min(680px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 120px));
  overflow: auto;
  padding: 18px;
  border-radius: 24px;
  background: rgba(24, 32, 48, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(1.2);
  z-index: 2100;
}

.start-search-row { margin-bottom: 16px; }
.start-search {
  width: 100%; height: 46px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.12); color: var(--text); padding: 0 14px; outline: none;
}
.start-search::placeholder { color: rgba(244, 248, 255, 0.64); }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-title-row h2 { margin: 0; font-size: .98rem; }
.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08); color: var(--text);
  border-radius: 12px; padding: 8px 12px;
}
.pinned-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(106px, 1fr)); gap: 10px; }
.start-tile {
  min-height: 92px; border-radius: 16px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.09);
  color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 10px;
}
.start-tile img,.recommended-item img { width: 30px; height: 30px; }
.start-section { margin-top: 18px; }
.recommended-list { display: grid; gap: 10px; }
.recommended-item {
  width: 100%; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.08); color: var(--text); border-radius: 14px;
  padding: 12px 14px; text-align: left; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center;
}
.recommended-item strong, .start-tile strong { font-size: .9rem; }
.recommended-item small, .start-tile small, .muted { color: rgba(244, 248, 255, 0.68); }

.context-menu {
  position: fixed;
  min-width: 220px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(27, 35, 51, 0.92);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(1.15);
  z-index: 2600;
}
.context-item {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.context-item:disabled { opacity: .45; cursor: default; }
.context-item.danger { color: #ffd1d1; }
.context-separator { height: 1px; margin: 6px 2px; background: rgba(255,255,255,.1); }

.app-window {
  position: absolute;
  width: min(880px, calc(100vw - 120px));
  height: min(620px, calc(100vh - 160px));
  min-width: 420px;
  min-height: 280px;
  background: var(--panel-strong);
  color: var(--panel-text);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(17, 30, 54, 0.14);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.app-window.maximized { border-radius: 18px; }
.window-titlebar {
  height: 48px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 14px; background: rgba(247, 249, 253, 0.94); border-bottom: 1px solid var(--line-soft); cursor: move;
}
.window-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.window-icon { width: 16px; height: 16px; object-fit: contain; }
.window-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.window-actions { display: flex; align-items: stretch; gap: 2px; }
.window-action {
  width: 42px; border: 1px solid transparent; background: transparent; color: #314056;
  border-radius: 10px; font-size: 1rem;
}
.window-action:hover { background: rgba(24, 44, 80, .08); }
.window-action.danger:hover { background: #d93535; color: white; }
.window-toolbar {
  min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line-soft);
}
.toolbar-button {
  height: 34px; border-radius: 10px; border: 1px solid rgba(17,30,54,.1); background: white; color: var(--panel-text); padding: 0 12px;
  box-shadow: 0 4px 10px rgba(18, 30, 48, .05);
}
.address-label {
  margin-left: auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #5f6d82; font-size: .86rem;
}
.frame-hint {
  font-size: .78rem; color: #46637f; background: rgba(117, 213, 255, .15); border: 1px solid rgba(117, 213, 255, .18); padding: 6px 10px; border-radius: 999px;
}
.window-body {
  height: calc(100% - 48px - 46px - 32px); background: #f6f8fb;
}
.window-status {
  height: 32px; display: flex; align-items: center; padding: 0 14px; font-size: .79rem; color: #5f6d82; background: #f1f5fa; border-top: 1px solid var(--line-soft);
}
.window-resize-handle {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 0 40%, rgba(47, 140, 255, .25) 40% 55%, transparent 55% 100%);
}

.browser-frame { width: 100%; height: 100%; border: 0; background: white; }
.browser-warning, .app-content {
  width: 100%; height: 100%; padding: 22px; overflow: auto;
}
.notice-card, .card, .link-list button {
  border-radius: 18px; background: white; border: 1px solid rgba(17,30,54,.08); box-shadow: 0 10px 28px rgba(12, 26, 44, .06);
}
.notice-card { padding: 20px; }
.hero-card { background: linear-gradient(180deg, #ffffff, #f7fbff); }
.hero-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 16px; }
.card { padding: 18px; }
.card h3, .notice-card h2, .notice-card h3 { margin: 0 0 10px; color: #1b2940; }
.card p, .notice-card p { margin: 0; color: #53627a; line-height: 1.5; }
.link-list { display: grid; gap: 12px; }
.link-list button {
  width: 100%; padding: 16px 18px; text-align: left; border: 1px solid rgba(17,30,54,.08); background: white; color: #1b2940;
}
.notes-wrap { width: 100%; height: 100%; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.notes-wrap textarea {
  flex: 1 1 auto; width: 100%; resize: none; border-radius: 18px; border: 1px solid rgba(17,30,54,.12); background: white; padding: 16px; color: #1f2c42; outline: none;
}
.notes-wrap textarea:focus { border-color: rgba(47, 140, 255, .5); box-shadow: 0 0 0 3px rgba(47, 140, 255, .12); }
.notes-help { color: #66768d; font-size: .82rem; }

@media (max-width: 840px) {
  .taskbar-label { display: none; }
  .taskbar { gap: 6px; }
  .taskbar-apps { max-width: 48vw; }
  .start-menu { left: 12px; right: 12px; width: auto; }
}
