:root {
  color-scheme: light;
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-soft: #e9eeec;
  --surface-strong: #dfe6e3;
  --ink: #17211f;
  --muted: #687571;
  --line: #d9e1de;
  --accent: #247568;
  --accent-soft: #deeee9;
  --accent-ink: #195d53;
  --blue: #376f9d;
  --blue-soft: #e2edf5;
  --amber: #a66c16;
  --amber-soft: #f9ecd7;
  --red: #b84a47;
  --red-soft: #f8e5e3;
  --shadow: 0 12px 34px rgba(24, 45, 40, 0.07);
  --radius: 8px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111716;
  --surface: #18201f;
  --surface-soft: #222c2a;
  --surface-strong: #2c3835;
  --ink: #edf3f1;
  --muted: #9aa8a4;
  --line: #2d3a37;
  --accent: #69b7aa;
  --accent-soft: #173b35;
  --accent-ink: #91d1c5;
  --blue: #7eb5df;
  --blue-soft: #203344;
  --amber: #e1a653;
  --amber-soft: #3b2d19;
  --red: #ee8580;
  --red-soft: #402322;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 36%, transparent);
  outline-offset: 2px;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(22px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 91%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  flex: 0 0 auto;
}

.brand span {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 13px;
  letter-spacing: 0.08em;
}

.brand small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.last-updated {
  margin-right: 4px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.icon-button:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--muted) 42%, var(--line));
  background: var(--surface-soft);
}

.icon-button:active {
  transform: translateY(1px);
}

.icon-button.is-loading .icon {
  animation: spin 700ms linear infinite;
}

.theme-icon-dark {
  display: none;
}

:root[data-theme="dark"] .theme-icon-light {
  display: none;
}

:root[data-theme="dark"] .theme-icon-dark {
  display: block;
}

main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 34px 22px 48px;
}

.project-hub {
  margin-bottom: 56px;
}

.project-heading {
  margin-bottom: 22px;
  text-align: center;
}

.project-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.project-heading h2 {
  margin: 0;
  font-size: clamp(25px, 3.4vw, 34px);
  line-height: 1.18;
}

.project-heading > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.project-grid {
  display: grid;
  width: min(940px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  margin: 0 auto;
}

.project-card {
  min-height: 248px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  color: inherit;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.project-card:hover {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  box-shadow: 0 18px 44px color-mix(in srgb, var(--accent) 12%, transparent);
  transform: translateY(-3px);
}

.project-card-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.project-card-icon .icon {
  width: 27px;
  height: 27px;
}

.project-card-copy {
  display: grid;
  margin-top: 25px;
}

.project-card-copy .project-kicker {
  margin-bottom: 6px;
}

.project-card-copy strong {
  font-size: 27px;
  line-height: 1.15;
}

.project-card-copy > span:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.project-card-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
}

.project-card-action .icon {
  width: 16px;
  height: 16px;
  transition: transform 170ms ease;
}

.project-card:hover .project-card-action .icon {
  transform: translate(2px, -2px);
}

.status-hero {
  display: flex;
  min-height: 188px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 180ms ease;
}

.status-hero[data-state="online"] {
  border-left-color: var(--accent);
}

.status-hero[data-state="degraded"] {
  border-left-color: var(--amber);
}

.status-hero[data-state="offline"] {
  border-left-color: var(--red);
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-indicator {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 14%, transparent);
}

.status-hero[data-state="online"] .status-indicator {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

.status-hero[data-state="degraded"] .status-indicator {
  background: var(--amber);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 15%, transparent);
}

.status-hero[data-state="offline"] .status-indicator {
  background: var(--red);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 15%, transparent);
}

.hero-copy h1 {
  margin: 13px 0 0;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.hero-copy > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-icon {
  display: grid;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.hero-icon .icon {
  width: 34px;
  height: 34px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.metric-card {
  min-height: 164px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-card-plain {
  display: flex;
  flex-direction: column;
}

.metric-heading {
  display: flex;
  align-items: center;
  gap: 11px;
}

.metric-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--blue);
  background: var(--blue-soft);
}

.metric-icon .icon {
  width: 19px;
  height: 19px;
}

.metric-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.metric-heading strong {
  display: block;
  margin-top: 1px;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.progress-track {
  height: 6px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 350ms ease, background 180ms ease;
}

.metric-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.metric-card-plain .metric-note {
  margin-top: auto;
  padding-top: 23px;
}

.progress-track span.is-warning {
  background: var(--amber);
}

.progress-track span.is-danger {
  background: var(--red);
}

.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-top: 16px;
}

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

.panel-heading {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-kicker {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.panel-heading h2 {
  margin: 0;
  font-size: 16px;
}

.service-summary {
  color: var(--muted);
  font-size: 11px;
}

.detail-list {
  margin: 0;
  padding: 4px 18px 10px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  text-align: right;
}

.service-list {
  padding: 6px 18px 12px;
}

.service-item {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.service-item:last-child {
  border-bottom: 0;
}

.service-name {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.service-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
}

.service-item.is-active .service-dot {
  background: var(--accent);
}

.service-state {
  color: var(--red);
  font-size: 11px;
}

.service-item.is-active .service-state {
  color: var(--accent-ink);
}

.footer {
  display: flex;
  width: min(1180px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 0 22px 30px;
  color: var(--muted);
  font-size: 10px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(340px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1000px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 16px;
  }

  main {
    padding: 22px 16px 38px;
  }

  .project-hub {
    margin-bottom: 38px;
  }

  .project-grid {
    width: min(560px, 100%);
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .status-hero {
    min-height: 168px;
    padding: 24px 22px;
  }

  .hero-icon {
    width: 60px;
    height: 60px;
  }

  .hero-icon .icon {
    width: 28px;
    height: 28px;
  }

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

  .footer {
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (max-width: 560px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .last-updated {
    display: none;
  }

  .brand small {
    display: none;
  }

  .status-hero {
    align-items: flex-start;
  }

  .hero-icon {
    display: none;
  }

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

  .metric-card {
    min-height: 148px;
  }

  .detail-list div {
    grid-template-columns: 82px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
