:root {
  color-scheme: light;
  --page: #f1f5f3;
  --surface: rgba(255, 255, 255, .86);
  --surface-subtle: rgba(248, 251, 249, .78);
  --ink: #17201d;
  --muted: #66736e;
  --faint: #87958f;
  --line: rgba(198, 211, 205, .8);
  --line-soft: rgba(216, 226, 221, .68);
  --accent: #42b889;
  --accent-soft: rgba(226, 248, 239, .82);
  --accent-strong: #22875f;
  --green: #31a978;
  --red: #c94747;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --surface: rgba(20, 27, 34, .9);
  --surface-subtle: rgba(26, 35, 43, .84);
  --ink: #f4f7fa;
  --muted: #bdc7d0;
  --faint: #8f9ca8;
  --line: rgba(179, 198, 216, .28);
  --line-soft: rgba(179, 198, 216, .18);
  --accent: #64b8e8;
  --accent-soft: rgba(74, 160, 207, .18);
  --accent-strong: #8cd2f5;
  --green: #52cf9d;
  --red: #ef7c83;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  background:
    radial-gradient(circle at 8% -4%, rgba(21, 150, 107, .13), transparent 31rem),
    radial-gradient(circle at 94% 18%, rgba(57, 120, 212, .07), transparent 35rem),
    radial-gradient(circle at 38% 102%, rgba(54, 187, 140, .075), transparent 36rem),
    linear-gradient(160deg, #edf6f2 0%, #f7faf8 42%, #eef4f2 100%);
  color: var(--ink);
  font-family: var(--sans);
  isolation: isolate;
  margin: 0;
  overflow-x: hidden;
  position: relative;
}
body::before {
  animation: page-flow 15s cubic-bezier(.45, .05, .2, 1) infinite alternate;
  background: url("assets/background-flow.svg?v=2") center center / cover no-repeat;
  content: "";
  inset: -9%;
  opacity: .9;
  pointer-events: none;
  position: fixed;
  transform: translate3d(0, 0, 0) rotate(-.55deg) scale(1.075);
  transform-origin: 58% 46%;
  will-change: transform, opacity;
  z-index: -1;
}
body::after {
  content: "";
  inset: -5%;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}
[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% -8%, rgba(42, 132, 139, .18), transparent 31rem),
    radial-gradient(circle at 92% 18%, rgba(68, 115, 166, .15), transparent 35rem),
    linear-gradient(154deg, #080d11 0%, #111820 48%, #090f14 100%);
}
[data-theme="dark"] body::before {
  animation-name: dark-page-flow;
  filter: brightness(.92) saturate(.92);
}
[data-theme="dark"] body::after {
  display: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.topbar { background: transparent; height: auto; padding: 12px 14px 0; position: sticky; top: 0; z-index: 20; }
.topbar-inner { align-items: center; backdrop-filter: blur(16px) saturate(125%); background: rgba(255, 255, 255, .72); border: 1px solid rgba(198, 211, 205, .82); border-radius: 14px; box-shadow: 0 10px 30px rgba(23, 32, 29, .07); display: flex; justify-content: space-between; margin: 0 auto; max-width: 940px; min-height: 58px; padding: 0 22px; -webkit-backdrop-filter: blur(16px) saturate(125%); }
.topbar-actions { align-items: center; display: flex; gap: 14px; }
.brand { align-items: center; display: inline-flex; }
.brand strong { font-size: 15px; font-weight: 700; letter-spacing: .06em; }
.global-status { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 7px; }
.status-dot { background: #a4b0ab; border-radius: 50%; height: 6px; transition: background .18s ease, box-shadow .18s ease; width: 6px; }
.status-dot.is-ready { background: var(--green); box-shadow: 0 0 0 4px rgba(49, 169, 120, .1); }
.status-dot.is-error { background: var(--red); }
.theme-toggle { align-items: center; background: rgba(255, 255, 255, .62); border: 1px solid rgba(178, 195, 187, .9); border-radius: 50%; color: #52635c; display: inline-flex; height: 34px; justify-content: center; padding: 0; position: relative; transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease; width: 34px; }
.theme-toggle:hover { background: var(--accent-soft); border-color: #9ecdb8; color: var(--accent-strong); transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 3px solid rgba(66, 184, 137, .24); outline-offset: 2px; }
.theme-icon { font-size: 15px; line-height: 1; }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }

.main-content { margin: 0 auto; max-width: 940px; padding: 34px 14px 64px; position: relative; z-index: 1; }
.breadcrumb { align-items: center; color: var(--faint); display: flex; font-size: 11px; gap: 8px; margin: 0 4px 19px; }
.breadcrumb strong { color: var(--muted); font-weight: 500; }
.page-header { align-items: center; backdrop-filter: blur(16px) saturate(118%); background: rgba(255, 255, 255, .68); border: 1px solid rgba(198, 211, 205, .84); border-radius: 14px; box-shadow: 0 18px 42px rgba(23, 32, 29, .075); display: flex; justify-content: space-between; margin-bottom: 24px; overflow: hidden; padding: 28px 26px; position: relative; -webkit-backdrop-filter: blur(16px) saturate(118%); }
.page-header::after { background: radial-gradient(circle, rgba(80, 197, 155, .16), transparent 68%); content: ""; height: 180px; pointer-events: none; position: absolute; right: -50px; top: -95px; width: 260px; }
.page-header > * { position: relative; z-index: 1; }
h1 { font-size: 27px; font-weight: 650; letter-spacing: -.03em; line-height: 1.2; margin: 0 0 8px; }
.page-header p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }
.page-actions { align-items: center; display: flex; gap: 14px; }
.updated-at { color: var(--faint); font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.refresh-button { align-items: center; backdrop-filter: blur(8px); background: rgba(255, 255, 255, .72); border: 1px solid rgba(188, 205, 197, .95); border-radius: 7px; box-shadow: 0 4px 12px rgba(23, 32, 29, .045); color: var(--ink); display: inline-flex; font-size: 11px; gap: 6px; height: 32px; padding: 0 10px; -webkit-backdrop-filter: blur(8px); }
.refresh-button:hover { background: var(--accent-soft); border-color: #a8d7c2; color: var(--accent-strong); }
.refresh-button:disabled { cursor: wait; opacity: .72; }
.refresh-button.is-loading span { animation: rotate .75s linear infinite; }

.summary-bar { backdrop-filter: blur(14px) saturate(118%); background: rgba(255, 255, 255, .7); border: 1px solid rgba(198, 211, 205, .88); border-radius: 14px 14px 0 0; box-shadow: 0 15px 36px rgba(23, 32, 29, .065); display: grid; grid-template-columns: repeat(3, 1fr); -webkit-backdrop-filter: blur(14px) saturate(118%); }
.summary-item { align-items: center; border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; justify-content: center; padding: 17px 20px; text-align: center; }
.summary-item:last-child { border-right: 0; }
.summary-item span { color: var(--faint); font-size: 11px; }
.summary-item strong { font-family: var(--mono); font-size: 15px; font-weight: 500; }
.summary-state strong { color: var(--muted); }
.summary-state strong.is-ready { color: var(--green); }
.summary-state strong.is-error { color: var(--red); }

.service-panel { backdrop-filter: blur(18px) saturate(120%); background: rgba(255, 255, 255, .78); border: 1px solid rgba(198, 211, 205, .9); border-radius: 0 0 14px 14px; border-top: 0; box-shadow: 0 24px 58px rgba(23, 32, 29, .09); overflow: hidden; -webkit-backdrop-filter: blur(18px) saturate(120%); }
.panel-heading { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 18px 20px; }
.panel-heading h2 { font-size: 15px; margin: 0; }
.panel-heading span { color: var(--faint); font-size: 11px; }
.column-header { background: rgba(244, 248, 246, .68); border-bottom: 1px solid var(--line); color: var(--faint); display: grid; font-size: 10px; grid-template-columns: minmax(168px, .82fr) minmax(220px, 1.38fr) 82px 52px; padding: 11px 20px; }
.product-group { background: rgba(255, 255, 255, .34); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(168px, .82fr) minmax(0, 1.38fr); transition: background .18s ease; }
.product-group:hover { background: rgba(255, 255, 255, .64); }
.product-group:last-child { border-bottom: 0; }
.product-main { align-items: flex-start; display: flex; gap: 10px; padding: 19px 20px; }
.product-state { background: #a4b0ab; border-radius: 50%; flex: 0 0 5px; height: 5px; margin-top: 6px; transition: background .18s ease, box-shadow .18s ease; }
.product-state.is-ready { background: var(--green); box-shadow: 0 0 0 3px rgba(49, 169, 120, .08); }
.product-state.is-error { background: var(--red); box-shadow: 0 0 0 3px rgba(201, 71, 71, .07); }
.product-main h3 { font-size: 14px; font-weight: 600; line-height: 1.4; margin: 0 0 4px; }
.product-main p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }
.endpoint-list { border-left: 1px solid var(--line-soft); display: grid; grid-auto-rows: minmax(52px, 1fr); }
.endpoint { align-items: center; display: grid; grid-template-columns: minmax(0, 1fr) 82px 52px; min-height: 52px; padding: 0 20px; }
.endpoint { transition: background .18s ease; }
.endpoint:hover { background: rgba(232, 248, 240, .38); }
.endpoint.is-invalid { background: rgba(255, 245, 245, .56); }
.endpoint + .endpoint { border-top: 1px solid var(--line-soft); }
.address { min-width: 0; }
.address-line { align-items: center; display: flex; gap: 6px; min-width: 0; }
.endpoint-domain { font-family: var(--mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.endpoint-label { background: #eef2f1; border-radius: 3px; color: var(--muted); flex: 0 0 auto; font-size: 9px; padding: 2px 6px; }
.endpoint-label.is-backup { background: var(--accent-soft); color: var(--accent-strong); }
.latency { align-items: center; color: var(--muted); display: flex; font-family: var(--mono); font-size: 11px; gap: 6px; }
.latency-mark { background: var(--faint); border-radius: 50%; height: 5px; width: 5px; }
.latency-mark.is-good { background: var(--green); }
.latency-mark.is-slow { background: #79a8a0; }
.latency-mark.is-error { background: var(--red); }
.open-link { align-items: center; color: var(--accent-strong); display: inline-flex; font-size: 11px; font-weight: 500; gap: 3px; justify-content: flex-end; }
.open-link:hover { color: #237756; text-decoration: underline; }
.open-link[aria-disabled="true"] { color: var(--faint); cursor: not-allowed; pointer-events: none; text-decoration: none; }

.measurement-note { align-items: center; color: var(--faint); display: flex; font-size: 11px; gap: 8px; justify-content: center; line-height: 1.5; margin: 21px 2px 0; text-align: center; }
.measurement-note span { align-items: center; border: 1px solid #aebcb6; border-radius: 50%; color: var(--accent-strong); display: inline-flex; flex: 0 0 14px; font-family: serif; font-size: 9px; height: 14px; justify-content: center; }
.noscript-note { background: rgba(255, 255, 255, .56); border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; margin: 0; padding: 14px 20px; text-align: center; }
.site-footer { color: #71807a; display: flex; font-family: var(--mono); font-size: 9px; justify-content: space-between; margin: 0 auto; max-width: 940px; padding: 0 20px 22px; position: relative; z-index: 1; }

[data-theme="dark"] .topbar-inner {
  background: rgba(16, 22, 28, .86);
  border-color: rgba(185, 204, 220, .3);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .34), inset 0 1px rgba(255, 255, 255, .035);
}
[data-theme="dark"] .theme-toggle { background: rgba(29, 40, 49, .92); border-color: rgba(121, 196, 234, .46); color: var(--accent-strong); }
[data-theme="dark"] .page-header {
  background: rgba(18, 25, 31, .86);
  border-color: rgba(185, 204, 220, .3);
  border-radius: 10px;
  box-shadow: 0 24px 58px rgba(0, 0, 0, .38), inset 0 1px rgba(255, 255, 255, .035);
}
[data-theme="dark"] .page-header::after { background: radial-gradient(circle, rgba(91, 168, 241, .17), transparent 68%); }
[data-theme="dark"] .refresh-button { background: rgba(18, 34, 57, .78); border-color: rgba(126, 160, 207, .32); box-shadow: 0 8px 20px rgba(0, 0, 0, .18); color: var(--ink); }
[data-theme="dark"] .refresh-button:hover { background: rgba(64, 132, 204, .2); border-color: rgba(105, 183, 255, .5); color: var(--accent-strong); }
[data-theme="dark"] .summary-bar {
  background: rgba(18, 25, 31, .88);
  border-color: rgba(185, 204, 220, .3);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .03);
}
[data-theme="dark"] .service-panel {
  background: rgba(16, 22, 28, .92);
  border-color: rgba(185, 204, 220, .3);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .42), inset 0 -1px rgba(105, 183, 255, .04);
}
[data-theme="dark"] .panel-heading { background: rgba(45, 58, 68, .34); }
[data-theme="dark"] .column-header { background: rgba(55, 69, 80, .5); }
[data-theme="dark"] .product-group { background: rgba(255, 255, 255, .018); }
[data-theme="dark"] .product-group:hover { background: rgba(111, 169, 190, .09); }
[data-theme="dark"] .endpoint:hover { background: rgba(76, 145, 219, .11); }
[data-theme="dark"] .endpoint-label { background: rgba(133, 155, 187, .14); color: #adbbce; }
[data-theme="dark"] .endpoint-label.is-backup { background: rgba(105, 183, 255, .13); color: #9fd2ff; }
[data-theme="dark"] .endpoint.is-invalid { background: rgba(176, 61, 70, .09); }
[data-theme="dark"] .open-link:hover { color: #b7ddff; }
[data-theme="dark"] .measurement-note span { border-color: rgba(105, 183, 255, .36); }
[data-theme="dark"] .noscript-note { background: rgba(10, 20, 35, .66); }
[data-theme="dark"] .site-footer { color: #718198; }

@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes page-flow {
  0% { opacity: .78; transform: translate3d(-3%, -1.6%, 0) rotate(-.85deg) scale(1.075); }
  46% { opacity: .98; transform: translate3d(2.8%, -1.1%, 0) rotate(.45deg) scale(1.115); }
  100% { opacity: .86; transform: translate3d(-.8%, 2.8%, 0) rotate(.9deg) scale(1.09); }
}
@keyframes dark-page-flow {
  0% { opacity: .52; transform: translate3d(-3%, -1.6%, 0) rotate(-.85deg) scale(1.075); }
  46% { opacity: .7; transform: translate3d(2.8%, -1.1%, 0) rotate(.45deg) scale(1.115); }
  100% { opacity: .58; transform: translate3d(-.8%, 2.8%, 0) rotate(.9deg) scale(1.09); }
}

@media (max-width: 660px) {
  .topbar { padding: 9px 9px 0; }
  .topbar-inner { border-radius: 12px; min-height: 55px; padding: 0 16px; }
  .topbar-actions { gap: 10px; }
  .theme-toggle { height: 34px; width: 34px; }
  .main-content { padding: 27px 9px 52px; }
  .breadcrumb { margin-left: 5px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 20px; padding: 23px 21px; }
  .page-actions { justify-content: space-between; width: 100%; }
  .summary-bar { grid-template-columns: repeat(3, 1fr); }
  .column-header { display: none; }
  .product-group { grid-template-columns: 1fr; }
  .product-main { padding: 17px 18px; }
  .endpoint-list { border-left: 0; border-top: 1px solid var(--line-soft); }
  .endpoint { grid-template-columns: minmax(0, 1fr) 76px 46px; min-height: 50px; padding: 0 16px 0 30px; }
}

@media (max-width: 420px) {
  .topbar-inner { padding: 0 14px; }
  .global-status { font-size: 10px; }
  .summary-item { padding: 14px 8px; }
  .summary-item span { font-size: 10px; }
  .endpoint { grid-template-columns: minmax(0, 1fr) 45px; padding-left: 14px; }
  .latency { grid-column: 1; grid-row: 2; padding-bottom: 8px; }
  .open-link { grid-column: 2; grid-row: 1 / span 2; }
  .address-line { padding-top: 9px; }
  .site-footer { flex-direction: column; gap: 8px; padding-left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  body::before, body::after { animation: none !important; }
}
