:root {
  color-scheme: light dark;
  --page: #eef3f8;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --text: #10213d;
  --muted: #63728a;
  --line: rgba(124, 145, 171, 0.24);
  --accent: #145fc0;
  --accent-hover: #0e4c9c;
  --shadow: 0 18px 48px rgba(32, 63, 99, 0.10);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

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

.navigation-header {
  min-height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--surface-strong);
  border-bottom: 1px solid var(--line);
}

.navigation-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.navigation-brand strong {
  color: var(--accent);
  font-size: 25px;
  letter-spacing: -0.04em;
}

.navigation-brand span {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.console-button {
  min-height: 38px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(20, 95, 192, 0.28);
  border-radius: 9px;
  color: var(--accent);
  background: rgba(20, 95, 192, 0.06);
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.console-button:hover,
.console-button:focus-visible {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.navigation-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navigation-actions form { margin: 0; }

.navigation-user {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigation-logout {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.navigation-logout:hover,
.navigation-logout:focus-visible { color: var(--text); }

.navigation-hero {
  min-height: 246px;
  padding: 30px 28px 38px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(238, 246, 253, 0.18), rgba(238, 243, 248, 0.56)),
    url("/static/navigation-mountains.png") center 53% / cover no-repeat;
}

.hero-content {
  width: min(860px, 100%);
  display: grid;
  gap: 24px;
  text-align: center;
}

.hero-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.hero-content h1 {
  margin: 0;
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.search-box {
  width: min(760px, 100%);
  min-height: 58px;
  margin: 0 auto;
  padding: 7px 10px 7px 17px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.search-label {
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #10213d;
  font: inherit;
}

.search-box input::placeholder { color: #76869d; opacity: 1; }

.search-box:focus-within {
  border-color: rgba(20, 95, 192, 0.58);
  box-shadow: 0 0 0 3px rgba(20, 95, 192, 0.13), var(--shadow);
}

.search-box kbd {
  padding: 5px 8px;
  border: 1px solid rgba(113, 133, 159, 0.24);
  border-radius: 7px;
  background: rgba(238, 243, 248, 0.82);
  color: #53647c;
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.application-section {
  width: min(1480px, calc(100% - 40px));
  margin: -18px auto 0;
  padding: 24px 0 44px;
  position: relative;
}

.section-heading {
  min-height: 36px;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading span { color: var(--muted); font-size: 13px; }

.application-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
  gap: 12px;
}

.application-card {
  position: relative;
  min-height: 98px;
  padding: 15px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(124, 145, 171, 0.18);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 4px 18px rgba(32, 63, 99, 0.04);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.application-status {
  position: absolute;
  top: 10px;
  right: 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.application-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8290a3;
  content: "";
}

.application-status.is-online { color: #087a50; }
.application-status.is-online::before { background: #0ba86c; }
.application-status.is-offline { color: #ad3f3f; }
.application-status.is-offline::before { background: #d74b4b; }

.application-card:hover,
.application-card:focus-visible {
  border-color: rgba(20, 95, 192, 0.38);
  box-shadow: 0 13px 32px rgba(32, 63, 99, 0.12);
  transform: translateY(-2px);
  outline: none;
}

.application-card[hidden] { display: none; }

.application-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.tone-1 { background: #1769d2; }
.tone-2 { background: #168b98; }
.tone-3 { background: #466fd5; }
.tone-4 { background: #287ba6; }
.tone-5 { background: #6a51c7; }
.tone-6 { background: #3f718b; }

.application-copy { min-width: 0; padding-right: 48px; display: grid; gap: 3px; }
.application-copy strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.application-copy span,
.application-copy small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.application-copy span { font-size: 13px; }
.application-copy small { font-size: 11px; opacity: 0.78; }

.navigation-empty {
  grid-column: 1 / -1;
  min-height: 160px;
  padding: 32px;
  display: grid;
  place-content: center;
  gap: 7px;
  text-align: center;
  color: var(--muted);
}

.navigation-empty strong { color: var(--text); }
.search-empty { margin-top: 10px; }
.navigation-footer { padding: 18px 24px 28px; color: var(--muted); font-size: 12px; text-align: center; }

.welcome-main {
  min-height: calc(100dvh - 112px);
  padding: 52px 24px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(238, 246, 253, 0.12), rgba(238, 243, 248, 0.72)),
    url("/static/navigation-mountains.png") center / cover no-repeat;
}

.welcome-panel {
  width: min(620px, 100%);
  padding: clamp(34px, 6vw, 64px);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.welcome-panel h1 {
  margin: 0;
  color: #10213d;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.14;
  letter-spacing: -0.04em;
}

.welcome-panel > p:not(.hero-kicker) {
  margin: 16px 0 0;
  color: #5f7087;
  font-size: 16px;
}

.welcome-actions {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.welcome-primary {
  min-height: 44px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 700;
}

.welcome-primary { background: #145fc0; color: #ffffff; }
.welcome-primary:hover,
.welcome-primary:focus-visible { background: #0e4c9c; }

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e1725;
    --surface: rgba(20, 33, 51, 0.94);
    --surface-strong: #121d2d;
    --text: #edf4ff;
    --muted: #9cacbf;
    --line: rgba(164, 184, 207, 0.18);
    --accent: #78aef5;
    --accent-hover: #9bc3f8;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  }

  .navigation-hero {
    background:
      linear-gradient(180deg, rgba(14, 23, 37, 0.36), rgba(14, 23, 37, 0.82)),
      url("/static/navigation-mountains.png") center 53% / cover no-repeat;
  }

  .search-box { border-color: rgba(255, 255, 255, 0.18); background: rgba(243, 247, 252, 0.92); }
  .application-status.is-online { color: #61d5a4; }
  .application-status.is-offline { color: #ff8e8e; }
  .welcome-main {
    background:
      linear-gradient(180deg, rgba(14, 23, 37, 0.3), rgba(14, 23, 37, 0.82)),
      url("/static/navigation-mountains.png") center / cover no-repeat;
  }
  .welcome-panel {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(18, 29, 45, 0.88);
  }
  .welcome-panel h1 { color: var(--text); }
  .welcome-panel > p:not(.hero-kicker) { color: var(--muted); }
}

@media (max-width: 720px) {
  .navigation-header { min-height: 58px; padding: 0 16px; }
  .navigation-brand span { display: none; }
  .navigation-brand strong { font-size: 22px; }
  .console-button { min-height: 36px; padding: 0 14px; }
  .navigation-user { display: none; }
  .navigation-actions { gap: 3px; }
  .navigation-hero { min-height: 220px; padding: 26px 16px 38px; }
  .hero-content { gap: 21px; }
  .search-box { min-height: 54px; padding-left: 14px; }
  .search-box kbd { display: none; }
  .application-section { width: min(100% - 24px, 1480px); padding-bottom: 28px; }
  .application-grid { grid-template-columns: 1fr; }
  .application-card { min-height: 88px; }
  .welcome-main { min-height: calc(100dvh - 100px); padding: 24px 14px; }
  .welcome-panel { padding: 36px 20px; }
  .welcome-actions { align-items: stretch; flex-direction: column; }
  .welcome-primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .console-button,
  .application-card { transition: none; }
  .application-card:hover,
  .application-card:focus-visible { transform: none; }
}
