:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #18292c;
  background: #eef2f3;
  font-synthesis: none;
  --card: #fff;
  --line: #dce5e5;
  --muted: #526568;
  --accent: #007566;
}

* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid #007566; outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { max-width: 1120px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }
.top { border-bottom: 1px solid var(--line); background: #f9fcfb; }
.top-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 740; }
.brand-mark {
  height: 24px;
  width: 24px;
  border-radius: 7px;
  background: var(--accent);
  display: grid;
  place-items: center;
}
.brand-mark::after {
  content: "";
  width: 12px;
  height: 11px;
  background: #dbfff4;
  clip-path: polygon(0 52%, 23% 52%, 43% 4%, 64% 78%, 77% 46%, 100% 46%, 100% 67%, 92% 67%, 62% 100%, 40% 41%, 32% 70%, 0 70%);
}
.button {
  min-height: 40px;
  min-width: 76px;
  padding: 7px 14px;
  border: 1px solid #cad8d8;
  border-radius: 10px;
  color: inherit;
  background: #fff;
  font-weight: 650;
  font-size: .875rem;
}
.button:hover { background: #e6f2ef; }
.button:disabled { opacity: .65; cursor: wait; }
main { padding-top: 34px; padding-bottom: 50px; }
.fleet { margin: 0 0 17px; }
.fleet-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fleet-head p { margin: 0; color: var(--muted); font-size: .875rem; }
.devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; max-height: 328px; overflow: auto; }
.device { min-width: 0; display: grid; gap: 5px; text-align: left; padding: 10px 12px; background: var(--card); border: 1px solid #cedada; border-radius: 10px; color: inherit; }
.device[aria-pressed="true"] { border-color: #007566; background: #e7f5f1; }
.device-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: .875rem; }
.device-status { color: var(--muted); font-size: .8125rem; }
.device-status[data-kind="online"] { color: #006454; }
.device-status[data-kind="alert"] { color: #9c331f; }
.device-meta { color: var(--muted); font-size: .75rem; line-height: 1.35; overflow-wrap: anywhere; }
.overview {
  padding: 34px;
  display: grid;
  grid-template-columns: 1.25fr minmax(185px, .75fr);
  gap: 24px;
  align-items: end;
  color: #eef9f6;
  border-radius: 22px;
  background: radial-gradient(ellipse at 82% 112%, #174b46, transparent 65%), #142b30;
}
.overview-main { min-width: 0; }
.status-line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 12px; color: #c3d6d5; font-size: .875rem; }
.connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #6d8889;
  border-radius: 999px;
  padding: 5px 10px;
  color: #e1eceb;
  font-weight: 720;
}
.connection::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.connection[data-kind="online"] { color: #91f2d8; border-color: #539584; }
.connection[data-kind="offline"] { color: #ffcb9a; border-color: #9c7655; }
h1 { font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.035em; line-height: 1.15; margin: 20px 0 8px; overflow-wrap: anywhere; }
.phase { color: #d1e6e2; font-size: 1rem; margin: 0; line-height: 1.5; }
.health { padding: 15px 17px; border-radius: 13px; border: 1px solid #567276; background: #0f272caa; }
.health-label { display: flex; justify-content: space-between; gap: 10px; font-size: .875rem; }
.health-label strong { font-variant-numeric: tabular-nums; }
progress { display: block; appearance: none; width: 100%; height: 7px; border: 0; border-radius: 999px; overflow: hidden; margin-top: 12px; background: #385259; accent-color: #7ae7c9; }
progress::-webkit-progress-bar { background: #385259; }
progress::-webkit-progress-value { background: #7ae7c9; border-radius: 999px; }
progress::-moz-progress-bar { background: #7ae7c9; }
.details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}
.details div { min-width: 0; padding: 16px 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.details dt { font-size: .875rem; color: var(--muted); }
.details dd { margin: 9px 0 0; font-size: 1rem; font-weight: 690; overflow-wrap: anywhere; }
.notice { background: #fff5e5; color: #704215; border: 1px solid #ebd7b9; padding: 11px 14px; border-radius: 10px; }
.activity { border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.device-controls { margin-top: 14px; }
.device-controls .activity-head { padding: 11px 16px; }
.control-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.control-buttons .button { min-height: 36px; min-width: 62px; }
.control-buttons .button:disabled { cursor: default; }
.stop-button { color: #a23027; border-color: #e0b9b2; }
.stop-button:hover { background: #fff1ee; }
#control-result { padding: 9px 16px; min-height: 38px; }
.activity-head { padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
h2 { font-size: 1.125rem; margin: 0; }
.muted { color: var(--muted); font-size: .8125rem; margin: 0; }
.telemetry { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; margin-bottom: 16px; }
.preview { overflow: hidden; }
.preview-frame { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: #142b30; color: #dae8e6; }
.preview-frame p { margin: 0; padding: 16px; }
.preview-frame img { display: block; width: 100%; height: auto; }
.character-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; margin: 0; }
.character-stats div { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.character-stats dt { color: var(--muted); font-size: .875rem; }
.character-stats dd { margin: 6px 0 0; font-weight: 700; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.character-stats dd.muted { font-weight: 400; }
.warehouse { margin-bottom: 16px; }
.warehouse-scroll { max-height: 280px; overflow: auto; }
.warehouse table { border-collapse: collapse; width: 100%; text-align: left; font-size: .875rem; }
.warehouse th, .warehouse td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.warehouse th { position: sticky; top: 0; color: var(--muted); background: #f6fafa; }
.warehouse td { font-variant-numeric: tabular-nums; }
.filters { display: inline-flex; padding: 3px; border-radius: 10px; background: #edf3f2; gap: 2px; }
.filters button { padding: 7px 11px; border-radius: 7px; border: 0; color: #405659; background: transparent; font-size: .875rem; }
.filters button[aria-pressed="true"] { color: #00594d; background: #fff; box-shadow: 0 1px 3px #163b3522; font-weight: 740; }
.empty { margin: 0; padding: 30px 20px; color: var(--muted); line-height: 1.65; }
.events { padding: 0; margin: 0; list-style: none; }
.events li { display: grid; grid-template-columns: 124px 55px 1fr; gap: 12px; align-items: baseline; padding: 12px 20px; border-top: 1px solid var(--line); }
.events li:first-child { border-top: 0; }
.event-time { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.event-level { width: fit-content; color: #455e64; background: #edf2f3; border-radius: 5px; font-size: .8125rem; padding: 2px 6px; }
.event-level[data-level="warning"] { color: #744409; background: #fff0d5; }
.event-level[data-level="alert"] { color: #9c331f; background: #ffebe6; }
.event-message { min-width: 0; line-height: 1.55; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .shell { padding-left: 16px; padding-right: 16px; }
  .top-inner { min-height: 58px; }
  main { padding-top: 19px; }
  .devices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .telemetry { grid-template-columns: 1fr; gap: 9px; }
  .character-stats { gap: 9px; padding: 12px; }
  .warehouse th, .warehouse td { padding: 9px 10px; }
  .overview { padding: 22px; grid-template-columns: 1fr; gap: 19px; border-radius: 16px; }
  h1 { margin-top: 16px; }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 17px; }
  .details div { padding: 13px 14px; }
  .activity-head { padding: 13px 12px; }
  .events li { padding: 10px 12px; grid-template-columns: auto 1fr; gap: 4px 9px; }
  .event-message { grid-column: 1 / -1; }
}
