:root {
  color-scheme: dark;
  --bg: #070a11;
  --panel: rgba(13, 18, 30, 0.74);
  --panel-strong: rgba(18, 25, 40, 0.9);
  --ink: #f7fbff;
  --muted: #a8b4c7;
  --soft: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.32);
  --brand: #0872ff;
  --cyan: #18d5ff;
  --green: #13c690;
  --amber: #ffb454;
  --red: #ff5e57;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(8, 114, 255, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(24, 213, 255, 0.065) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(8, 114, 255, 0.22), transparent 34%),
    radial-gradient(circle at 82% 22%, rgba(24, 213, 255, 0.16), transparent 30%),
    #070a11;
  background-size: 54px 54px, 54px 54px, auto, auto, auto;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 24%, rgba(8, 114, 255, 0.14) 24% 25%, transparent 25% 54%, rgba(24, 213, 255, 0.09) 54% 55%, transparent 55%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent 34%);
  opacity: 0.72;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 48px;
}

.topbar {
  position: fixed;
  z-index: 30;
  top: 18px;
  left: 50%;
  width: min(1120px, calc(100% - 34px));
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(15, 19, 29, 0.86);
  box-shadow: 0 18px 64px rgba(36, 54, 90, 0.22);
  backdrop-filter: blur(22px);
  animation: navIn 0.7s ease both;
}

.topbar-inner {
  min-height: 62px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 0 16px;
}

.brand,
.nav,
.nav a,
.contact-menu,
.contact-trigger,
.console,
.actions,
.toolbar,
.status-pill {
  display: inline-flex;
  align-items: center;
}

.nav .temporarily-hidden {
  display: none !important;
}

.brand {
  gap: 11px;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  min-width: 0;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #fff;
  overflow: hidden;
  box-shadow: inset 0 -5px 12px rgba(8, 114, 255, 0.14);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
}

.brand-name {
  white-space: nowrap;
}

.nav {
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.nav a,
.contact-trigger,
.console,
button {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0 13px;
  cursor: pointer;
}

.nav a,
.contact-trigger,
.console {
  justify-content: center;
  color: rgba(255, 255, 255, 0.76);
  font-size: 15px;
  font-weight: 560;
  line-height: 1;
  background: transparent;
  transition: color 0.18s, background 0.18s, transform 0.18s;
}

.contact-menu {
  position: relative;
}

.nav a:hover,
.contact-trigger:hover,
.contact-trigger[aria-expanded="true"],
.console:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.console {
  color: #111827;
  background: #fff;
  font-weight: 780;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.console:hover {
  color: #111827;
  background: #fff;
  transform: translateY(-1px);
}

@keyframes navIn {
  from {
    opacity: 0;
    transform: translate(-50%, -14px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.contact-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 20;
  width: min(236px, calc(100vw - 34px));
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(9, 13, 22, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px) scale(0.98);
  transform-origin: 50% 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.contact-menu.is-open .contact-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.contact-panel img {
  width: 100%;
  display: block;
  border-radius: 12px;
  background: #fff;
}

.hero {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 380px);
  gap: 24px;
  align-items: end;
  padding: 132px 6px 30px;
}

.hero.compact {
  min-height: 300px;
  padding: 132px 6px 22px;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 16px;
  padding: 8px 13px;
  border: 1px solid rgba(24, 213, 255, 0.28);
  border-radius: 999px;
  color: #d9fbff;
  background: rgba(24, 213, 255, 0.1);
  font-size: 13px;
  font-weight: 850;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(44px, 7vw, 86px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 0 48px rgba(8, 114, 255, 0.34);
}

h2 {
  margin-bottom: 5px;
  font-size: 20px;
  letter-spacing: 0;
}

.lead {
  max-width: 740px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  line-height: 1.75;
}

.account-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.account-panel {
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 20px;
  overflow: hidden;
}

.account-panel strong {
  color: #fff;
  font-size: 16px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  gap: 20px;
}

.panel {
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-head p,
.muted,
.small {
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(24, 213, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(8, 114, 255, 0.2);
}

select option {
  color: #101827;
}

.actions,
.toolbar {
  gap: 12px;
  flex-wrap: wrap;
}

.actions {
  align-items: center;
}

.toolbar {
  align-items: end;
  margin-bottom: 16px;
}

.primary,
.secondary,
.danger {
  font-weight: 850;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #18a7ff);
  box-shadow: 0 16px 34px rgba(8, 114, 255, 0.28);
}

.primary:hover,
.secondary:hover,
.danger:hover {
  transform: translateY(-1px);
}

.secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.danger {
  color: #fff;
  background: rgba(255, 94, 87, 0.9);
}

.form-message {
  min-height: 24px;
  color: var(--muted);
}

.status-pill {
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  color: #fff;
  background: #68748a;
  font-size: 13px;
  font-weight: 850;
}

.status-pending { background: var(--amber); color: #15100a; }
.status-confirmed { background: var(--brand); }
.status-installing { background: #00a6a6; }
.status-completed { background: var(--green); color: #07120e; }
.status-cancelled { background: #717b8f; }
.status-reschedule_requested { background: var(--red); }

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

.booking-card dl {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  margin: 0;
}

.booking-card dt {
  color: var(--muted);
}

.booking-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.status-help {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.status-help-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.status-help-row .status-pill {
  min-height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.admin-shell {
  padding: 16px;
  background: rgba(10, 14, 24, 0.82);
}

.toolbar label {
  min-width: 180px;
  margin-bottom: 0;
}

.toolbar .search-box {
  min-width: min(360px, 100%);
  flex: 1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 13px 11px;
  text-align: left;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  color: rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.045);
  font-size: 13px;
  white-space: nowrap;
}

td {
  color: rgba(255, 255, 255, 0.9);
}

td textarea {
  min-width: 230px;
}

.row-actions {
  display: grid;
  gap: 8px;
}

.small {
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar {
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    transform: none;
    border-radius: 24px;
    animation: none;
  }

  .topbar-inner {
    min-height: 56px;
    grid-template-columns: auto auto;
    gap: 8px;
    padding: 0 10px;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    padding-bottom: 9px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a,
  .contact-trigger,
  .console {
    min-height: 36px;
    flex: 0 0 auto;
    padding: 0 10px;
    font-size: 14px;
    white-space: nowrap;
  }

  .console {
    justify-self: end;
  }

  .contact-panel {
    left: auto;
    right: 0;
    width: min(220px, calc(100vw - 26px));
    transform: translate(0, -6px) scale(0.98);
    transform-origin: 86% 0;
  }

  .contact-menu.is-open .contact-panel {
    transform: translate(0, 0) scale(1);
  }

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

  .hero {
    min-height: auto;
    padding: 150px 0 20px;
  }

  h1 {
    font-size: clamp(42px, 14vw, 62px);
  }

  .panel,
  .account-panel {
    padding: 18px;
  }
}
