*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0c0c0c;
  --desktop: #0e1018;
  --win: #1c1c2a;
  --titlebar: #181824;
  --menubar: #1a1a28;
  --sidebar: #141420;
  --sidebar-active: rgba(90, 70, 200, 0.08);
  --panel: #111118;
  --accent: #6d5ace;
  --accent-light: #9b85f0;
  --green: #5af0b0;
  --cyan: #58cccc;
  --yellow: #d4b44a;
  --red: #c42b1c;
  --text: #bcbccc;
  --text-bright: #e0e0ee;
  --muted: #48485e;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.09);
  --font: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --taskbar-h: 40px;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

body {
  font-family: var(--font);
  color: var(--text);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

.desktop {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--taskbar-h));
  background: var(--desktop);
  overflow: hidden;
}

.desktop-icons {
  position: absolute;
  top: 16px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  padding: 6px 4px 5px;
  border-radius: 4px;
  cursor: default;
  user-select: none;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.05);
}

.ico {
  width: 32px;
  height: 32px;
  color: #8888a0;
  margin-bottom: 3px;
}

.desktop-icon span {
  font-size: 10px;
  color: #aaaabc;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  line-height: 1.2;
}

.window {
  position: absolute;
  top: 16px;
  left: 104px;
  right: 16px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  background: var(--win);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.2);
  animation: winIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes winIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: none; }
}

.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 0 0 10px;
  background: var(--titlebar);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  user-select: none;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.titlebar-ico {
  width: 10px;
  height: 10px;
  color: var(--accent);
}

.titlebar-text {
  font-size: 11px;
  color: var(--muted);
}

.titlebar-buttons {
  display: flex;
  height: 100%;
}

.tb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
}

.tb-btn svg {
  width: 10px;
  height: 10px;
}

.tb-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.tb-close:hover {
  background: var(--red);
  color: #fff;
}

.menubar {
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0 6px;
  background: var(--menubar);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.menubar span {
  font-size: 11px;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 3px;
  cursor: default;
}

.menubar span:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.window-content {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  width: 130px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 6px 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  cursor: pointer;
  position: relative;
}

.sb-item:hover {
  background: rgba(255, 255, 255, 0.025);
}

.sb-item.active {
  background: var(--sidebar-active);
}

.sb-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.sb-ico {
  width: 13px;
  height: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

.sb-item.active .sb-ico {
  color: var(--accent-light);
}

.sb-item span {
  font-size: 11.5px;
  color: var(--cyan);
}

.sb-item.active span {
  color: var(--accent-light);
}

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--panel);
}

.toolbar {
  display: flex;
  gap: 4px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tool-btn {
  font-family: var(--font);
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 10px;
  cursor: pointer;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.output {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  font-size: 12.5px;
  line-height: 1.65;
  min-height: 0;
}

.output::-webkit-scrollbar { width: 6px; }
.output::-webkit-scrollbar-track { background: transparent; }
.output::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.07); border-radius: 3px; }
.output::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.12); }

.boot {
  color: var(--muted);
  white-space: pre-wrap;
  margin-bottom: 6px;
  font-size: 12.5px;
}

.sec {
  display: none;
  animation: secIn 0.25s ease;
}

.sec.active {
  display: block;
}

@keyframes secIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.hl-title {
  color: var(--accent-light);
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.hl {
  color: var(--cyan);
}

.mod-table {
  border-collapse: collapse;
}

.mod-table td {
  padding: 2px 14px 2px 0;
  font-size: 12.5px;
  vertical-align: top;
}

.addr { color: var(--muted); }
.mname { color: var(--green); white-space: nowrap; }
.mdesc { color: var(--text); }

.mod-table tr { transition: background 0.12s; }
.mod-table tr:hover { background: rgba(255, 255, 255, 0.015); }

.proj-name {
  color: var(--yellow);
  font-weight: 500;
}

.input-row {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 18px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
}

.prompt {
  color: var(--accent);
  font-size: 12.5px;
  margin-right: 8px;
  flex-shrink: 0;
  user-select: none;
}

#cmdInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-bright);
  font-family: var(--font);
  font-size: 12.5px;
  caret-color: var(--accent-light);
}

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 0 10px;
  background: var(--accent);
  flex-shrink: 0;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.9);
}

.sb-left, .sb-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.sep { opacity: 0.3; }

.taskbar {
  height: var(--taskbar-h);
  background: #0a0a10;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  user-select: none;
}

.tb-left {
  display: flex;
  align-items: center;
  gap: 2px;
}

.start {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
}

.start:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tb-app {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text);
  padding: 5px 12px;
  border-radius: 4px;
  cursor: default;
  position: relative;
}

.tb-app.active {
  background: rgba(255, 255, 255, 0.05);
}

.tb-app.active::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.tb-app svg { color: var(--accent); }

.tb-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tray {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.clock {
  font-size: 10.5px;
  color: var(--text);
  text-align: right;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.25;
  white-space: pre-line;
  cursor: default;
}

.clock:hover {
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 680px) {
  .desktop-icons { display: none; }
  .window { top: 0; left: 0; right: 0; bottom: 0; border-radius: 0; }
  .sidebar { width: 90px; }
  .sb-item span { font-size: 10px; }
}

@media (max-width: 480px) {
  .sidebar { display: none; }
}
