:root {
  color-scheme: dark;
  --bg: #0d1017;
  --panel: #151a24;
  --panel-2: #1b2230;
  --text: #eef3fb;
  --muted: #9aa8ba;
  --line: #293244;
  --cyan: #4dd6d0;
  --green: #7de38b;
  --amber: #ffbf5f;
  --red: #ff6d79;
  --blue: #77a7ff;
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(77, 214, 208, 0.14), transparent 30rem),
    linear-gradient(135deg, #0d1017 0%, #111722 48%, #12151d 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

body.locked {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 18% 20%, rgba(77, 214, 208, 0.18), transparent 24rem),
    linear-gradient(135deg, rgba(13, 16, 23, 0.98), rgba(16, 21, 31, 0.98));
}

.login-screen.hidden {
  display: none;
}

.login-box {
  width: min(100%, 520px);
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 26, 36, 0.94);
  box-shadow: var(--shadow);
}

.login-box h1 {
  margin-top: 14px;
  font-size: clamp(34px, 7vw, 58px);
  overflow-wrap: anywhere;
}

.login-copy {
  margin: 16px 0 24px;
  color: #c3cedd;
  line-height: 1.7;
}

.login-box label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.password-row input {
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #0d121b;
  color: var(--text);
  font: inherit;
}

.password-row input:focus {
  border-color: rgba(77, 214, 208, 0.72);
  box-shadow: 0 0 0 3px rgba(77, 214, 208, 0.13);
}

.login-error {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--red);
  font-size: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
  padding: 0 clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 16, 23, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(77, 214, 208, 0.5);
  border-radius: 8px;
  background: #101d25;
  color: var(--cyan);
}

.nav {
  display: flex;
  gap: 24px;
}

.nav a,
.text-link {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover,
.text-link:hover {
  color: var(--text);
}

.ghost-button,
.primary-button,
.filter {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}

.ghost-button {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
}

.primary-button {
  padding: 13px 18px;
  border-color: rgba(77, 214, 208, 0.55);
  background: var(--cyan);
  color: #071113;
  font-weight: 800;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 1.14fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  min-height: calc(100vh - 72px);
  padding: 54px clamp(18px, 4vw, 56px) 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: clamp(58px, 10vw, 118px);
}

h2 {
  font-size: clamp(28px, 4vw, 42px);
}

.lede {
  max-width: 680px;
  margin: 22px 0 0;
  color: #c3cedd;
  font-size: clamp(17px, 2.2vw, 22px);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
}

.hero-visual {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0 clamp(18px, 4vw, 56px) 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  overflow: hidden;
}

.status-strip article {
  padding: 22px;
  background: rgba(21, 26, 36, 0.88);
}

.metric {
  display: block;
  color: var(--text);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 850;
}

.metric.warning {
  color: var(--amber);
}

.label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.panel-section,
.source-band {
  padding: 0 clamp(18px, 4vw, 56px) 76px;
}

.section-heading,
.source-band {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  min-height: 38px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
}

.filter.active {
  border-color: rgba(77, 214, 208, 0.5);
  background: rgba(77, 214, 208, 0.14);
  color: var(--cyan);
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.device-card {
  min-height: 214px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.card-top,
.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.vendor {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.device-card h3 {
  min-height: 58px;
  margin: 9px 0 20px;
  font-size: 22px;
  line-height: 1.3;
}

.status-pill {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.ok {
  background: rgba(125, 227, 139, 0.14);
  color: var(--green);
}

.status-pill.update {
  background: rgba(255, 191, 95, 0.14);
  color: var(--amber);
}

.status-pill.attention {
  background: rgba(255, 109, 121, 0.14);
  color: var(--red);
}

.version-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.version-row strong {
  color: var(--text);
}

.progress {
  width: 100%;
  height: 7px;
  margin-top: 14px;
  border-radius: 999px;
  background: #252d3c;
  overflow: hidden;
}

.progress span {
  display: block;
  width: var(--level);
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.source-band {
  align-items: center;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 660px;
}

.source-list span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #c9d4e4;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(24px);
  opacity: 0;
  padding: 14px 16px;
  border: 1px solid rgba(77, 214, 208, 0.42);
  border-radius: 8px;
  background: rgba(16, 25, 34, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: 180ms ease;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 900px) {
  .topbar {
    height: auto;
    min-height: 68px;
    flex-wrap: wrap;
    padding-block: 14px;
  }

  .nav {
    order: 3;
    width: 100%;
  }

  .hero,
  .device-grid,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .section-heading,
  .source-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-list {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .hero-actions,
  .filters,
  .password-row {
    align-items: stretch;
    flex-direction: column;
  }

  .password-row {
    display: flex;
  }

  .primary-button,
  .ghost-button,
  .filter {
    width: 100%;
  }

  .device-card h3 {
    min-height: auto;
  }
}
