:root {
  color-scheme: dark;
  --bg: #07110f;
  --surface: rgba(18, 34, 30, 0.78);
  --surface-strong: #12241f;
  --line: rgba(190, 230, 213, 0.13);
  --text: #eefaf4;
  --muted: #91aaa0;
  --green: #65e0aa;
  --green-strong: #2fc989;
  --green-deep: #103f30;
  --amber: #f1bd6a;
  --red: #ff7a78;
  --blue: #7bb9ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family:
    "Segoe UI Variable", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 3%, rgba(68, 207, 157, 0.14), transparent 30rem),
    radial-gradient(circle at 90% 22%, rgba(70, 128, 200, 0.11), transparent 32rem),
    linear-gradient(150deg, #07110f 0%, #081411 55%, #07100f 100%);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.28;
  pointer-events: none;
}

.ambient-one {
  width: 18rem;
  height: 18rem;
  top: 30%;
  left: -9rem;
  background: #2c9f77;
}

.ambient-two {
  width: 20rem;
  height: 20rem;
  right: -10rem;
  bottom: 2rem;
  background: #245d93;
}

.topbar {
  position: relative;
  z-index: 3;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand,
.topbar-actions,
.current-app,
.hero-actions,
.control-row,
.panel-heading,
.date-control,
.select-control,
.history-main,
.history-meta,
.summary-row,
.summary-main,
.privacy-note {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(127, 241, 194, 0.28);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(51, 176, 127, 0.35), rgba(15, 41, 33, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand-mark svg {
  width: 25px;
  fill: rgba(101, 224, 170, 0.13);
  stroke: var(--green);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark .check {
  fill: none;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0.12em;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.topbar-actions {
  gap: 10px;
}

.status-badge {
  min-height: 36px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(11, 24, 20, 0.65);
  font-size: 13px;
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.status-badge.is-online {
  color: var(--green);
  border-color: rgba(101, 224, 170, 0.28);
}

.status-badge.is-stale {
  color: var(--amber);
}

.status-badge.is-offline {
  color: var(--red);
}

.status-badge.is-waiting {
  color: var(--muted);
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(11, 24, 20, 0.65);
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(101, 224, 170, 0.38);
}

.icon-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
}

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

.hero-card,
.panel,
.metric-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero-card {
  min-height: 282px;
  padding: clamp(28px, 4.5vw, 52px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  border-radius: 28px;
  background:
    linear-gradient(120deg, rgba(29, 73, 57, 0.82), rgba(13, 31, 26, 0.72)),
    radial-gradient(circle at 85% 10%, rgba(92, 222, 169, 0.15), transparent 30rem);
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  right: 8%;
  top: -150px;
  border: 1px solid rgba(128, 232, 190, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 35px rgba(128, 232, 190, 0.025),
    0 0 0 70px rgba(128, 232, 190, 0.02);
}

.hero-copy,
.hero-actions {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.freshness {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: none;
}

.freshness.is-fresh {
  color: var(--green);
  border-color: rgba(101, 224, 170, 0.26);
}

.freshness.is-stale {
  color: var(--amber);
}

.current-app {
  gap: 18px;
  margin-top: 24px;
}

.app-avatar {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(179, 244, 217, 0.22);
  border-radius: 23px;
  color: var(--green);
  background:
    linear-gradient(145deg, rgba(103, 226, 176, 0.2), rgba(18, 57, 44, 0.68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 35px rgba(0, 0, 0, 0.2);
  font-size: 28px;
  font-weight: 700;
}

.app-copy {
  min-width: 0;
}

.app-copy h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 43px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.app-copy p {
  margin: 10px 0 0;
  max-width: 42rem;
  overflow: hidden;
  color: var(--muted);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.last-seen {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-actions {
  width: min(100%, 290px);
  align-items: stretch;
  flex-direction: column;
  gap: 10px;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 14px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

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

.primary-button {
  border: 1px solid rgba(158, 255, 213, 0.24);
  color: #062017;
  background: linear-gradient(135deg, #77e8b6, #3bcb8e);
  box-shadow: 0 12px 30px rgba(47, 201, 137, 0.18);
  font-weight: 700;
}

.primary-button svg,
.secondary-button svg,
.privacy-note svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line);
  background: rgba(7, 22, 17, 0.55);
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: rgba(101, 224, 170, 0.3);
  background: rgba(20, 49, 39, 0.75);
}

.danger-button {
  flex: 1;
  border: 1px solid rgba(255, 122, 120, 0.24);
  color: #ffaaa8;
  background: rgba(89, 27, 27, 0.23);
}

.danger-button:hover {
  background: rgba(118, 35, 35, 0.38);
}

.control-row {
  width: 100%;
  min-width: 0;
  gap: 8px;
}

.control-row .ghost-button {
  min-width: 0;
  min-height: 46px;
  padding-inline: 12px;
}

.control-row .danger-button,
.control-row .ghost-button {
  font-size: 12px;
  white-space: nowrap;
}

button:disabled {
  transform: none !important;
  opacity: 0.45;
  cursor: not-allowed;
}

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

.metric-card {
  min-height: 120px;
  padding: 22px;
  border-radius: 20px;
}

.metric-card span,
.metric-card small {
  display: block;
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin-top: 9px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.metric-card small {
  margin-top: 4px;
  color: #738b82;
  font-size: 11px;
}

.content-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.main-column {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.panel {
  padding: 24px;
  border-radius: 22px;
}

.side-column {
  display: grid;
  gap: 14px;
}

.panel-heading {
  min-height: 44px;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading.compact {
  min-height: 34px;
}

.overline,
.modal-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--green);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel h2,
.modal-card h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.date-control {
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

input[type="date"] {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(5, 17, 14, 0.72);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
}

.history-list {
  margin-top: 18px;
  min-height: 280px;
}

.history-row {
  position: relative;
  padding: 14px 0;
  display: grid;
  grid-template-columns: 56px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.history-block-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 122, 120, 0.22);
  border-radius: 9px;
  color: #ffaaa8;
  background: rgba(89, 27, 27, 0.2);
  font-size: 11px;
  cursor: pointer;
}

.history-block-button:hover {
  border-color: rgba(255, 122, 120, 0.42);
  background: rgba(118, 35, 35, 0.34);
}

.history-row:first-child {
  border-top: 0;
}

.history-time {
  color: var(--muted);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.history-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--green);
  background: rgba(87, 183, 145, 0.09);
  font-size: 13px;
  font-weight: 700;
}

.history-main {
  min-width: 0;
  justify-content: space-between;
  gap: 16px;
}

.history-copy {
  min-width: 0;
}

.history-copy strong,
.history-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-copy strong {
  font-size: 14px;
}

.history-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
}

.history-meta {
  flex: 0 0 auto;
  gap: 8px;
}

.event-kind {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state .empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--green);
  background: rgba(44, 106, 82, 0.12);
  font-size: 28px;
}

.empty-state strong {
  margin-top: 15px;
  font-size: 14px;
}

.empty-state p,
.privacy-note p,
.modal-card > p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.summary-list {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.summary-row {
  gap: 12px;
}

.summary-rank {
  width: 22px;
  color: #6f8a7f;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
}

.summary-main {
  min-width: 0;
  flex: 1;
  align-items: stretch;
  flex-direction: column;
  gap: 7px;
}

.summary-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.summary-label span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-label span:last-child {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.summary-bar {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.summary-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-strong), var(--green));
}

.panel-badge {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 122, 120, 0.22);
  border-radius: 999px;
  color: #ffaaa8;
  background: rgba(89, 27, 27, 0.2);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
}

.disabled-list {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.disabled-panel {
  margin-top: 0;
}

.disabled-row {
  padding: 10px 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.disabled-row:first-child {
  border-top: 0;
}

.disabled-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 122, 120, 0.18);
  border-radius: 10px;
  color: #ffaaa8;
  background: rgba(89, 27, 27, 0.18);
  font-size: 12px;
  font-weight: 700;
}

.disabled-copy {
  min-width: 0;
}

.disabled-copy strong,
.disabled-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disabled-copy strong {
  font-size: 12px;
}

.disabled-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 9px;
}

.enable-app-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(101, 224, 170, 0.25);
  border-radius: 9px;
  color: var(--green);
  background: rgba(42, 109, 83, 0.18);
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.enable-app-button:hover {
  border-color: rgba(101, 224, 170, 0.46);
  background: rgba(42, 109, 83, 0.3);
}

.select-control {
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
}

.select-control select {
  max-width: 180px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: rgba(7, 19, 16, 0.72);
}

.device-details {
  margin: 18px 0 0;
  display: grid;
  gap: 11px;
}

.device-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.device-details dt {
  color: var(--muted);
}

.device-details dd {
  margin: 0;
  max-width: 65%;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.privacy-note {
  padding: 2px 6px;
  align-items: flex-start;
  gap: 10px;
  color: #759286;
}

.privacy-note svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.privacy-note p {
  margin: 0;
  font-size: 10px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(2, 8, 7, 0.78);
  backdrop-filter: blur(14px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid rgba(171, 229, 206, 0.17);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(22, 45, 37, 0.98), rgba(9, 24, 20, 0.98));
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.6);
}

.modal-card h2 {
  font-size: 24px;
}

.modal-card code {
  color: var(--green);
}

.field {
  margin-top: 24px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.field input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(4, 16, 12, 0.72);
}

.form-error {
  color: var(--red) !important;
}

.full-width {
  width: 100%;
  margin-top: 18px;
}

.screenshot-card {
  width: min(660px, 100%);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.screenshot-stage {
  position: relative;
  min-height: 320px;
  max-height: 65vh;
  margin-top: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%) 0 0 /
      18px 18px,
    linear-gradient(315deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%) 0 0 /
      18px 18px,
    #07110f;
  overflow: auto;
}

.screenshot-stage img {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
}

.loading-ring {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(101, 224, 170, 0.18);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 28px;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  transform: translateX(-50%);
  border: 1px solid rgba(182, 239, 214, 0.18);
  border-radius: 999px;
  color: var(--text);
  background: rgba(16, 38, 30, 0.96);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.42);
  font-size: 12px;
  text-align: center;
}

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

@media (max-width: 880px) {
  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .control-row {
    grid-column: 1 / -1;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .side-column {
    grid-template-columns: 1fr 1fr;
  }

  .privacy-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .topbar,
  .layout {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    padding-top: 18px;
  }

  .brand span,
  .status-badge #statusText {
    display: none;
  }

  .status-badge {
    width: 36px;
    min-height: 36px;
    justify-content: center;
    padding: 0;
  }

  .hero-card {
    min-height: 0;
    padding: 24px 20px;
    border-radius: 22px;
  }

  .app-avatar {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    font-size: 23px;
  }

  .app-copy h1 {
    font-size: 28px;
  }

  .current-app {
    align-items: flex-start;
  }

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

  .control-row {
    grid-column: auto;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card:last-child {
    grid-column: 1 / -1;
  }

  .side-column {
    grid-template-columns: 1fr;
  }

  .privacy-note {
    grid-column: auto;
  }

  .panel {
    padding: 20px 16px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .history-row {
    grid-template-columns: 48px 34px minmax(0, 1fr) auto;
  }

  .history-meta {
    display: none;
  }

  .history-block-button {
    padding-inline: 8px;
  }

  .modal-card {
    padding: 24px 20px;
  }
}

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