:root {
  color-scheme: dark;
  --bg: #081019;
  --desktop: #0b1420;
  --window: rgba(16, 25, 35, 0.82);
  --window-solid: #111b27;
  --glass: rgba(255, 255, 255, 0.08);
  --ink: #f7efe2;
  --muted: #aab7b8;
  --quiet: #728188;
  --line: rgba(247, 239, 226, 0.16);
  --gold: #f4c95d;
  --aqua: #76d7c4;
  --coral: #df775c;
  --ok: #79d98d;
  --shadow: rgba(0, 0, 0, 0.32);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1ec;
  --desktop: #e8eee9;
  --window: rgba(255, 252, 244, 0.86);
  --window-solid: #fffaf0;
  --glass: rgba(20, 30, 42, 0.06);
  --ink: #15181b;
  --muted: #4e5d61;
  --quiet: #748087;
  --line: rgba(21, 24, 27, 0.14);
  --shadow: rgba(69, 57, 37, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.desktop {
  position: relative;
  min-height: 100vh;
  padding: 86px clamp(16px, 3.6vw, 48px) 110px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(118, 215, 196, 0.2), transparent 26%),
    radial-gradient(circle at 76% 18%, rgba(244, 201, 93, 0.16), transparent 22%),
    linear-gradient(135deg, var(--desktop), var(--bg));
}

.desktop-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 0 clamp(16px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}

.brand-mark,
.icon-glyph {
  display: grid;
  place-items: center;
  border: 1px solid rgba(118, 215, 196, 0.42);
  background: rgba(118, 215, 196, 0.1);
  color: var(--aqua);
  font-weight: 900;
}

.brand-mark {
  width: 36px;
  height: 36px;
}

.brand span:last-child {
  display: grid;
  gap: 1px;
}

.brand small,
.workspace-nav,
.status-pill,
.desktop-icon small,
.window-state,
.kicker,
.metric span,
.metric small,
.dock-item {
  color: var(--quiet);
  font-size: 0.82rem;
  letter-spacing: 0;
}

.workspace-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--glass);
}

.workspace-nav a {
  min-height: 34px;
  padding: 7px 12px;
}

.workspace-nav a:hover,
.workspace-nav a.is-active {
  color: var(--ink);
  background: rgba(118, 215, 196, 0.13);
}

.menubar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 210px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 18px rgba(121, 217, 141, 0.55);
}

.theme-btn,
.lang-switch {
  display: grid;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
}

.theme-btn {
  width: 36px;
  place-items: center;
}

.theme-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.lang-switch {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
}

.lang-switch button {
  min-width: 38px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--quiet);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
}

.lang-switch button:first-child {
  border-left: 0;
}

.lang-switch button:hover,
.lang-switch button.is-active {
  color: var(--ink);
  background: rgba(118, 215, 196, 0.14);
}

.desktop-grid {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(190px, 44vw);
  gap: 14px;
}

.desktop-icon {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 62px;
  padding: 9px;
  border: 1px solid transparent;
}

.desktop-icon:hover,
.desktop-icon.is-selected {
  border-color: rgba(118, 215, 196, 0.26);
  background: rgba(118, 215, 196, 0.08);
}

.icon-glyph {
  width: 46px;
  height: 46px;
}

.desktop-icon strong,
.desktop-icon small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window {
  position: relative;
  z-index: 2;
  border: 1px solid var(--line);
  background: var(--window);
  box-shadow: 0 24px 90px var(--shadow);
  backdrop-filter: blur(20px);
}

.primary-window {
  width: min(980px, calc(100vw - 270px));
  min-height: 470px;
  margin: -246px 0 0 min(230px, 20vw);
}

.secondary-window {
  width: min(610px, 46vw);
  margin: 24px 0 0 min(250px, 22vw);
}

.right-window {
  width: min(520px, 38vw);
  margin: -330px 0 0 auto;
}

.terminal-window {
  width: min(820px, calc(100vw - 72px));
  margin: 34px auto 0;
}

.window-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--window-solid) 78%, transparent);
}

.traffic {
  display: inline-flex;
  gap: 6px;
}

.traffic span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.traffic span:nth-child(1) {
  background: #df775c;
}

.traffic span:nth-child(2) {
  background: #f4c95d;
}

.traffic span:nth-child(3) {
  background: #79d98d;
}

.window-title {
  font-size: 0.88rem;
  font-weight: 800;
}

.window-state {
  margin-left: auto;
}

.window-content {
  padding: clamp(20px, 4vw, 38px);
}

.cloudedisk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: clamp(20px, 4vw, 40px);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--aqua);
  font-weight: 900;
  text-transform: uppercase;
}

.kicker span {
  width: 34px;
  height: 1px;
  background: var(--aqua);
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2 {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 5.8rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}

.module-hero p,
.window-content > p,
.boundary-list p,
.terminal-content p {
  color: var(--muted);
}

.module-hero > p {
  max-width: 720px;
  margin: 22px 0 0;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--line);
  font-weight: 900;
}

.btn-primary {
  color: #14110a;
  background: var(--gold);
  border-color: var(--gold);
}

.btn-ghost {
  background: var(--glass);
}

.module-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--window-solid) 74%, transparent);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 8px;
}

.pipeline {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.pipeline div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.pipeline span,
.boundary-list strong {
  color: var(--gold);
  font-weight: 900;
}

.pipeline p {
  margin: 0;
}

.boundary-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.boundary-list article {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--glass);
}

.boundary-list p {
  margin: 8px 0 0;
}

.terminal-content pre {
  margin: 22px 0 0;
  overflow-x: auto;
  padding: 18px;
  border: 1px solid rgba(118, 215, 196, 0.28);
  background: rgba(0, 0, 0, 0.25);
}

code {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.94rem;
  color: var(--ink);
  white-space: pre-wrap;
}

.dock {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 40;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
  padding: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px var(--shadow);
}

.dock-item {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid transparent;
  font-weight: 800;
}

.dock-item:hover,
.dock-item.is-live {
  color: var(--ink);
  border-color: rgba(118, 215, 196, 0.28);
  background: rgba(118, 215, 196, 0.1);
}

@media (max-width: 1080px) {
  .desktop {
    padding-bottom: 136px;
  }

  .desktop-grid {
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .desktop-icon {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .primary-window,
  .secondary-window,
  .right-window,
  .terminal-window {
    width: 100%;
    margin: 18px 0 0;
  }

  .right-window {
    margin-top: 18px;
  }
}

@media (max-width: 760px) {
  .menubar {
    align-items: flex-start;
    min-height: auto;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .brand,
  .menubar-right {
    min-width: 0;
  }

  .menubar-right {
    gap: 8px;
  }

  .workspace-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .status-pill {
    display: none;
  }

  .desktop {
    padding-top: 126px;
  }

  .desktop-grid,
  .cloudedisk-layout {
    grid-template-columns: 1fr;
  }

  .desktop-icon {
    min-height: 58px;
  }

  .window-state {
    display: none;
  }

  .module-actions,
  .dock {
    width: calc(100% - 24px);
  }

  .module-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .dock {
    overflow-x: auto;
    justify-content: flex-start;
  }
}
