:root {
  color-scheme: dark;
  --bg: #061017;
  --bg-deep: #03090e;
  --panel: rgba(11, 24, 34, 0.88);
  --panel-solid: #0b1822;
  --panel-soft: rgba(16, 34, 46, 0.72);
  --line: rgba(125, 211, 252, 0.13);
  --line-strong: rgba(103, 232, 249, 0.28);
  --text: #e6f4f8;
  --muted: #78909f;
  --subtle: #4c6674;
  --cyan: #32d6e8;
  --cyan-bright: #73efff;
  --blue: #3b82f6;
  --green: #27d796;
  --red: #ff5267;
  --amber: #ffb84d;
  --purple: #a78bfa;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius-lg: 20px;
  --radius-md: 15px;
  --radius-sm: 10px;
  font-family:
    Inter, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  font-synthesis: none;
}

:root[data-cb-theme="light"] {
  color-scheme: light;
  --bg: #eef6fb;
  --bg-deep: #e2eef5;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #f8fcff;
  --panel-soft: rgba(235, 246, 252, 0.84);
  --line: rgba(21, 103, 140, 0.15);
  --line-strong: rgba(0, 154, 199, 0.28);
  --text: #102b3b;
  --muted: #56788b;
  --subtle: #7593a3;
  --cyan: #009bc5;
  --cyan-bright: #007fa5;
  --green: #00a978;
  --red: #df365b;
  --amber: #d98b00;
  --shadow: 0 24px 60px rgba(34, 82, 105, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-deep);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 16% -10%, rgba(23, 118, 140, 0.16), transparent 34%),
    radial-gradient(circle at 85% 12%, rgba(37, 99, 235, 0.12), transparent 31%),
    linear-gradient(145deg, #061017 0%, #07131c 46%, #040b11 100%);
}

:root[data-cb-theme="light"] body {
  background:
    radial-gradient(circle at 16% -10%, rgba(0, 155, 197, 0.13), transparent 34%),
    radial-gradient(circle at 85% 12%, rgba(101, 73, 223, 0.09), transparent 31%),
    linear-gradient(145deg, #eef6fb 0%, #f8fcff 46%, #e8f2f7 100%);
}

body.drawer-open {
  overflow: hidden;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-grid {
  position: fixed;
  z-index: -3;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(87, 203, 223, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 203, 223, 0.15) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}

.page-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    112deg,
    transparent 0%,
    rgba(107, 232, 246, 0.1) 49.8%,
    transparent 50.2%
  );
  background-size: 320px 320px;
}

.page-glow {
  position: fixed;
  z-index: -2;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(110px);
  opacity: 0.1;
}

.page-glow-left {
  top: 32%;
  left: -15rem;
  background: var(--cyan);
}

.page-glow-right {
  right: -14rem;
  bottom: 4%;
  background: var(--blue);
}

.dashboard-shell {
  width: min(100%, 1920px);
  min-height: 100vh;
  padding: clamp(16px, 2vw, 34px);
  margin: 0 auto;
}

.dashboard-header {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(690px, 2fr);
  gap: clamp(22px, 3vw, 56px);
  align-items: center;
  min-height: 128px;
  padding: 20px clamp(20px, 2vw, 34px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(115deg, rgba(20, 44, 57, 0.72), rgba(8, 19, 28, 0.78)),
    var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 17px;
}

.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%);
  color: var(--cyan-bright);
  background: linear-gradient(145deg, rgba(50, 214, 232, 0.23), rgba(59, 130, 246, 0.08));
  box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.46);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 5px;
  clip-path: inherit;
  border: 1px solid rgba(103, 232, 249, 0.2);
}

.brand-mark span {
  position: relative;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  margin: 0;
  color: #f2fbfd;
  font-size: clamp(25px, 2.1vw, 34px);
  font-weight: 720;
  line-height: 1;
  letter-spacing: -0.035em;
}

.brand-copy > p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid rgba(39, 215, 150, 0.2);
  border-radius: 999px;
  color: #76e9bc;
  background: rgba(39, 215, 150, 0.07);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.live-pill i,
.chat-identity i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px rgba(39, 215, 150, 0.9);
}

.overview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(125px, 1fr)) minmax(160px, 1.15fr);
  min-width: 0;
  border: 1px solid rgba(125, 211, 252, 0.1);
  border-radius: 14px;
  background: rgba(4, 14, 21, 0.36);
}

.overview-item,
.overview-time {
  position: relative;
  min-width: 0;
  min-height: 78px;
  padding: 14px clamp(13px, 1.35vw, 24px);
}

.overview-item {
  display: flex;
  align-items: center;
  gap: 13px;
}

.overview-item:not(:first-child)::before,
.overview-time::before {
  content: "";
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: 0;
  width: 1px;
  background: linear-gradient(transparent, rgba(125, 211, 252, 0.17), transparent);
}

.overview-item p,
.overview-time p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.overview-item strong {
  color: #effcff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(24px, 2vw, 31px);
  font-weight: 600;
  line-height: 1;
}

.overview-item strong small {
  margin-left: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.overview-icon {
  position: relative;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(39, 215, 150, 0.3);
  border-radius: 50%;
  box-shadow: inset 0 0 12px rgba(39, 215, 150, 0.08);
}

.overview-rate-gauge {
  --cb-gauge-size: 42px;
}

.overview-rate-gauge.cb-online-gauge::before {
  inset: 5px;
}

.overview-rate-gauge .cb-online-gauge__value {
  font-size: 0.69rem;
}

.overview-rate-gauge .cb-online-gauge__label {
  display: none;
}

.overview-icon::before,
.overview-icon::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.overview-icon::before {
  inset: 6px;
  background: var(--green);
  box-shadow: 0 0 14px rgba(39, 215, 150, 0.85);
}

.overview-icon::after {
  inset: -5px;
  border: 1px solid rgba(39, 215, 150, 0.12);
  animation: status-pulse 2.4s ease-out infinite;
}

.overview-glyph {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(50, 214, 232, 0.2);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(50, 214, 232, 0.06);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.memory-glyph {
  color: #8da8ff;
  border-color: rgba(99, 133, 255, 0.2);
  background: rgba(99, 133, 255, 0.07);
}

.overview-time {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
}

.theme-toggle {
  position: absolute;
  top: 8px;
  right: 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 8px;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.refresh-button:hover,
.refresh-button:focus-visible {
  color: var(--cyan);
  border-color: var(--line-strong);
  outline: none;
}

.overview-time time {
  color: var(--cyan-bright);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(18px, 1.65vw, 25px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
}

.overview-time > span {
  margin-top: 6px;
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.07em;
}

@keyframes status-pulse {
  0% {
    opacity: 0.6;
    transform: scale(0.65);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

.dashboard-main {
  padding: clamp(24px, 3vw, 42px) 2px 32px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 0 4px;
}

.section-heading h2 {
  margin: 0;
  color: #dff6fa;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 10px;
  cursor: pointer;
}

.sync-state time {
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, monospace;
  white-space: nowrap;
}

.sync-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(50, 214, 232, 0.7);
}

.sync-state.is-loading .sync-dot {
  animation: sync-blink 1s ease-in-out infinite;
}

.sync-state.is-error {
  color: #ff9baa;
}

.sync-state.is-error .sync-dot {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 82, 103, 0.6);
}

@keyframes sync-blink {
  50% {
    opacity: 0.25;
  }
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(14px, 1.5vw, 22px);
}

.server-card {
  position: relative;
  min-width: 0;
  min-height: 290px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.13);
  border-radius: var(--radius-md);
  outline: none;
  background:
    linear-gradient(145deg, rgba(17, 37, 49, 0.9), rgba(7, 18, 27, 0.92)),
    var(--panel);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.server-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 1px;
  opacity: 0.9;
  background: linear-gradient(90deg, transparent, var(--card-accent, var(--cyan)), transparent);
}

.server-card::after {
  content: "";
  position: absolute;
  top: -90px;
  right: -80px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.05;
  background: var(--card-accent, var(--cyan));
  filter: blur(26px);
}

.server-card:hover,
.server-card:focus-visible {
  z-index: 1;
  border-color: rgba(103, 232, 249, 0.35);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.28),
    inset 0 0 28px rgba(50, 214, 232, 0.025);
  transform: translateY(-3px);
}

.server-card:focus-visible {
  outline: 2px solid rgba(115, 239, 255, 0.56);
  outline-offset: 3px;
}

.server-card[data-state="down"] {
  --card-accent: var(--red);
  border-color: rgba(255, 82, 103, 0.17);
  background:
    linear-gradient(145deg, rgba(38, 26, 33, 0.82), rgba(12, 16, 23, 0.94)),
    var(--panel);
}

.server-card[data-state="pending"] {
  --card-accent: #91a4ae;
  border-color: rgba(145, 164, 174, 0.2);
  background:
    linear-gradient(145deg, rgba(28, 39, 47, 0.82), rgba(12, 20, 27, 0.92)),
    var(--panel);
}

:root[data-cb-theme="light"] .server-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(233, 245, 251, 0.92)),
    var(--panel);
  box-shadow: 0 12px 34px rgba(34, 82, 105, 0.11);
}

:root[data-cb-theme="light"] .server-card[data-state="down"] {
  background: linear-gradient(145deg, #fff7f8, #fbecef);
}

:root[data-cb-theme="light"] .server-card[data-state="pending"] {
  background: linear-gradient(145deg, #f8fbfc, #eaf1f4);
}

.card-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.provider-badge {
  --provider-color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 5px 9px 5px 7px;
  border: 1px solid color-mix(in srgb, var(--provider-color) 32%, transparent);
  border-radius: 7px;
  color: color-mix(in srgb, var(--provider-color) 84%, white);
  background: color-mix(in srgb, var(--provider-color) 10%, transparent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.provider-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--provider-color);
  box-shadow: 0 0 9px color-mix(in srgb, var(--provider-color) 55%, transparent);
}

.provider-aliyun {
  --provider-color: #ff7a1a;
}

.provider-tencent {
  --provider-color: #2589ff;
}

.provider-oracle {
  --provider-color: #ff4b4b;
}

.provider-google {
  --provider-color: #4f9dff;
}

.provider-local {
  --provider-color: #32d999;
}

.provider-unknown {
  --provider-color: #91a4ae;
}

.status-tag,
.drawer-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #79e8bc;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-tag::before,
.drawer-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(39, 215, 150, 0.8);
}

.server-card[data-state="down"] .status-tag,
.drawer-status.is-down {
  color: #ff8a9a;
}

.server-card[data-state="pending"] .status-tag,
.drawer-status.is-pending {
  color: #91a4ae;
}

.server-card[data-state="down"] .status-tag::before,
.drawer-status.is-down::before {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 82, 103, 0.8);
}

.server-card[data-state="pending"] .status-tag::before,
.drawer-status.is-pending::before {
  background: #91a4ae;
  box-shadow: 0 0 8px rgba(145, 164, 174, 0.45);
}

.status-tag[data-cb-pulse="up"]::before,
.drawer-status[data-cb-pulse="up"]::before,
.live-pill [data-cb-pulse="online"],
.sync-dot[data-cb-pulse] {
  animation: cb-main-status-breathe 2.2s ease-in-out infinite;
}

@keyframes cb-main-status-breathe {
  50% {
    opacity: 0.48;
    box-shadow: 0 0 17px currentColor;
  }
}

.card-identity {
  position: relative;
  z-index: 1;
  margin: 17px 0 13px;
}

.card-name-row {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 9px;
}

.card-name-row h3 {
  max-width: 72%;
  margin: 0;
  overflow: hidden;
  color: #f1fbfd;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-name {
  overflow: hidden;
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.card-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta span + span::before {
  content: "/";
  padding-right: 9px;
  color: #2e4a58;
}

.metric-rings {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 4px;
  border-top: 1px solid rgba(125, 211, 252, 0.08);
  border-bottom: 1px solid rgba(125, 211, 252, 0.08);
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.metric-ring {
  --ring-color: var(--cyan);
  --ring-angle: 0deg;
  --track-color: rgba(118, 154, 169, 0.13);
  position: relative;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    var(--ring-color) 0deg,
    var(--ring-color) var(--ring-angle),
    var(--track-color) var(--ring-angle),
    var(--track-color) 360deg
  );
  box-shadow: 0 0 20px color-mix(in srgb, var(--ring-color) 8%, transparent);
}

.metric-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(125, 211, 252, 0.06);
  border-radius: 50%;
  background: #0a1821;
}

:root[data-cb-theme="light"] .metric-ring::before {
  background: #f8fcff;
}

.metric-value {
  position: relative;
  display: flex;
  align-items: baseline;
  color: #e9f9fb;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.metric-value small {
  margin-left: 1px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
}

.metric-label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.metric-item.memory .metric-ring {
  --ring-color: #738dff;
}

.metric-item.disk .metric-ring {
  --ring-color: #a78bfa;
}

.metric-ring.is-warning {
  --ring-color: var(--amber);
}

.metric-ring.is-critical {
  --ring-color: var(--red);
}

.server-card[data-state="down"] .metric-ring {
  --ring-color: #75515a;
  opacity: 0.68;
}

.server-card[data-state="pending"] .metric-ring {
  --ring-color: #71838d;
  opacity: 0.58;
}

.card-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 13px;
}

.rtt-value {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.rtt-signal {
  display: flex;
  align-items: flex-end;
  width: 14px;
  height: 12px;
  gap: 2px;
}

.rtt-signal i {
  display: block;
  width: 2px;
  border-radius: 2px;
  background: var(--green);
}

.rtt-signal i:nth-child(1) {
  height: 4px;
}

.rtt-signal i:nth-child(2) {
  height: 7px;
}

.rtt-signal i:nth-child(3) {
  height: 10px;
}

.server-card[data-latency="medium"] .rtt-signal i {
  background: var(--amber);
}

.server-card[data-latency="high"] .rtt-signal i,
.server-card[data-state="down"] .rtt-signal i {
  background: var(--red);
}

.server-card[data-latency="unknown"] .rtt-signal i,
.server-card[data-state="pending"] .rtt-signal i {
  background: #71838d;
}

.rtt-value span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.rtt-value strong {
  color: #cde8ed;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
}

.card-updated {
  max-width: 52%;
  overflow: hidden;
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-open-hint {
  position: absolute;
  right: 18px;
  bottom: 5px;
  color: rgba(103, 232, 249, 0);
  font-size: 8px;
  letter-spacing: 0.12em;
  transition: color 160ms ease;
}

.server-card:hover .card-open-hint,
.server-card:focus-visible .card-open-hint {
  color: rgba(103, 232, 249, 0.5);
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  min-height: 280px;
  margin: 0;
  place-items: center;
  border: 1px dashed rgba(125, 211, 252, 0.16);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(8, 20, 29, 0.48);
  font-size: 13px;
  text-align: center;
}

.skeleton-card {
  cursor: default;
  pointer-events: none;
}

.skeleton-line,
.skeleton-ring-row span {
  background: linear-gradient(
    100deg,
    rgba(95, 135, 151, 0.07) 20%,
    rgba(95, 180, 197, 0.14) 42%,
    rgba(95, 135, 151, 0.07) 64%
  );
  background-size: 300% 100%;
  animation: skeleton-wave 1.6s ease infinite;
}

.skeleton-line {
  height: 10px;
  margin-bottom: 20px;
  border-radius: 5px;
}

.skeleton-short {
  width: 30%;
}

.skeleton-title {
  width: 55%;
  height: 20px;
  margin-top: 36px;
}

.skeleton-ring-row {
  display: flex;
  justify-content: space-around;
  margin-top: 36px;
}

.skeleton-ring-row span {
  width: 66px;
  height: 66px;
  border-radius: 50%;
}

@keyframes skeleton-wave {
  from {
    background-position: 100% 50%;
  }
  to {
    background-position: 0 50%;
  }
}

.dashboard-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 0 5px 16px;
  color: #36515f;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  letter-spacing: 0.11em;
}

.drawer-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  background: rgba(1, 7, 11, 0.7);
  backdrop-filter: blur(5px);
  cursor: default;
  transition: opacity 220ms ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.detail-drawer {
  position: fixed;
  z-index: 91;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(900px, 88vw);
  padding: clamp(22px, 3vw, 38px);
  overflow-y: auto;
  border-left: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 12% 0%, rgba(50, 214, 232, 0.1), transparent 31%),
    linear-gradient(155deg, rgba(12, 29, 40, 0.99), rgba(5, 14, 21, 0.99));
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.42);
  transform: translateX(102%);
  transition: transform 240ms cubic-bezier(0.22, 0.8, 0.25, 1);
}

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

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(125, 211, 252, 0.12);
}

.drawer-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.drawer-title-row h2 {
  margin: 0;
  color: #f0fbfd;
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 670;
  letter-spacing: -0.035em;
}

.drawer-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.icon-button,
.chat-collapse {
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(125, 211, 252, 0.04);
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.icon-button {
  font-size: 25px;
  font-weight: 300;
}

.icon-button:hover,
.icon-button:focus-visible,
.chat-collapse:hover,
.chat-collapse:focus-visible {
  border-color: rgba(103, 232, 249, 0.36);
  outline: none;
  color: var(--cyan-bright);
  background: rgba(50, 214, 232, 0.08);
}

.drawer-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0 16px;
  border: 1px solid rgba(125, 211, 252, 0.1);
  border-radius: 12px;
  background: rgba(3, 12, 18, 0.34);
}

.drawer-summary > div {
  min-width: 0;
  padding: 14px 17px;
}

.drawer-summary > div + div {
  border-left: 1px solid rgba(125, 211, 252, 0.09);
}

.drawer-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--subtle);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.drawer-summary strong {
  display: block;
  overflow: hidden;
  color: #cce5ea;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-notice {
  min-height: 18px;
  margin: 0 2px 9px;
  color: var(--muted);
  font-size: 10px;
}

.chart-notice.is-error {
  color: #ff93a2;
}

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

.chart-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.11);
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(14, 31, 42, 0.72), rgba(5, 15, 23, 0.82)),
    var(--panel);
}

.chart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px 0;
  color: #cbe4e9;
  font-size: 11px;
}

.chart-heading > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-heading small {
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

.chart-key {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  box-shadow: 0 0 8px currentColor;
}

.cpu-key {
  color: var(--cyan);
  background: var(--cyan);
}

.memory-key {
  color: #738dff;
  background: #738dff;
}

.disk-key {
  color: var(--purple);
  background: var(--purple);
}

.rtt-key {
  color: var(--amber);
  background: var(--amber);
}

.history-chart {
  width: 100%;
  height: 230px;
}

.cloud-chat {
  position: fixed;
  z-index: 110;
  right: clamp(16px, 2vw, 30px);
  bottom: clamp(16px, 2vw, 30px);
}

.chat-launcher {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 148px;
  height: 58px;
  padding: 7px 16px 7px 7px;
  gap: 10px;
  border: 1px solid rgba(103, 232, 249, 0.3);
  border-radius: 999px;
  color: var(--text);
  background:
    linear-gradient(115deg, rgba(17, 44, 57, 0.96), rgba(8, 23, 33, 0.97)),
    var(--panel-solid);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.34),
    inset 0 0 18px rgba(50, 214, 232, 0.035);
  cursor: pointer;
  transition:
    opacity 170ms ease,
    transform 170ms ease,
    border-color 170ms ease;
}

.chat-launcher:hover,
.chat-launcher:focus-visible {
  border-color: rgba(103, 232, 249, 0.58);
  outline: none;
  transform: translateY(-2px);
}

.cloud-chat.is-open .chat-launcher {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.95);
}

.chat-avatar {
  position: relative;
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, 0.42);
  border-radius: 50%;
  color: #dffcff;
  background:
    radial-gradient(circle at 36% 28%, rgba(115, 239, 255, 0.24), transparent 28%),
    linear-gradient(145deg, #163b4a, #0a202d);
  box-shadow:
    inset 0 0 12px rgba(50, 214, 232, 0.11),
    0 0 16px rgba(50, 214, 232, 0.1);
  font-family: "STKaiti", "KaiTi", "PingFang SC", serif;
  font-size: 20px;
  font-weight: 700;
}

.chat-avatar::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 7px;
  height: 7px;
  border: 2px solid #10242f;
  border-radius: 50%;
  background: var(--green);
}

.chat-launcher-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.chat-launcher-copy strong {
  color: #effcfe;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.chat-launcher-copy small {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.unread-dot {
  position: absolute;
  top: 0;
  right: 2px;
  width: 11px;
  height: 11px;
  border: 2px solid #08131b;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 82, 103, 0.75);
  animation: unread-pulse 1.8s ease-in-out infinite;
}

@keyframes unread-pulse {
  50% {
    transform: scale(1.17);
  }
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  width: min(390px, calc(100vw - 32px));
  height: min(610px, calc(100vh - 32px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, 0.25);
  border-radius: 19px;
  opacity: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(50, 214, 232, 0.09), transparent 30%),
    linear-gradient(155deg, rgba(12, 29, 39, 0.99), rgba(5, 15, 22, 0.99));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(16px) scale(0.96);
  transform-origin: right bottom;
  transition:
    opacity 190ms ease,
    transform 220ms cubic-bezier(0.22, 0.8, 0.25, 1);
}

.chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 15px 15px 14px 17px;
  border-bottom: 1px solid rgba(125, 211, 252, 0.1);
  background: rgba(13, 34, 45, 0.54);
}

.chat-identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.chat-identity .chat-avatar {
  flex-basis: 39px;
  width: 39px;
  height: 39px;
  font-size: 18px;
}

.chat-identity > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-identity strong {
  color: #effcfe;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.chat-identity div > span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.chat-collapse {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

.chat-messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 13px;
  min-height: 0;
  padding: 19px 16px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(103, 232, 249, 0.2) transparent;
  scrollbar-width: thin;
}

.chat-message {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  max-width: 86%;
  gap: 7px;
  animation: bubble-in 180ms ease-out;
}

.chat-message.is-user {
  align-self: flex-end;
}

.chat-message.is-assistant {
  align-self: flex-start;
}

.message-avatar {
  display: grid;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(103, 232, 249, 0.24);
  border-radius: 50%;
  color: var(--cyan-bright);
  background: #102b38;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 11px;
}

.message-bubble {
  padding: 10px 12px;
  border: 1px solid rgba(125, 211, 252, 0.1);
  border-radius: 5px 14px 14px 14px;
  color: #cae3e8;
  background: rgba(20, 42, 54, 0.8);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-message.is-user .message-bubble {
  border-color: rgba(50, 214, 232, 0.2);
  border-radius: 14px 5px 14px 14px;
  color: #effcfe;
  background: linear-gradient(135deg, rgba(21, 125, 145, 0.8), rgba(24, 92, 125, 0.84));
}

.chat-message.is-typing .message-bubble {
  color: var(--muted);
  font-style: italic;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.chat-form {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 9px;
  padding: 13px;
  border-top: 1px solid rgba(125, 211, 252, 0.11);
  background: rgba(4, 14, 21, 0.76);
}

.chat-form textarea {
  min-width: 0;
  min-height: 40px;
  max-height: 112px;
  flex: 1 1 auto;
  padding: 10px 11px;
  resize: none;
  overflow-y: auto;
  border: 1px solid rgba(125, 211, 252, 0.14);
  border-radius: 10px;
  outline: none;
  color: #e8f8fa;
  background: rgba(13, 31, 41, 0.86);
  font-size: 12px;
  line-height: 1.5;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.chat-form textarea::placeholder {
  color: #4e6874;
}

.chat-form textarea:focus {
  border-color: rgba(103, 232, 249, 0.42);
  box-shadow: 0 0 0 3px rgba(50, 214, 232, 0.06);
}

.chat-form textarea:disabled {
  opacity: 0.56;
  cursor: wait;
}

.chat-send {
  display: flex;
  min-width: 70px;
  height: 40px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 10px;
  color: #ddfaff;
  background: linear-gradient(135deg, rgba(18, 139, 159, 0.86), rgba(26, 100, 137, 0.9));
  box-shadow: 0 5px 18px rgba(10, 115, 141, 0.17);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition:
    filter 160ms ease,
    transform 160ms ease;
}

.chat-send i {
  font-size: 14px;
  font-style: normal;
}

.chat-send:hover,
.chat-send:focus-visible {
  outline: none;
  filter: brightness(1.13);
  transform: translateY(-1px);
}

.chat-send:disabled {
  opacity: 0.46;
  cursor: wait;
  filter: none;
  transform: none;
}

:root[data-cb-theme="light"] .brand h1,
:root[data-cb-theme="light"] .overview-item strong,
:root[data-cb-theme="light"] .section-heading h2,
:root[data-cb-theme="light"] .card-name-row h3,
:root[data-cb-theme="light"] .metric-value,
:root[data-cb-theme="light"] .rtt-value strong,
:root[data-cb-theme="light"] .drawer-title-row h2,
:root[data-cb-theme="light"] .drawer-summary strong,
:root[data-cb-theme="light"] .chart-heading,
:root[data-cb-theme="light"] .chat-launcher-copy strong,
:root[data-cb-theme="light"] .chat-identity strong {
  color: var(--text);
}

:root[data-cb-theme="light"] .detail-drawer,
:root[data-cb-theme="light"] .chat-panel {
  background:
    radial-gradient(circle at 10% 0%, rgba(0, 155, 197, 0.09), transparent 31%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.99), rgba(235, 246, 252, 0.99));
  box-shadow: var(--shadow);
}

:root[data-cb-theme="light"] .drawer-summary,
:root[data-cb-theme="light"] .chart-panel,
:root[data-cb-theme="light"] .chat-header,
:root[data-cb-theme="light"] .chat-form {
  background: rgba(255, 255, 255, 0.68);
}

:root[data-cb-theme="light"] .message-bubble {
  color: var(--text);
  background: rgba(226, 241, 248, 0.92);
}

:root[data-cb-theme="light"] .chat-form textarea {
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
}

@media (min-width: 1680px) {
  .server-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .server-card {
    min-height: 304px;
    padding: 22px;
  }

  .metric-ring {
    width: 74px;
    height: 74px;
  }
}

@media (max-width: 1180px) {
  .dashboard-header {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .overview-strip {
    width: 100%;
  }
}

@media (max-width: 840px) {
  .dashboard-shell {
    padding: 14px;
  }

  .dashboard-header {
    padding: 18px;
  }

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

  .overview-time {
    grid-column: 1 / -1;
    min-height: 58px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(125, 211, 252, 0.09);
  }

  .overview-time::before {
    display: none;
  }

  .overview-time p {
    margin: 0;
  }

  .overview-time > span {
    margin: 0;
  }

  .detail-drawer {
    top: auto;
    left: 0;
    width: 100%;
    max-height: 92vh;
    padding: 22px 16px 28px;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
    border-radius: 18px 18px 0 0;
    transform: translateY(102%);
  }

  .detail-drawer.is-open {
    transform: translateY(0);
  }

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

  .history-chart {
    height: 220px;
  }
}

@media (max-width: 600px) {
  .brand-mark {
    flex-basis: 49px;
    width: 49px;
    height: 49px;
  }

  .overview-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .overview-item {
    min-height: 70px;
    padding: 11px;
    gap: 8px;
  }

  .overview-glyph,
  .overview-icon {
    display: none;
  }

  .overview-item strong {
    font-size: 22px;
  }

  .overview-time {
    padding: 11px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .sync-state {
    width: 100%;
    flex-wrap: wrap;
  }

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

  .server-card {
    min-height: 280px;
  }

  .drawer-summary {
    grid-template-columns: 1fr;
  }

  .drawer-summary > div + div {
    border-top: 1px solid rgba(125, 211, 252, 0.09);
    border-left: 0;
  }

  .drawer-title-row h2 {
    width: 100%;
  }

  .dashboard-footer {
    flex-direction: column;
    gap: 6px;
  }

  .chat-panel {
    position: fixed;
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    height: min(650px, calc(100dvh - 20px));
  }
}

@media (max-width: 390px) {
  .dashboard-shell {
    padding: 10px;
  }

  .dashboard-header {
    padding: 15px 13px;
  }

  .overview-item {
    padding-inline: 8px;
  }

  .overview-item p {
    font-size: 9px;
  }

  .overview-item strong {
    font-size: 20px;
  }

  .overview-item strong small {
    font-size: 9px;
  }

  .overview-time time {
    font-size: 17px;
  }

  .server-card {
    padding: 17px;
  }

  .metric-ring {
    width: 64px;
    height: 64px;
  }

  .chat-launcher {
    min-width: 58px;
    width: 58px;
    padding: 7px;
  }

  .chat-launcher-copy {
    display: none;
  }
}

@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;
  }
}
