:root {
  --bg: #eef5ff;
  --ink: #172033;
  --muted: #6f7a8f;
  --line: rgba(116, 134, 169, 0.22);
  --blue: #4669ff;
  --violet: #8068ff;
  --cyan: #6ed8ff;
  --panel: rgba(255, 255, 255, 0.82);
  --shadow: 0 24px 70px rgba(63, 83, 145, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 82% 10%, rgba(142, 111, 255, 0.48), transparent 30%),
    radial-gradient(circle at 9% 0%, rgba(69, 109, 255, 0.36), transparent 30%),
    linear-gradient(180deg, #eef5ff 0%, #f8fbff 42%, #edf4ff 100%);
  min-height: 100vh;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 28px;
  padding: 54px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 26%, rgba(255, 255, 255, 0.48), transparent 0 70px, rgba(255, 255, 255, 0.08) 72px 128px, transparent 130px),
    radial-gradient(circle at 86% 74%, rgba(103, 222, 255, 0.4), transparent 28%),
    linear-gradient(135deg, #516df8 0%, #6859ee 48%, #7d9bff 100%);
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  right: -120px;
  top: -90px;
  width: 420px;
  height: 420px;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  transform: rotate(-18deg) scaleX(1.35);
}

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

.eyebrow {
  margin: 0 0 12px;
  color: #6674ff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

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

.hero h1 {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.04;
  letter-spacing: 0;
}

.summary {
  max-width: 610px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions,
.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-action,
.ghost-action,
.admin-actions button,
.download-strip button,
.device-table button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 22px;
  text-decoration: none;
  font-weight: 800;
}

.primary-action {
  color: #fff;
  background: linear-gradient(135deg, #4d6dff, #825dff);
  box-shadow: 0 14px 34px rgba(72, 91, 236, 0.32);
}

.ghost-action {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.qr-panel {
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 24px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px);
}

.qr-header,
.section-title,
.screen-top,
.record-body,
.admin-header,
.rank-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.qr-code {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 4px;
  width: 210px;
  height: 210px;
  margin: 18px auto;
  border-radius: 18px;
  padding: 15px;
  background: #fff;
}

.qr-code span {
  border-radius: 3px;
  background: #1a2440;
  opacity: var(--o, 1);
}

.qr-panel p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
}

.demo-tabs {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  gap: 10px;
  width: fit-content;
  margin: 26px auto;
  border: 1px solid rgba(92, 111, 172, 0.16);
  border-radius: 999px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 42px rgba(73, 86, 142, 0.16);
  backdrop-filter: blur(16px);
}

.tab {
  min-width: 126px;
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, #536fff, #8066ff);
}

.demo-section {
  display: none;
}

.demo-section.is-visible {
  display: block;
}

.phone-frame {
  width: min(430px, 100%);
  margin: 0 auto;
  border-radius: 48px;
  padding: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(207, 219, 255, 0.78));
  box-shadow: var(--shadow);
}

.phone-status {
  display: flex;
  justify-content: space-between;
  padding: 18px 28px 12px;
  color: #0f172a;
  font-weight: 800;
  background: #fff;
  border-radius: 38px 38px 0 0;
}

.mobile-page {
  position: relative;
  overflow: hidden;
  min-height: 760px;
  border-radius: 0 0 38px 38px;
  padding: 18px 16px 92px;
  background:
    radial-gradient(circle at 95% 16%, rgba(116, 83, 255, 0.28), transparent 22%),
    radial-gradient(circle at 12% 42%, rgba(91, 228, 255, 0.24), transparent 24%),
    linear-gradient(180deg, #f9fbff 0%, #eef4ff 100%);
}

.device-cover {
  position: relative;
  overflow: hidden;
  min-height: 256px;
  border-radius: 28px;
  padding: 26px;
  color: #fff;
  background: linear-gradient(135deg, #4f6cff, #8265ff 58%, #61cfff);
}

.device-cover p,
.device-cover small {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.82);
}

.device-cover h2 {
  position: relative;
  z-index: 2;
  max-width: 250px;
  margin-bottom: 10px;
  font-size: 27px;
  line-height: 1.18;
  letter-spacing: 0;
}

.device-visual {
  position: absolute;
  right: 18px;
  bottom: 24px;
  width: 128px;
  height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.16);
  transform: rotate(-8deg);
}

.device-visual span {
  position: absolute;
  inset: 22px 28px;
  border-radius: 999px;
  background: radial-gradient(circle, #fff 0 10px, rgba(97, 207, 255, 0.82) 12px 26px, rgba(255, 255, 255, 0.18) 28px);
}

.visual-ring {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

.visual-ring.one {
  right: -50px;
  top: -20px;
  width: 160px;
  height: 160px;
}

.visual-ring.two {
  right: 48px;
  bottom: -74px;
  width: 190px;
  height: 190px;
}

.glass-card,
.download-strip,
.chart-card,
.env-card,
.record-card,
.device-summary-card,
.table-card,
.scenario-panel,
.app-screen {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 16px 38px rgba(72, 92, 154, 0.12);
  backdrop-filter: blur(16px);
}

.glass-card {
  margin-top: 14px;
  padding: 18px;
}

.glass-card h3,
.chart-card h3,
.env-card h3,
.record-card h3,
.table-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.glass-card p {
  color: var(--muted);
  line-height: 1.75;
}

.metric-row,
.ability-grid,
.stats-grid,
.env-grid,
.admin-metrics,
.analytics-grid {
  display: grid;
  gap: 12px;
}

.metric-row {
  grid-template-columns: repeat(3, 1fr);
}

.metric-row span,
.ability-grid span,
.env-grid span {
  border-radius: 14px;
  padding: 12px;
  color: #526078;
  background: rgba(83, 111, 255, 0.08);
}

.metric-row strong {
  display: block;
  color: #1d2840;
  font-size: 24px;
}

.ability-grid {
  grid-template-columns: repeat(2, 1fr);
}

.capability-list {
  display: grid;
  gap: 10px;
}

.capability-list article {
  display: grid;
  gap: 4px;
  border-left: 4px solid #6971ff;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
}

.capability-list span {
  color: var(--muted);
  font-size: 13px;
}

.download-strip {
  margin-top: 14px;
  padding: 18px;
}

.download-strip p {
  color: #364056;
  line-height: 1.7;
}

.download-strip div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.download-strip button,
.admin-actions button,
.device-table button {
  color: #4f63e9;
  background: rgba(82, 105, 255, 0.1);
}

.fixed-cta {
  position: sticky;
  bottom: 16px;
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #4d6dff, #825dff);
  box-shadow: 0 18px 34px rgba(83, 102, 236, 0.35);
  font-size: 17px;
  font-weight: 900;
}

.simulator {
  display: grid;
  grid-template-columns: 340px minmax(0, 430px);
  align-items: start;
  justify-content: center;
  gap: 28px;
}

.scenario-panel {
  padding: 28px;
}

.scenario-panel h2,
.admin-header h2 {
  margin-bottom: 20px;
  font-size: 28px;
  letter-spacing: 0;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  color: #2b3448;
  font-weight: 800;
}

input[type="checkbox"] {
  width: 44px;
  height: 24px;
  accent-color: #6470ff;
}

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

.flow-hint {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.app-screen {
  overflow: hidden;
  min-height: 760px;
  padding: 16px;
  background:
    radial-gradient(circle at 88% 4%, rgba(120, 94, 255, 0.22), transparent 26%),
    linear-gradient(180deg, #fbfcff 0%, #eef5ff 100%);
}

.screen-top {
  min-height: 46px;
  margin-bottom: 12px;
}

.screen-top button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #556078;
  background: rgba(255, 255, 255, 0.72);
  font-size: 22px;
}

.device-summary-card {
  display: block;
  margin-bottom: 14px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(82, 108, 255, 0.92), rgba(128, 101, 255, 0.88));
  color: #fff;
}

.device-summary-card p {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.78);
}

.device-summary-card h2 {
  margin-bottom: 12px;
  font-size: 22px;
  letter-spacing: 0;
}

.device-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.5;
}

.status-dot,
.risk-badge,
.online,
.offline {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.status-dot {
  color: #ddfff6;
  background: rgba(255, 255, 255, 0.18);
}

.risk-badge {
  align-self: start;
  color: #fff5dc;
  background: rgba(255, 185, 57, 0.22);
}

.stats-grid {
  grid-template-columns: repeat(3, 1fr);
}

.stats-grid article,
.admin-metrics article {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.stats-grid span,
.admin-metrics span,
.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.stats-grid strong,
.admin-metrics strong {
  display: inline-block;
  margin-top: 8px;
  font-size: 38px;
  line-height: 1;
}

.stats-grid small {
  color: #2c3448;
  font-weight: 800;
}

.chart-card,
.env-card,
.record-card,
.table-card {
  margin-top: 14px;
  padding: 18px;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 190px;
  padding-top: 18px;
}

.bar-chart span {
  position: relative;
  flex: 1;
  height: var(--h);
  min-height: 28px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, #6277ff, #7bd8ff);
}

.bar-chart i {
  position: absolute;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.composition-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.composition-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.composition-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.aedes {
  background: #6174ff;
}

.culex {
  background: #67d8ff;
}

.anopheles {
  background: #ffc65c;
}

.stacked-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 210px;
  padding-top: 12px;
}

.stacked-chart span {
  position: relative;
  overflow: hidden;
  flex: 1;
  height: 156px;
  border-radius: 999px 999px 10px 10px;
  background:
    linear-gradient(
      to top,
      #536fff 0 var(--a),
      #55cfff var(--a) calc(var(--a) + var(--c)),
      #ffc04d calc(var(--a) + var(--c)) 100%
    );
  box-shadow: inset 0 0 0 1px rgba(83, 103, 255, 0.08);
}

.stacked-chart i {
  position: absolute;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.env-grid {
  grid-template-columns: repeat(2, 1fr);
}

.env-grid b {
  display: block;
  margin-top: 6px;
  color: #1d2840;
}

.record-body {
  align-items: stretch;
  justify-content: flex-start;
}

.record-image {
  flex: 0 0 104px;
  min-height: 104px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(24, 32, 51, 0.92) 0 14px, transparent 15px),
    radial-gradient(ellipse at 38% 44%, rgba(65, 77, 109, 0.85) 0 9px, transparent 10px),
    radial-gradient(ellipse at 62% 52%, rgba(65, 77, 109, 0.85) 0 9px, transparent 10px),
    linear-gradient(135deg, #dfe9ff, #ffffff);
}

.record-info {
  display: grid;
  align-content: center;
  gap: 9px;
  min-width: 0;
}

.record-info b {
  font-size: 18px;
}

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

.record-tags span {
  border-radius: 999px;
  padding: 6px 10px;
  color: #5362dc;
  background: rgba(83, 111, 255, 0.1);
  font-size: 12px;
  font-weight: 900;
}

.record-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state,
.login-state,
.denied-state {
  display: grid;
  place-items: center;
  min-height: 640px;
  text-align: center;
}

.state-card {
  width: min(300px, 100%);
  border-radius: 22px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 44px rgba(73, 86, 142, 0.14);
}

.state-card h3 {
  margin-bottom: 10px;
  font-size: 24px;
}

.state-card p {
  color: var(--muted);
  line-height: 1.7;
}

.state-card button {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 20px;
  color: #fff;
  background: linear-gradient(135deg, #4d6dff, #825dff);
  font-weight: 900;
}

.admin-layout {
  display: grid;
  gap: 18px;
}

.admin-header,
.admin-metrics,
.analytics-grid {
  align-items: stretch;
}

.admin-metrics {
  grid-template-columns: repeat(4, 1fr);
}

.admin-metrics article {
  min-height: 128px;
}

.admin-metrics small {
  display: block;
  margin-top: 10px;
  color: #778197;
}

.device-table {
  display: grid;
  gap: 8px;
}

.device-table [role="row"] {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.4fr 80px 80px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(246, 248, 255, 0.78);
}

.table-head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.online {
  color: #0a8d65;
  background: rgba(23, 186, 130, 0.12);
}

.offline {
  color: #9c5b00;
  background: rgba(255, 171, 64, 0.16);
}

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

.rank-list {
  display: grid;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style-position: inside;
}

.rank-list li {
  border-radius: 12px;
  padding: 12px;
  background: rgba(246, 248, 255, 0.86);
}

.rank-list b {
  font-size: 22px;
}

.funnel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.funnel span {
  width: var(--w);
  min-width: 150px;
  border-radius: 999px;
  padding: 12px 16px;
  color: #fff;
  background: linear-gradient(90deg, #536fff, #72d4ff);
  font-weight: 900;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 20px, 520px);
    padding-top: 10px;
  }

  .hero,
  .simulator,
  .admin-metrics,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 32px 22px;
  }

  .qr-panel {
    width: 100%;
  }

  .qr-code {
    width: 190px;
    height: 190px;
  }

  .demo-tabs {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .tab {
    min-width: max-content;
  }

  .phone-frame,
  .app-screen {
    width: 100%;
  }

  .device-table {
    overflow-x: auto;
  }

  .device-table [role="row"] {
    min-width: 760px;
  }
}

@media (max-width: 420px) {
  .metric-row,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .device-cover h2 {
    max-width: 220px;
  }

  .bar-chart {
    gap: 6px;
  }
}
