:root {
  --bg: #050914;
  --panel: rgb(10 19 35 / 88%);
  --panel-strong: rgb(13 25 46 / 94%);
  --line: rgb(126 167 255 / 17%);
  --line-hot: rgb(76 211 255 / 34%);
  --text: #eef6ff;
  --muted: #90a8c2;
  --faint: #526a84;
  --blue: #2f7dff;
  --cyan: #4cd3ff;
  --green: #2ee59d;
  --amber: #ffbd57;
  --red: #ff5d7a;
  --radius: 8px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    linear-gradient(90deg, rgb(47 125 255 / 12%), transparent 24%, transparent 76%, rgb(46 229 157 / 9%)),
    linear-gradient(180deg, #0b1527 0%, #07101e 42%, #040712 100%);
  color: var(--text);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgb(255 255 255 / 3.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 3.5%) 1px, transparent 1px),
    linear-gradient(180deg, transparent 0%, rgb(76 211 255 / 5%) 48%, transparent 49%);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgb(0 0 0 / 82%), transparent 82%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 4%) 0 1px, transparent 1px 7px),
    linear-gradient(90deg, transparent 0%, rgb(76 211 255 / 8%) 50%, transparent 100%);
  background-size: 100% 8px, 100% 100%;
  opacity: 0.22;
  mix-blend-mode: screen;
}

body.embed {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(90deg, rgb(47 125 255 / 12%), transparent 24%, transparent 76%, rgb(46 229 157 / 9%)),
    linear-gradient(180deg, #0b1527 0%, #07101e 42%, #040712 100%);
  overflow: hidden;
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
}

body.embed .screen {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  padding: 12px;
  gap: 8px;
}

.screen-head {
  position: relative;
  min-height: 122px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 22px 26px;
  border: 1px solid var(--line-hot);
  border-radius: 10px;
  background:
    linear-gradient(100deg, rgb(14 31 58 / 98%), rgb(7 14 27 / 88%)),
    linear-gradient(90deg, rgb(76 211 255 / 12%), transparent 58%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 10%),
    inset 0 -1px 0 rgb(0 0 0 / 45%),
    0 22px 62px rgb(0 0 0 / 28%);
  overflow: hidden;
}

.screen-head::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 18px;
  bottom: 18px;
  width: min(360px, 28%);
  border: 1px solid rgb(76 211 255 / 12%);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgb(76 211 255 / 10%), transparent),
    repeating-linear-gradient(90deg, transparent 0 20px, rgb(76 211 255 / 7%) 20px 21px);
  transform: skewX(-12deg);
}

.screen-head > div {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid rgb(56 213 255 / 34%);
  border-radius: 999px;
  padding: 0 12px;
  background: rgb(76 211 255 / 10%);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

h1 {
  margin-top: 10px;
  font-size: clamp(32px, 3.4vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 900;
  text-shadow: 0 0 26px rgb(76 211 255 / 18%);
}

.clock {
  position: relative;
  z-index: 1;
  min-width: 260px;
  text-align: right;
}

.clock strong {
  display: block;
  color: #78e4ff;
  font-size: clamp(36px, 3.8vw, 60px);
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 28px rgb(76 211 255 / 34%);
}

.clock span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.kpis {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kpis article,
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 5.5%), rgb(255 255 255 / 2%)),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 8%),
    inset 0 -1px 0 rgb(0 0 0 / 34%),
    0 16px 44px rgb(0 0 0 / 22%);
  overflow: hidden;
}

.kpis article {
  min-height: 112px;
  padding: 16px 18px;
}

.kpis article::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgb(76 211 255 / 11%), transparent 34%),
    linear-gradient(180deg, rgb(255 255 255 / 3%), transparent 32%);
  pointer-events: none;
}

.kpis article::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgb(76 211 255 / 22%), rgb(47 125 255 / 10%));
  box-shadow: 0 0 24px rgb(76 211 255 / 12%);
}

.kpis article:nth-child(3)::after {
  background: linear-gradient(135deg, rgb(46 229 157 / 22%), rgb(46 229 157 / 8%));
}

.kpis article:nth-child(4)::after {
  background: linear-gradient(135deg, rgb(255 189 87 / 24%), rgb(255 189 87 / 8%));
}

.kpis span,
.panel-title span {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 13px;
}

.kpis strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 10px;
  color: #ffffff;
  font-size: clamp(31px, 3vw, 48px);
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.kpis article:first-child strong {
  color: #8feaff;
  text-shadow: 0 0 22px rgb(56 213 255 / 28%);
}

.kpis small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 10px;
  color: var(--faint);
}

.dashboard-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.25fr) minmax(320px, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.panel {
  min-height: 0;
  padding: 16px;
}

.orders-panel {
  grid-row: span 2;
}

.trend-panel {
  background:
    linear-gradient(180deg, rgb(47 125 255 / 10%), transparent 42%),
    var(--panel-strong);
}

.panel-title {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: 0;
}

.donut-wrap {
  position: relative;
  z-index: 1;
  height: calc(100% - 40px);
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, 42%) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.donut {
  width: min(218px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto;
  box-shadow:
    0 0 44px rgb(56 213 255 / 18%),
    inset 0 0 0 1px rgb(255 255 255 / 12%);
}

.donut::after {
  content: "收入";
  width: 44%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #091426;
  border: 1px solid rgb(56 213 255 / 22%);
  color: var(--cyan);
  font-size: 17px;
  font-weight: 900;
  box-shadow: inset 0 0 28px rgb(56 213 255 / 8%);
}

.legend,
.feed,
.alerts,
.routes {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
}

.legend-row,
.feed-row,
.alert-row,
.route-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgb(122 162 255 / 14%);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 5%);
}

.legend-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

body.embed .legend-row {
  grid-template-columns: 1fr;
  gap: 4px;
}

body.embed .legend-row strong {
  justify-self: start;
}

.legend-row span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-row i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 3px;
  box-shadow: 0 0 14px currentColor;
}

.legend-row strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trend-chart {
  position: relative;
  z-index: 1;
  height: calc(100% - 42px);
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
}

.bar-item {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.bar-value {
  color: #dcecff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  border: 1px solid rgb(122 162 255 / 13%);
  border-radius: 10px;
  background: linear-gradient(180deg, rgb(255 255 255 / 5%), rgb(255 255 255 / 2%));
  overflow: hidden;
}

.bar-track span {
  width: 58%;
  min-height: 10px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #75e9ff, #2f7dff 62%, #1c4dff);
  box-shadow: 0 0 28px rgb(47 125 255 / 48%);
}

.feed {
  max-height: calc(100% - 42px);
  overflow: auto;
  padding-right: 2px;
}

.feed-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.feed-row span,
.alert-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.feed-row em,
.alert-row b {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgb(255 189 87 / 12%);
  color: var(--amber);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.feed-row em.paid {
  background: rgb(46 229 157 / 12%);
  color: var(--green);
}

.feed-row em.failed {
  background: rgb(255 93 122 / 12%);
  color: var(--red);
}

.feed-row b {
  font-variant-numeric: tabular-nums;
}

.alert-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 20px var(--amber);
}

.route-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.online,
.standby,
.offline {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.online {
  background: rgb(46 229 157 / 12%);
  color: var(--green);
}

.offline {
  background: rgb(255 93 122 / 12%);
  color: var(--red);
}

.standby {
  background: rgb(255 189 87 / 12%);
  color: var(--amber);
}

.empty-dark {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

body.embed .screen-head {
  min-height: 82px;
  padding: 12px 16px;
}

body.embed h1 {
  margin-top: 6px;
  font-size: clamp(24px, 2.6vw, 36px);
}

body.embed .eyebrow {
  min-height: 22px;
  font-size: 10px;
}

body.embed .clock strong {
  font-size: clamp(28px, 2.8vw, 42px);
}

body.embed .clock span {
  margin-top: 6px;
  font-size: 12px;
}

body.embed .kpis article {
  min-height: 76px;
  padding: 10px 12px;
}

body.embed .kpis strong {
  margin-top: 6px;
  font-size: clamp(21px, 2.3vw, 32px);
}

body.embed .kpis small {
  margin-top: 6px;
}

body.embed .kpis article::after {
  width: 32px;
  height: 32px;
  right: 10px;
  bottom: 10px;
}

body.embed .dashboard-grid {
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

body.embed .panel {
  padding: 11px;
}

body.embed h2 {
  font-size: 15px;
}

body.embed .panel-title {
  margin-bottom: 8px;
}

body.embed .panel-title span,
body.embed .kpis span {
  font-size: 12px;
}

body.embed .donut-wrap {
  height: calc(100% - 30px);
}

body.embed .donut {
  width: min(142px, 100%);
}

body.embed .trend-chart {
  height: calc(100% - 30px);
  gap: 6px;
}

body.embed .bar-track {
  min-height: 0;
}

body.embed .legend-row,
body.embed .feed-row,
body.embed .alert-row,
body.embed .route-row {
  padding: 6px 8px;
}

body.embed .feed {
  max-height: calc(100% - 30px);
}

@media (max-height: 760px) and (min-width: 1000px) {
  .screen {
    padding: 12px;
    gap: 7px;
  }

  .screen-head {
    min-height: 78px;
    padding: 11px 18px;
  }

  .eyebrow {
    min-height: 22px;
    font-size: 10px;
  }

  h1 {
    margin-top: 6px;
    font-size: clamp(28px, 3vw, 42px);
  }

  .clock strong {
    font-size: clamp(30px, 3vw, 46px);
  }

  .clock span {
    margin-top: 6px;
    font-size: 12px;
  }

  .kpis {
    gap: 7px;
  }

  .kpis article {
    min-height: 74px;
    padding: 10px 12px;
  }

  .kpis strong {
    margin-top: 7px;
    font-size: clamp(25px, 2.45vw, 38px);
  }

  .kpis small {
    margin-top: 7px;
    font-size: 12px;
  }

  .kpis article::after {
    width: 32px;
    height: 32px;
    right: 10px;
    bottom: 10px;
  }

  .dashboard-grid {
    gap: 7px;
  }

  .panel {
    padding: 10px;
  }

  .panel-title {
    margin-bottom: 8px;
  }

  h2 {
    font-size: 16px;
  }

  .panel-title span,
  .kpis span {
    font-size: 12px;
  }

  .donut-wrap,
  .trend-chart {
    height: calc(100% - 30px);
  }

  .donut {
    width: min(160px, 100%);
  }

  .donut::after {
    font-size: 15px;
  }

  .legend,
  .feed,
  .alerts,
  .routes {
    gap: 7px;
  }

  .legend-row,
  .feed-row,
  .alert-row,
  .route-row {
    padding: 6px 8px;
  }

  .legend-row strong {
    font-size: 15px;
  }

  .bar-item {
    gap: 6px;
  }

  .bar-value,
  .feed-row span,
  .alert-row small,
  .online,
  .standby,
  .offline,
  .feed-row em,
  .alert-row b {
    font-size: 11px;
  }

  .feed {
    max-height: calc(100% - 30px);
  }
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
  }

  .orders-panel {
    grid-row: auto;
  }

  body.embed {
    overflow: hidden;
  }

  body.embed .dashboard-grid {
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.18fr) minmax(220px, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  body.embed .orders-panel {
    grid-row: span 2;
  }
}

@media (max-width: 720px) {
  body.embed {
    overflow: auto;
  }

  body.embed .screen-head {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.embed .screen-head::after {
    width: min(280px, 46%);
    opacity: 0.52;
  }

  body.embed .clock {
    min-width: 0;
    text-align: left;
  }

  body.embed .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.embed .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  body.embed .orders-panel {
    grid-row: auto;
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .screen {
    padding: 14px;
  }

  .screen-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
  }

  .clock {
    min-width: 0;
    text-align: left;
  }

  .kpis,
  .dashboard-grid,
  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .trend-chart {
    overflow-x: auto;
    grid-template-columns: repeat(7, minmax(74px, 1fr));
  }

  body.embed .screen {
    padding: 10px;
  }

  body.embed .screen-head {
    padding: 14px;
  }

  body.embed .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .kpis,
  body.embed .kpis {
    grid-template-columns: 1fr;
  }

  .feed-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .feed-row em,
  .feed-row b {
    justify-self: start;
  }

  .alert-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .alert-row b {
    grid-column: 2;
    justify-self: start;
  }
}
