:root {
  color-scheme: dark;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e9f7ff;
  background: #03060b;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #03060b;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: #03060b;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #03060b;
}

.scene-bg {
  position: absolute;
  inset: -2%;
  background:
    linear-gradient(90deg, rgba(3, 6, 11, 0.7) 0%, rgba(3, 6, 11, 0.18) 42%, #03060b 100%),
    url("./assets/deep-space-outpost.png") center / cover no-repeat;
  filter: saturate(1.12) contrast(1.05);
  transform: scale(1.02);
}

.scene-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 74% 28%, rgba(59, 205, 255, 0.18), transparent 30%),
    radial-gradient(circle at 18% 70%, rgba(255, 177, 83, 0.1), transparent 22%),
    linear-gradient(180deg, rgba(3, 6, 11, 0.2), #03060b 100%);
}

.grid-floor {
  position: absolute;
  inset: auto -10% -28% -10%;
  height: 46vh;
  background:
    linear-gradient(rgba(56, 217, 255, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 217, 255, 0.18) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.22;
  transform: perspective(520px) rotateX(62deg);
  transform-origin: center bottom;
  mask-image: linear-gradient(transparent, #000 44%, transparent);
}

.scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0, rgba(255, 255, 255, 0.035) 1px, transparent 1px, transparent 5px);
  mix-blend-mode: screen;
  opacity: 0.32;
}

.login-screen,
.access-transition,
.home-shell,
.admin-shell {
  position: relative;
  z-index: 1;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-panel,
.command-card,
.project-grid article,
.contact-card,
.admin-panel,
.admin-metrics article,
.service-tile,
.admin-project-card {
  border: 1px solid rgba(104, 222, 255, 0.28);
  background:
    linear-gradient(145deg, rgba(13, 25, 36, 0.78), rgba(4, 8, 15, 0.88)),
    rgba(5, 12, 20, 0.82);
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.login-panel {
  width: min(440px, 100%);
  padding: 28px;
  border-radius: 8px;
  transform-style: preserve-3d;
  animation: panelRise 700ms ease both;
}

.panel-topline,
.card-header,
.hud-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #7be6ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.core-mark {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin: 34px 0 24px;
  border: 1px solid rgba(123, 230, 255, 0.42);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 38%, #73e9ff, #1a7dba 40%, #071420 72%);
  color: #ecfbff;
  font-size: 38px;
  font-weight: 900;
  box-shadow:
    0 0 34px rgba(42, 205, 255, 0.38),
    inset 0 0 18px rgba(255, 255, 255, 0.26);
}

.eyebrow {
  margin: 0 0 10px;
  color: #66e0ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.login-panel h1,
.hero h1 {
  margin-bottom: 14px;
  letter-spacing: 0;
}

.login-panel h1 {
  font-size: 34px;
}

.login-copy,
.intro,
.project-grid p,
.admin-project-card p {
  color: #aebdca;
  line-height: 1.8;
}

label {
  display: block;
  margin-top: 16px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: #92a9b9;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(123, 230, 255, 0.3);
  border-radius: 8px;
  padding: 0 14px;
  color: #e9f7ff;
  background: rgba(2, 8, 15, 0.72);
  outline: none;
}

input:focus,
select:focus {
  border-color: #68dcff;
  box-shadow: 0 0 0 3px rgba(104, 220, 255, 0.16);
}

button,
.actions a,
.project-grid a,
.small-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(123, 230, 255, 0.4);
  border-radius: 8px;
  padding: 0 18px;
  color: #e9f7ff;
  background: linear-gradient(135deg, rgba(20, 149, 205, 0.88), rgba(17, 59, 102, 0.9));
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(17, 149, 205, 0.2);
}

button {
  width: 100%;
  margin-top: 22px;
}

.small-button {
  width: auto;
  min-height: 38px;
  margin-top: 0;
  font-size: 13px;
}

.muted-button {
  background: rgba(4, 12, 22, 0.7);
}

.danger-button {
  border-color: rgba(255, 126, 126, 0.4);
  background: linear-gradient(135deg, rgba(184, 51, 75, 0.86), rgba(96, 21, 35, 0.88));
}

.error {
  min-height: 22px;
  margin: 12px 0 0;
  color: #ffb47b;
  font-size: 13px;
}

.access-transition {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: none;
  place-items: center;
  background: #000;
  opacity: 1;
}

.access-transition.is-active {
  display: grid;
  animation: blackFade 1800ms ease forwards;
}

.gate-ring {
  position: absolute;
  width: min(58vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(104, 220, 255, 0.36);
  border-radius: 50%;
  box-shadow:
    0 0 70px rgba(104, 220, 255, 0.28),
    inset 0 0 70px rgba(104, 220, 255, 0.14);
  animation: ringSpin 1700ms linear infinite;
}

.gate-ring::before,
.gate-ring::after {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px dashed rgba(255, 177, 83, 0.5);
  border-radius: 50%;
}

.gate-copy {
  display: grid;
  gap: 12px;
  text-align: center;
  text-shadow: 0 0 30px rgba(104, 220, 255, 0.72);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  animation: clearanceText 1800ms ease forwards;
}

.gate-copy span,
.gate-copy small {
  color: #83e9ff;
  font-weight: 800;
}

.gate-copy strong {
  font-size: clamp(34px, 6vw, 76px);
  letter-spacing: 0;
}

.home-shell,
.admin-shell {
  width: min(1240px, calc(100% - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 42px;
  animation: revealHome 900ms ease both;
}

.hud-bar {
  min-height: 58px;
  align-items: center;
  margin-bottom: 34px;
  border-bottom: 1px solid rgba(123, 230, 255, 0.22);
}

.hud-bar > div,
.hud-bar nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hud-bar nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hud-bar nav a {
  color: #ccebf6;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #62ffb4;
  box-shadow: 0 0 20px #62ffb4;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 30px;
  align-items: end;
  min-height: 58vh;
}

.hero h1 {
  font-size: clamp(76px, 12vw, 164px);
  line-height: 0.86;
  text-transform: none;
  text-shadow:
    0 0 24px rgba(104, 220, 255, 0.28),
    0 22px 44px rgba(0, 0, 0, 0.6);
}

.intro {
  max-width: 720px;
  font-size: 19px;
}

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

.actions a:not(.primary) {
  background: rgba(4, 12, 22, 0.7);
}

.command-card {
  min-height: 360px;
  padding: 22px;
  border-radius: 8px;
  transform: perspective(900px) rotateY(-8deg) rotateX(2deg);
}

.card-header strong {
  color: #66ffb4;
}

.status-chart {
  min-height: 190px;
  margin: 18px 0 20px;
  padding: 14px 10px 8px;
  border: 1px solid rgba(104, 220, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(104, 220, 255, 0.08), transparent),
    rgba(2, 10, 18, 0.46);
  box-shadow: inset 0 0 34px rgba(104, 220, 255, 0.08);
}

.chart-meta,
.service-topline,
.service-meta,
.panel-title,
.project-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.chart-meta span {
  color: #8fa8b8;
  font-size: 11px;
  font-weight: 900;
}

.chart-meta strong,
.service-topline span {
  color: #66ffb4;
  font-size: 14px;
  text-shadow: 0 0 18px rgba(102, 255, 180, 0.58);
}

.status-chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-grid path {
  fill: none;
  stroke: rgba(123, 230, 255, 0.15);
  stroke-width: 1;
}

.chart-area {
  fill: rgba(102, 224, 255, 0.13);
}

.chart-line {
  fill: none;
  stroke: url("#chartStroke");
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url("#chartGlow");
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  animation: drawChart 1600ms ease forwards;
}

.chart-points circle {
  fill: #e9f7ff;
  stroke: #66e0ff;
  stroke-width: 3;
  filter: url("#chartGlow");
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  color: #6f8798;
  font-size: 11px;
  font-weight: 800;
}

dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(123, 230, 255, 0.16);
  padding-top: 12px;
}

dt {
  color: #8fa8b8;
}

dd {
  margin: 0;
  color: #e9f7ff;
  font-weight: 900;
}

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

.project-grid article,
.contact-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: 8px;
}

.project-grid span,
.contact-card span {
  color: #66e0ff;
  font-size: 12px;
  font-weight: 900;
}

.project-grid h2,
.contact-card h2 {
  margin: 18px 0 12px;
  font-size: 24px;
  letter-spacing: 0;
}

.project-grid a {
  width: fit-content;
  margin-top: auto;
}

.contact-shell {
  display: grid;
  align-content: start;
}

.contact-hero {
  max-width: 860px;
  padding: 72px 0 30px;
}

.contact-hero h1,
.admin-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(52px, 9vw, 112px);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow:
    0 0 24px rgba(104, 220, 255, 0.28),
    0 22px 44px rgba(0, 0, 0, 0.6);
}

.contact-card a,
.contact-card p {
  margin: 28px 0 0;
  color: #e9f7ff;
  font-size: clamp(15px, 1.7vw, 20px);
  font-weight: 900;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.admin-hero {
  max-width: 920px;
  padding: 24px 0 20px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 22px;
}

.admin-metrics article {
  min-height: 130px;
  display: grid;
  align-content: center;
  gap: 12px;
  border-radius: 8px;
  padding: 22px;
}

.admin-metrics span {
  color: #8fa8b8;
  font-size: 12px;
  font-weight: 900;
}

.admin-metrics strong {
  color: #e9f7ff;
  font-size: 44px;
  line-height: 1;
}

.admin-panel {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  border-radius: 8px;
  padding: 22px;
}

.panel-title h2 {
  margin: 0;
}

.panel-badge {
  border: 1px solid rgba(102, 255, 180, 0.3);
  border-radius: 999px;
  color: #66ffb4;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 900;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-top: 1px solid rgba(123, 230, 255, 0.16);
  padding: 14px 10px;
  text-align: left;
}

.admin-table th {
  color: #8fa8b8;
  font-size: 12px;
}

.admin-table small {
  display: block;
  margin-top: 5px;
  color: #8fa8b8;
}

.admin-table select {
  height: 40px;
}

.admin-search {
  width: min(100%, 340px);
  margin-top: 0;
}

.project-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
  gap: 14px;
  align-items: end;
}

.project-form label {
  margin-top: 0;
}

.project-form button {
  width: auto;
  margin-top: 0;
  white-space: nowrap;
}

.admin-service-grid,
.admin-project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.service-tile,
.admin-project-card {
  min-height: 160px;
  border-radius: 8px;
  padding: 18px;
}

.load-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(123, 230, 255, 0.12);
}

.load-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #66e0ff, #66ffb4, #ffba68);
}

.service-meta {
  margin-top: 14px;
  color: #8fa8b8;
  font-size: 13px;
  font-weight: 800;
}

.admin-project-card {
  display: grid;
  gap: 14px;
}

.admin-project-card h3 {
  margin: 0;
  font-size: 22px;
}

.project-state {
  width: fit-content;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

.project-state.running {
  background: rgba(102, 255, 180, 0.14);
  color: #66ffb4;
}

.project-state.paused {
  background: rgba(102, 224, 255, 0.14);
  color: #66e0ff;
}

.project-state.draft {
  background: rgba(255, 186, 104, 0.14);
  color: #ffba68;
}

@keyframes panelRise {
  from {
    opacity: 0;
    transform: translateY(24px) perspective(900px) rotateX(8deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) perspective(900px) rotateX(0);
  }
}

@keyframes blackFade {
  0% {
    opacity: 0;
    background: rgba(0, 0, 0, 0);
  }
  18%,
  100% {
    opacity: 1;
    background: #000;
  }
}

@keyframes clearanceText {
  0%,
  18% {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    filter: blur(4px);
  }
  34%,
  84% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0.88;
    transform: translateY(0) scale(1.02);
    filter: blur(0);
  }
}

@keyframes ringSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes revealHome {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drawChart {
  to {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 1060px) {
  .project-form,
  .admin-service-grid,
  .admin-project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-form button {
    grid-column: span 1;
  }
}

@media (max-width: 840px) {
  .login-screen {
    padding: 18px;
  }

  .home-shell,
  .admin-shell {
    width: min(100% - 28px, 1240px);
    padding-top: 18px;
  }

  .hud-bar,
  .hud-bar nav,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .hud-bar {
    gap: 14px;
    padding-bottom: 18px;
  }

  .hud-bar nav {
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 34px;
  }

  .hero h1 {
    font-size: clamp(68px, 22vw, 120px);
  }

  .command-card {
    min-height: 280px;
    transform: none;
  }

  .project-grid,
  .contact-grid,
  .admin-metrics,
  .project-form,
  .admin-service-grid,
  .admin-project-grid {
    grid-template-columns: 1fr;
  }

  .contact-hero,
  .admin-hero {
    padding-top: 34px;
  }

  .admin-search {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *:not(.access-transition):not(.gate-ring):not(.gate-copy),
  *:not(.access-transition):not(.gate-ring):not(.gate-copy)::before,
  *:not(.access-transition):not(.gate-ring):not(.gate-copy)::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
