:root {
  --dashboard-width: 1672px;
  --dashboard-height: 941px;
  --dashboard-scale: 1;
  --sidebar: #062440;
  --sidebar-deep: #031b31;
  --blue: #1677ff;
  --blue-2: #2f80ff;
  --text: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --line: #dfe7f1;
  --line-soft: #e8eef6;
  --surface: #ffffff;
  --bg: #f5f8fc;
  --green: #10b981;
  --teal: #14b8a6;
  --orange: #f59e0b;
  --red: #ef4444;
  --shadow: 0 4px 13px rgba(15, 23, 42, 0.045);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.icon-defs {
  display: none;
}

svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.app-frame {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.app {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  width: 1672px;
  min-height: 941px;
  background: var(--bg);
  transform: translate(var(--dashboard-offset-x, 0), var(--dashboard-offset-y, 0)) scale(var(--dashboard-scale));
  transform-origin: top left;
}

.sidebar {
  position: relative;
  flex: 0 0 192px;
  width: 192px;
  min-height: 941px;
  color: #d9e9fb;
  background:
    radial-gradient(circle at 26px 26px, rgba(42, 122, 255, 0.2), transparent 76px),
    linear-gradient(180deg, #082646 0%, #05233d 55%, #031b31 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 72px;
  padding: 0 26px 0 28px;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: linear-gradient(135deg, #1677ff 0%, #65b8ff 100%);
  clip-path: polygon(28% 0, 72% 0, 100% 50%, 72% 100%, 28% 100%, 0 50%);
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.28);
}

.brand-mark::before {
  position: absolute;
  content: "";
  inset: 8px 10px;
  background: #062440;
  clip-path: polygon(28% 0, 72% 0, 100% 50%, 72% 100%, 28% 100%, 0 50%);
}

.brand-mark::after {
  display: none;
}

.brand-mark span {
  display: none;
}

.brand-name {
  display: grid;
  gap: 3px;
  color: #fff;
  line-height: 1.05;
  white-space: nowrap;
}

.brand-name strong {
  font-size: 15px;
  font-weight: 760;
}

.brand-name span {
  color: #d9e9fb;
  font-size: 17px;
  font-weight: 760;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px 12px 72px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px 0 14px;
  border-radius: 6px;
  color: #d7e5f5;
  font-size: 15px;
  font-weight: 540;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.nav-item svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: #d2e3f7;
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.28);
}

.nav-item.active svg {
  color: #fff;
  fill: rgba(255, 255, 255, 0.12);
}

.nav-item span {
  flex: 1;
  white-space: nowrap;
}

.nav-item em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  color: #fff;
  background: #ef3b2d;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.nav-arrow {
  color: #d7e5f5;
  font-size: 16px;
  font-weight: 500;
}

.collapse-btn {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 6px;
  border: 0;
  border-top: 1px solid rgba(221, 235, 255, 0.1);
  color: #d7e5f5;
  background: transparent;
  font-size: 15px;
  cursor: pointer;
}

.collapse-btn span {
  font-size: 30px;
  line-height: 0;
}

.main-shell {
  display: flex;
  flex: 0 0 1480px;
  min-width: 0;
  width: 1480px;
  height: 941px;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 68px;
  height: 68px;
  padding: 0 25px 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.02);
}

.title-wrap,
.top-actions {
  display: flex;
  align-items: center;
}

.title-wrap {
  gap: 25px;
}

.icon-button,
.top-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  color: #334155;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.icon-button:hover,
.top-icon:hover,
.factory-select:hover,
.user-menu:hover {
  background: #f1f6ff;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.1;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 730;
  letter-spacing: 0;
}

.top-actions {
  gap: 17px;
}

.top-icon {
  position: relative;
  color: #334155;
}

.top-icon svg {
  width: 21px;
  height: 21px;
}

.top-icon.has-badge span {
  position: absolute;
  top: 0;
  right: -1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #ef3b2d;
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
}

.factory-select,
.user-menu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  border: 0;
  color: #0f172a;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  padding: 0 4px;
}

.factory-select small,
.user-menu small {
  color: #475569;
  font-size: 13px;
}

.user-menu span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #173b6d;
  background: #eaf2ff;
}

.user-menu svg {
  width: 18px;
  height: 18px;
  fill: rgba(23, 59, 109, 0.14);
}

.content {
  flex: 1;
  min-width: 0;
  padding: 18px 24px 10px 20px;
  overflow: auto;
  background: var(--bg);
}

.status-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 29px;
}

.import-actions {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.import-actions button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid #cfe0f5;
  border-radius: 5px;
  color: #1769d8;
  background: #fff;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.import-actions button:hover {
  border-color: #8dbdff;
  background: #f3f8ff;
}

.refresh-area {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
}

.refresh-area svg {
  width: 17px;
  height: 17px;
  color: #334155;
}

.refresh-area button,
.panel-filters button,
.segmented button {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #334155;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}

.refresh-area button {
  padding: 0 12px;
  font-weight: 650;
}

.time-label {
  margin-left: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-top: 10px;
}

.metric-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 136px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.metric-card:hover,
.panel[data-detail]:hover,
.rank-row:hover,
.data-table tbody tr:hover,
.device-types div:hover,
.monitor-img:hover {
  border-color: #b7d6ff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.08);
}

.metric-card:hover,
.rank-row:hover,
.data-table tbody tr:hover,
.device-types div:hover,
.monitor-img:hover {
  transform: translateY(-1px);
}

.metric-card h2 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.metric-card p {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
}

.metric-card strong {
  font-size: 36px;
  font-weight: 760;
  line-height: 1.1;
}

.metric-card p span {
  color: var(--body);
  font-size: 13px;
  font-weight: 540;
}

.metric-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.metric-foot b {
  font-size: 13px;
  font-weight: 760;
}

.good {
  color: var(--green);
}

.warn {
  color: #f97316;
}

.danger {
  color: var(--red);
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 61px;
  height: 61px;
  border-radius: 50%;
}

.metric-icon svg {
  width: 31px;
  height: 31px;
  color: #fff;
  stroke-width: 2;
}

.icon-green {
  background: radial-gradient(circle, #12b8a8 0 47%, #d2f8ef 48% 100%);
}

.icon-orange {
  background: radial-gradient(circle, #f97316 0 47%, #ffe5c7 48% 100%);
}

.icon-red {
  background: radial-gradient(circle, #ef4444 0 47%, #ffd8d8 48% 100%);
}

.icon-blue {
  background: radial-gradient(circle, #1677ff 0 47%, #dbeafe 48% 100%);
}

.dashboard-row {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.main-row {
  grid-template-columns: 1.35fr 1fr 1.58fr;
  align-items: stretch;
}

.bottom-row {
  grid-template-columns: 1.05fr 1.05fr 1.43fr 1.25fr;
  align-items: stretch;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel[data-detail] {
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 47px;
  padding: 0 15px;
}

.panel-head.compact {
  min-height: 45px;
  gap: 8px;
}

.panel-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 740;
  white-space: nowrap;
}

.panel-head h2 small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
}

.panel-head a,
.center-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
}

.panel-head a svg,
.center-link svg {
  width: 13px;
  height: 13px;
}

.overview-card,
.top-list-card,
.risk-card {
  height: 308px;
}

.small-chart-card,
.alerts-card,
.monitored-card {
  height: 284px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--body);
  font-size: 13px;
}

.data-table thead th {
  height: 36px;
  padding: 0 10px;
  color: #334155;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 690;
  text-align: left;
  white-space: nowrap;
}

.data-table tbody td {
  height: 36px;
  padding: 0 10px;
  border-top: 1px solid var(--line-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.data-table tbody tr:hover {
  background: #f8fbff;
}

.overview-table th:first-child,
.overview-table td:first-child {
  width: 32%;
}

.overview-table th:nth-child(2),
.overview-table td:nth-child(2) {
  width: 18%;
}

.overview-table th:nth-child(3),
.overview-table td:nth-child(3) {
  width: 18%;
}

.overview-table th:nth-child(4),
.overview-table td:nth-child(4) {
  width: 16%;
}

.device-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-weight: 610;
}

.device-cell img {
  flex: 0 0 29px;
  width: 29px;
  height: 22px;
  object-fit: contain;
  filter: saturate(0.88) contrast(0.96);
}

.run-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: 1px;
}

.run-dot.green {
  background: var(--green);
}

.run-dot.amber {
  background: var(--orange);
}

.run-dot.red {
  background: var(--red);
}

.tag,
.level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 43px;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 650;
}

.tag.normal {
  color: #16a34a;
  background: #effdf4;
  border: 1px solid #9be2b6;
}

.tag.attention {
  color: #f97316;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.tag.high {
  color: var(--red);
  background: #fff1f2;
  border: 1px solid #fecaca;
}

.rank-list {
  padding: 17px 21px 8px;
}

.rank-row {
  display: grid;
  grid-template-columns: 28px 110px minmax(80px, 1fr) 32px;
  align-items: center;
  gap: 10px;
  height: 44px;
  color: var(--text);
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.rank-row:hover {
  background: #f8fbff;
}

.rank-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  background: #a8b3c1;
  font-size: 12px;
  font-weight: 760;
}

.rank-row span.hot {
  background: #f59e0b;
}

.rank-row span.bronze {
  background: #e08b52;
}

.rank-row b {
  font-size: 14px;
  font-weight: 620;
  white-space: nowrap;
}

.rank-row em {
  color: var(--text);
  font-size: 13px;
  font-style: normal;
  text-align: right;
}

.bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #12b8a8, #1bb9ad);
  box-shadow: 5px 0 8px rgba(20, 184, 166, 0.18);
}

.segmented {
  display: inline-flex;
  height: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.segmented button {
  min-width: 54px;
  height: 28px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  color: var(--blue);
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px rgba(22, 119, 255, 0.35);
}

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 24px;
  color: #475569;
  font-size: 12px;
}

.chart-legend.single {
  height: 27px;
}

.chart-legend span {
  width: 18px;
  height: 0;
  border-top: 4px solid currentColor;
  border-radius: 999px;
}

.chart-legend .line-blue {
  color: var(--blue);
}

.chart-legend .line-green {
  color: var(--teal);
}

.chart-legend .line-orange {
  color: var(--orange);
}

.chart {
  display: block;
  width: 100%;
}

.chart-large {
  height: 220px;
  padding: 1px 17px 15px 14px;
}

.chart-small {
  height: 205px;
  padding: 0 14px 14px 14px;
}

.chart .grid-line {
  stroke: #e5eaf2;
  stroke-width: 1;
}

.chart .axis-text {
  fill: #475569;
  font-size: 11px;
  stroke: none;
}

.chart .line {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart .area {
  stroke: none;
}

.panel-filters {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.panel-filters button {
  min-width: 64px;
  height: 27px;
  padding: 0 7px;
  color: #475569;
  font-size: 12px;
  white-space: nowrap;
}

.alert-table th:first-child,
.alert-table td:first-child {
  width: 35%;
}

.alert-table th:nth-child(2),
.alert-table td:nth-child(2) {
  width: 23%;
}

.alert-table th:nth-child(3),
.alert-table td:nth-child(3) {
  width: 10%;
}

.alert-table th:nth-child(4),
.alert-table td:nth-child(4) {
  width: 22%;
}

.alert-table {
  font-size: 11px;
}

.alert-table thead th,
.alert-table tbody td {
  padding-right: 4px;
  padding-left: 4px;
}

.alert-table .level {
  min-width: 30px;
  height: 20px;
  padding: 0 5px;
  font-size: 11px;
}

.level.high {
  color: var(--red);
  background: #fff1f2;
  border: 1px solid #fecaca;
}

.level.mid {
  color: #f97316;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.level.low {
  color: #f59e0b;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.text-danger {
  color: var(--red);
  font-weight: 650;
}

.text-warn {
  color: #f97316;
  font-weight: 650;
}

.text-blue {
  color: var(--blue);
  font-weight: 650;
}

.text-good {
  color: #16a34a;
  font-weight: 650;
}

.monitor-img {
  display: block;
  width: calc(100% - 28px);
  height: 102px;
  margin: 0 14px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid #e5eaf2;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.device-types {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 82px;
  margin: 10px 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.device-types div {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid #edf2f7;
  text-align: center;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.device-types div:hover {
  background: #f8fbff;
}

.device-types div:last-child {
  border-right: 0;
}

.equip-sprite {
  display: block;
  width: 50px;
  height: 33px;
  margin-top: 2px;
  background-image: url("assets/mini-device-row.png");
  background-repeat: no-repeat;
  background-size: 212px 34px;
  filter: saturate(0.92) contrast(0.96);
}

.equip-sprite.async {
  background-position: -3px 0;
}

.equip-sprite.servo {
  background-position: -63px 0;
}

.equip-sprite.inverter {
  background-position: -128px 0;
}

.equip-sprite.reducer {
  background-position: -181px 0;
}

.device-types p {
  margin: 2px 0 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.device-types strong {
  margin-top: 3px;
  color: #0f3f8c;
  font-size: 20px;
  font-weight: 760;
  line-height: 1.1;
}

.device-types small {
  color: #0f3f8c;
  font-size: 12px;
  font-weight: 650;
}

.center-link {
  justify-content: center;
  height: 34px;
}

.footer {
  padding-top: 10px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}

/* Diagnosis page */
.diagnosis-app {
  height: var(--dashboard-height);
  max-width: var(--dashboard-width);
  overflow: hidden;
}

.diagnosis-nav {
  gap: 5px;
  padding-top: 9px;
}

.diagnosis-nav .nav-item {
  min-height: 40px;
}

.diagnosis-nav .nav-item.expanded {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.diagnosis-nav .nav-sub {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 32px;
  margin: -1px 4px -1px 46px;
  padding: 0 10px;
  border-radius: 6px;
  color: #b8d0ea;
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease;
}

.diagnosis-nav .nav-sub::before {
  position: absolute;
  left: -15px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 999px;
  background: rgba(184, 208, 234, 0.22);
  content: "";
}

.diagnosis-nav .nav-sub:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.diagnosis-nav .nav-sub.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(22, 119, 255, 0.96), rgba(47, 128, 255, 0.9));
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.22);
}

.diagnosis-nav .nav-sub.active::before {
  background: #65b8ff;
}

.diagnosis-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(var(--dashboard-height) - 68px);
  padding: 16px 22px 8px 18px;
  overflow: hidden;
}

.diagnosis-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  flex: 0 0 36px;
  min-width: 0;
  padding: 0 2px;
}

.breadcrumb,
.diagnosis-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.breadcrumb {
  gap: 7px;
  color: #64748b;
  font-size: 13px;
}

.breadcrumb button {
  max-width: 180px;
  height: 30px;
  padding: 0 3px;
  border: 0;
  color: #475569;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.breadcrumb button:last-child {
  color: #0f3f8c;
}

.breadcrumb span {
  color: #94a3b8;
  font-size: 17px;
}

.diagnosis-actions {
  justify-content: flex-end;
  gap: 8px;
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
}

.diagnosis-actions > svg {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  color: #334155;
}

.fault-playback-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 32px;
  padding: 3px 5px;
  border: 1px solid #dce9fb;
  border-radius: 7px;
  background: #f8fbff;
}

.fault-playback-controls button {
  height: 24px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid #cfe0f5;
  border-radius: 5px;
  color: #1769d8;
  background: #fff;
  font-size: 12px;
  font-weight: 720;
  line-height: 22px;
  white-space: nowrap;
  cursor: pointer;
}

.fault-playback-controls select {
  height: 24px;
  padding: 0 22px 0 7px;
  border: 1px solid #cfe0f5;
  border-radius: 5px;
  color: #0f3f8c;
  background: #fff;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.fault-playback-controls button:hover {
  border-color: #8dbdff;
  background: #eef6ff;
}

.fault-playback-controls button:disabled {
  color: #94a3b8;
  border-color: #e2e8f0;
  background: #f8fafc;
  cursor: not-allowed;
}

.fault-playback-controls em {
  min-width: 250px;
  max-width: 330px;
  padding: 0 6px;
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.fault-playback-controls.is-playing em {
  color: #0f766e;
}

.fault-playback-controls.is-realtime {
  border-color: #9be2b6;
  background: #f0fdf7;
}

.fault-playback-controls.is-realtime [data-action="connect-realtime-service"] {
  color: #047857;
  border-color: #9be2b6;
  background: #ecfdf5;
}

.device-edit-form {
  display: grid;
  gap: 14px;
}

.device-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.device-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.device-form-grid label.wide {
  grid-column: 1 / -1;
}

.device-form-grid input,
.device-form-grid select {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid #d6e0ec;
  border-radius: 6px;
  color: #0f172a;
  background: #fff;
  font-size: 13px;
  outline: none;
}

.device-form-grid input:focus,
.device-form-grid select:focus {
  border-color: #69a8ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.device-form-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: #dc2626;
  font-size: 12px;
}

.outline-action,
.primary-action,
.panel-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.outline-action {
  height: 32px;
  padding: 0 13px;
  border: 1px solid #cfe0f5;
  color: #1769d8;
  background: #fff;
}

.outline-action svg,
.primary-action svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
}

.outline-action:hover {
  border-color: #8dbdff;
  background: #f3f8ff;
  box-shadow: 0 6px 14px rgba(22, 119, 255, 0.08);
}

.primary-action {
  height: 38px;
  border: 1px solid #1677ff;
  color: #fff;
  background: linear-gradient(135deg, #1677ff, #2f80ff);
  box-shadow: 0 9px 18px rgba(22, 119, 255, 0.2);
}

.primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(22, 119, 255, 0.25);
}

.primary-action:disabled,
.primary-action.is-loading {
  cursor: wait;
  opacity: 0.78;
  transform: none;
}

.diagnosis-top {
  display: grid;
  grid-template-columns: 455px minmax(0, 1fr);
  gap: 14px;
  flex: 0 0 126px;
  min-width: 0;
}

.device-profile {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  height: 126px;
  padding: 14px;
}

.device-profile img {
  display: block;
  width: 136px;
  height: 92px;
  object-fit: contain;
  border: 1px solid #e5eaf2;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.06), rgba(20, 184, 166, 0.04)),
    #f8fafc;
  filter: saturate(0.94) contrast(0.98);
}

.device-profile > div {
  min-width: 0;
}

.device-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin-bottom: 8px;
}

.device-title-line h2 {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 760;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 22px;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.status-pill.green {
  color: #16a34a;
  background: #effdf4;
  border: 1px solid #9be2b6;
}

.status-pill.blue {
  color: #1769d8;
  background: #eef6ff;
  border: 1px solid #b7d6ff;
}

.status-pill.orange {
  color: #c2410c;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.status-pill.gray {
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

.device-status-text.green {
  color: #16a34a;
}

.device-status-text.blue {
  color: #1769d8;
}

.device-status-text.orange {
  color: #f97316;
}

.device-status-text.gray {
  color: #64748b;
}

.device-profile dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  margin: 0;
}

.device-profile dl div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.25;
}

.device-profile dt,
.device-profile dd {
  margin: 0;
  min-width: 0;
}

.device-profile dt {
  font-weight: 650;
  white-space: nowrap;
}

.device-profile dd {
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diagnosis-summary {
  display: grid;
  grid-template-columns: 118px 118px 118px 128px minmax(180px, 1fr) 118px;
  gap: 10px;
  align-items: stretch;
  height: 126px;
  padding: 14px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid #e8eef6;
  border-radius: 6px;
  background: #f8fbff;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.summary-item:hover {
  border-color: #b7d6ff;
  background: #fff;
  box-shadow: 0 7px 16px rgba(22, 119, 255, 0.08);
}

.summary-item span,
.summary-item small {
  min-width: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-item strong {
  display: block;
  min-width: 0;
  margin-top: 7px;
  color: var(--text);
  font-size: 20px;
  font-weight: 760;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-item strong small {
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

.summary-item .level {
  align-self: flex-start;
  margin-top: 6px;
}

.summary-item.alert-time strong {
  font-size: 15px;
}

.summary-item.alert-time small {
  margin-top: 5px;
  color: #f97316;
  font-weight: 650;
}

.risk-orange {
  color: #f97316 !important;
  font-weight: 700;
}

.view-device {
  align-self: center;
  width: 100%;
  height: 36px;
}

.diagnosis-main {
  display: grid;
  grid-template-columns: 630px 300px minmax(520px, 1fr);
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.diag-left,
.diag-right {
  display: grid;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

.diag-left {
  grid-template-rows: 168px 168px minmax(0, 1fr);
}

.diag-right {
  grid-template-rows: minmax(0, 1fr);
}

.wave-card,
.spectrum-card,
.feature-card,
.conclusion-card {
  min-height: 0;
}

.wave-card,
.spectrum-card {
  display: flex;
  flex-direction: column;
}

.diag-panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 46px;
  min-width: 0;
  padding: 0 13px 0 15px;
  border-bottom: 1px solid var(--line-soft);
}

.diag-panel-head h2 {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 740;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diag-panel-head p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.diag-panel-head p b {
  color: #334155;
  font-weight: 720;
}

.panel-tools {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  margin-left: auto;
}

.panel-tools button {
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  color: #475569;
  background: #fff;
}

.panel-tools button:hover {
  border-color: #8dbdff;
  background: #f3f8ff;
}

.head-action {
  height: 26px;
  padding: 0 9px;
  border: 1px solid #cfe0f5;
  border-radius: 6px;
  color: #1769d8;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.head-action:hover {
  border-color: #8dbdff;
  background: #f3f8ff;
}

.conclusion-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.conclusion-head-actions > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
}

.panel-tools button:last-child {
  width: 30px;
  padding: 0;
}

.panel-tools svg {
  width: 15px;
  height: 15px;
}

.wave-layout {
  display: grid;
  grid-template-rows: 30px minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 12px 10px;
}

.axis-values {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

.axis-values p {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: #475569;
  font-size: 12px;
  white-space: nowrap;
}

.axis-values b {
  color: #0f172a;
  font-weight: 720;
}

.dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot.blue {
  background: var(--blue);
}

.dot.green {
  background: var(--teal);
}

.dot.orange {
  background: var(--orange);
}

.diagnosis-chart,
.diagnosis-spectrum {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px solid #edf2f7;
  border-radius: 6px;
  background:
    linear-gradient(#e9eef6 1px, transparent 1px) 0 0 / 100% 24px,
    linear-gradient(90deg, #e9eef6 1px, transparent 1px) 0 0 / 48px 100%,
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.diagnosis-chart {
  height: 100%;
}

.diagnosis-spectrum {
  flex: 1 1 auto;
  height: auto;
  margin: 10px 12px 12px;
  width: calc(100% - 24px);
}

.diagnosis-chart .grid-line,
.diagnosis-spectrum .grid-line {
  stroke: #e5eaf2;
  stroke-width: 1;
}

.diagnosis-chart .axis-text,
.diagnosis-spectrum .axis-text {
  fill: #475569;
  font-size: 11px;
  stroke: none;
}

.diagnosis-chart .line,
.diagnosis-spectrum .line {
  fill: none;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.feature-card,
.conclusion-card {
  display: flex;
  flex-direction: column;
}

.feature-card .panel-head,
.conclusion-card .panel-head {
  flex: 0 0 47px;
  border-bottom: 1px solid var(--line-soft);
}

.feature-list {
  display: grid;
  align-content: start;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 9px 8px 6px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cfe0f5 transparent;
}

.feature-list:empty::before {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 86px;
  border: 1px dashed #cfe0f5;
  border-radius: 6px;
  color: #94a3b8;
  background: #f8fbff;
  font-size: 12px;
  content: "等待诊断数据";
}

.feature-item,
.feature-row,
.feature-metric,
.feature-list > div,
.feature-list > button {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 66px 38px 44px;
  gap: 0 5px;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  padding: 6px 5px 6px 8px;
  border: 1px solid #e8eef6;
  border-radius: 6px;
  color: #334155;
  background: #f8fbff;
  text-align: left;
}

.feature-list > button {
  font: inherit;
  cursor: pointer;
}

.feature-item:hover,
.feature-row:hover,
.feature-metric:hover,
.feature-list > div:hover,
.feature-list > button:hover {
  border-color: #b7d6ff;
  background: #fff;
}

.feature-item span,
.feature-row span,
.feature-metric span,
.feature-list > div span,
.feature-list > button span {
  min-width: 0;
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feature-item strong,
.feature-row strong,
.feature-metric strong,
.feature-list > div strong,
.feature-list > button strong {
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feature-item em,
.feature-row em,
.feature-metric em,
.feature-list > div em,
.feature-list > button em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 4px;
  color: #1769d8;
  background: #eef6ff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 19px;
  white-space: nowrap;
}

.feature-name {
  grid-column: 1;
}

.feature-value {
  grid-column: 2;
  text-align: left;
}

.feature-state {
  grid-column: 4;
}

.feature-bar {
  grid-column: 2 / 4;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.feature-bar i,
.feature-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1677ff, #14b8a6);
}

.feature-spark {
  grid-column: 3;
  justify-self: end;
  width: 42px;
  height: 20px;
  overflow: hidden;
}

.feature-spark path {
  fill: none;
  stroke: #1677ff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-spark-empty {
  grid-column: 3;
  justify-self: center;
  color: #94a3b8 !important;
  font-variant-numeric: tabular-nums;
}

.feature-item em.normal {
  color: #16a34a;
  background: #effdf4;
  border: 1px solid #9be2b6;
}

.feature-item em.warn {
  color: #f97316;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.feature-item em.critical {
  color: #b91c1c;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.feature-item em.missing {
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

.more-feature {
  flex: 0 0 38px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: #fff;
  cursor: pointer;
}

.conclusion-alert {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  flex: 0 0 70px;
  margin: 10px 15px 8px;
  padding: 10px 13px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  background: linear-gradient(180deg, #fff7ed, #fffaf5);
}

.conclusion-alert svg {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  color: #f97316;
  fill: rgba(249, 115, 22, 0.08);
}

.conclusion-alert strong {
  min-width: 0;
  color: #9a3412;
  font-size: 16px;
  font-weight: 780;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conclusion-alert span {
  min-width: 0;
  color: #c2410c;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conclusion-alert em {
  grid-column: 2;
  color: #9a3412;
  font-size: 12px;
  font-style: normal;
}

.conclusion-alert em b {
  font-size: 15px;
}

.conclusion-alert.is-critical {
  border-color: #fecaca;
  background: #fff7f7;
}

.conclusion-alert.is-critical svg,
.conclusion-alert.is-critical strong,
.conclusion-alert.is-critical span,
.conclusion-alert.is-critical em {
  color: #b91c1c;
}

.conclusion-alert.is-normal {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.conclusion-alert.is-normal svg,
.conclusion-alert.is-normal strong,
.conclusion-alert.is-normal span,
.conclusion-alert.is-normal em {
  color: #15803d;
}

.conclusion-copy {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 17px;
  overflow-x: hidden;
  overflow-y: auto;
  color: #334155;
  font-size: 12.5px;
  line-height: 1.36;
  scrollbar-width: thin;
  scrollbar-color: #cfe0f5 transparent;
}

.conclusion-copy p {
  margin: 0 0 4px;
}

.conclusion-copy b {
  color: #0f172a;
  font-weight: 740;
}

.conclusion-copy ul,
.conclusion-copy ol {
  margin: 0 0 4px;
  padding-left: 20px;
}

.conclusion-copy li {
  margin: 0 0 2px;
  padding-left: 1px;
  overflow-wrap: anywhere;
}

.conclusion-action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) repeat(3, minmax(0, 0.9fr));
  gap: 6px;
  flex: 0 0 38px;
  margin: 6px 15px 0;
}

.conclusion-action-grid .primary-action,
.conclusion-action-grid .secondary-action {
  width: 100%;
  height: 34px;
  margin: 0;
  padding: 0 9px;
  font-size: 12px;
  white-space: nowrap;
}

.conclusion-action-grid .secondary-action {
  border: 1px solid #cfe0f5;
  border-radius: 6px;
  color: #1769d8;
  background: #fff;
  font-weight: 740;
  cursor: pointer;
}

.conclusion-action-grid .secondary-action:hover {
  border-color: #8dbdff;
  background: #eef6ff;
}

.conclusion-action-grid button:disabled {
  color: #94a3b8;
  border-color: #e2e8f0;
  background: #f8fafc;
  cursor: not-allowed;
}

.agent-mini-panel {
  flex: 0 0 128px;
  margin: 7px 15px 11px;
  padding: 8px 9px;
  border: 1px solid #e8eef6;
  border-radius: 6px;
  background: #f8fbff;
  overflow: hidden;
}

.agent-mini-panel #agentSummary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.agent-mini-panel #agentSummary div {
  display: grid;
  min-width: 0;
}

.agent-mini-panel #agentSummary strong,
.agent-mini-panel #agentDraft {
  min-width: 0;
  color: #0f172a;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-mini-panel #agentSummary span {
  color: #64748b;
  font-size: 11px;
}

.agent-mini-panel #agentSummary em {
  flex: 0 0 auto;
  padding: 0 7px;
  border-radius: 999px;
  color: #1769d8;
  background: #eef6ff;
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  line-height: 20px;
}

.agent-mini-panel #agentSummary em.running,
.agent-mini-panel #agentSummary em.waiting {
  color: #c2410c;
  background: #fff7ed;
}

.agent-mini-panel #agentSummary em.done {
  color: #15803d;
  background: #f0fdf4;
}

.agent-mini-panel #agentSteps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}

.agent-step {
  min-width: 0;
  height: 38px;
  border: 1px solid #e5eaf2;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
}

.agent-step i {
  display: block;
  height: 3px;
  background: #cbd5e1;
}

.agent-step strong,
.agent-step span {
  display: block;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-step strong {
  margin-top: 3px;
  color: #334155;
  font-size: 10.5px;
  font-weight: 760;
}

.agent-step span {
  color: #64748b;
  font-size: 10px;
}

.agent-step.done i {
  background: #22c55e;
}

.agent-step.active i {
  background: #1677ff;
}

.agent-step.blocked i {
  background: #f97316;
}

.agent-step.error i {
  background: #ef4444;
}

.agent-mini-panel #agentDraft {
  display: -webkit-box;
  margin: 7px 0 0;
  color: #475569;
  font-size: 11.5px;
  line-height: 1.35;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.diagnosis-content .footer {
  flex: 0 0 22px;
  padding-top: 4px;
  line-height: 18px;
}

[role="button"]:focus-visible,
button:focus-visible,
a:focus-visible,
.nav-item:focus-visible,
.nav-sub:focus-visible,
.monitor-img:focus-visible {
  outline: 2px solid rgba(22, 119, 255, 0.72);
  outline-offset: 2px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0);
  pointer-events: none;
  transition: background-color 180ms ease;
}

.drawer-backdrop.open {
  background: rgba(15, 23, 42, 0.18);
  pointer-events: auto;
}

.detail-drawer {
  width: 420px;
  max-width: calc(100vw - 24px);
  height: 100vh;
  border-left: 1px solid #d9e5f3;
  background: #fff;
  box-shadow: -18px 0 36px rgba(15, 23, 42, 0.14);
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.drawer-backdrop.open .detail-drawer {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-head p {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.drawer-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 760;
}

.drawer-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #475569;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.drawer-body {
  height: calc(100vh - 78px);
  padding: 16px 18px 22px;
  overflow: auto;
}

.drawer-device {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fbff;
}

.drawer-device img {
  width: 96px;
  height: 70px;
  object-fit: contain;
}

.drawer-device h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.drawer-device p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.detail-list {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
}

.detail-list div {
  display: grid;
  grid-template-columns: 112px 1fr;
  min-height: 42px;
  border-top: 1px solid var(--line-soft);
}

.detail-list div:first-child {
  border-top: 0;
}

.detail-list dt,
.detail-list dd {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 12px;
  font-size: 13px;
}

.detail-list dt {
  color: #475569;
  background: #f8fafc;
  font-weight: 650;
}

.detail-list dd {
  color: var(--text);
  word-break: break-word;
}

.drawer-items {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
}

.drawer-items li {
  padding: 10px 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--body);
  font-size: 13px;
}

.drawer-items li:first-child {
  border-top: 0;
}

.drawer-note {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  color: #23476f;
  background: #f3f8ff;
  font-size: 13px;
  line-height: 1.65;
}

.drawer-preview {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.drawer-actions-left {
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-actions button {
  height: 34px;
  padding: 0 16px;
  border: 1px solid #1677ff;
  border-radius: 6px;
  color: #fff;
  background: #1677ff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.model-form {
  display: grid;
  gap: 8px;
}

.model-form label {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.model-form input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  font-size: 13px;
}

.model-form input:focus {
  outline: 2px solid rgba(22, 119, 255, 0.42);
  outline-offset: 2px;
  border-color: #8dbdff;
}

.model-status {
  min-height: 34px;
  padding: 9px 10px;
  border: 1px solid #cfe0f5;
  border-radius: 6px;
  color: #23476f;
  background: #f3f8ff;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

.model-status.ok {
  color: #166534;
  background: #effdf4;
  border-color: #9be2b6;
}

.model-status.warn {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}

.model-status.error {
  color: #b91c1c;
  background: #fff1f2;
  border-color: #fecaca;
}

.model-status.loading {
  color: #1769d8;
  background: #eef6ff;
  border-color: #b7d6ff;
}

.drawer-subhead {
  margin: 14px 0 8px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 760;
}

.agent-drawer-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #334155;
  font-size: 13px;
  line-height: 1.7;
}

.agent-log-list,
.work-order-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.agent-log-item {
  display: grid;
  grid-template-columns: 132px 92px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid #e8eef6;
  border-radius: 7px;
  background: #f8fbff;
}

.agent-log-item span {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.agent-log-item strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.agent-log-item p {
  min-width: 0;
  margin: 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}

.agent-log-item.warn {
  border-color: #fed7aa;
  background: #fff7ed;
}

.agent-log-item.error {
  border-color: #fecaca;
  background: #fff1f2;
}

.agent-log-item.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.work-order-list button {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 56px;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #e8eef6;
  border-radius: 7px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.work-order-list button:hover {
  border-color: #b7d6ff;
  background: #f8fbff;
}

.work-order-list strong,
.work-order-list span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-order-list strong {
  color: #1769d8;
  font-size: 12px;
  font-weight: 760;
}

.work-order-list span {
  color: #334155;
  font-size: 12px;
}

.work-order-list em {
  justify-self: end;
  padding: 0 7px;
  border-radius: 4px;
  color: #16a34a;
  background: #effdf4;
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  line-height: 21px;
  white-space: nowrap;
}

.series-input-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.series-input {
  display: block;
  width: 100%;
  min-height: 210px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #f8fafc;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}

.series-input:focus {
  outline: 2px solid rgba(22, 119, 255, 0.45);
  outline-offset: 2px;
  border-color: #8dbdff;
  background: #fff;
}

.series-input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.series-input-actions button {
  height: 34px;
  padding: 0 16px;
  border: 1px solid #1677ff;
  border-radius: 6px;
  color: #fff;
  background: #1677ff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  min-width: 220px;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid #b7d6ff;
  border-radius: 8px;
  color: #103e7a;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}
