:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef3f5;
  --ink: #1d252c;
  --muted: #64717d;
  --line: #d8e0e5;
  --accent: #137c8b;
  --accent-dark: #0d5965;
  --ok: #20835a;
  --warn: #b97916;
  --danger: #ba3d42;
  --blue: #3767a6;
  --shadow: 0 18px 44px rgba(37, 50, 61, 0.1);
  --glow: rgba(19, 124, 139, 0.2);
  --icp: #c26a00;
  --icp-bg: #fff3d8;
  --scroll-progress: 0;
  --scroll-shift: 0px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(19, 124, 139, 0.16), transparent 30vw),
    radial-gradient(circle at 88% 18%, rgba(55, 103, 166, 0.14), transparent 26vw),
    linear-gradient(180deg, #f7fafb 0%, var(--bg) 44%, #edf2f4 100%);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(19, 124, 139, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 124, 139, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 78%);
  content: "";
  transform: translateY(calc(var(--scroll-shift) * -0.18));
  transition: transform 120ms linear;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.42) 48%, transparent 56%);
  animation: scan-sheen 8s linear infinite;
  content: "";
  pointer-events: none;
  transform: translateX(calc(-120% + var(--scroll-progress) * 240%));
}

html::before {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: calc(var(--scroll-progress) * 100%);
  height: 3px;
  background: linear-gradient(90deg, #137c8b, #f2b84b, #ba3d42);
  box-shadow: 0 0 18px rgba(19, 124, 139, 0.45);
  content: "";
  transform-origin: left center;
}

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

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 24px;
  align-items: center;
  min-height: 72px;
  padding: 0 32px;
  background: rgba(244, 248, 249, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand,
.nav,
.env-pill,
.panel-title,
.tools,
.segmented,
.footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #6ee7df;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 0 22px rgba(110, 231, 223, 0.24);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover {
  color: var(--accent);
}

.env-pill {
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #b9d7d9;
  border-radius: 8px;
  background: #e8f6f5;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(32, 131, 90, 0.15);
  animation: pulse-ring 1.8s ease-out infinite;
}

.dashboard {
  padding: 42px 32px 24px;
  transform: translateY(calc(var(--scroll-shift) * -0.05));
}

.dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.build-card,
.metric-card,
.panel {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  will-change: transform;
}

.build-card::before,
.metric-card::before,
.panel::before,
.resource-grid a::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 0%), rgba(19, 124, 139, 0.16), transparent 38%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.build-card:hover,
.metric-card:hover,
.panel:hover {
  border-color: rgba(19, 124, 139, 0.42);
  box-shadow: 0 22px 60px rgba(28, 49, 57, 0.16);
}

.build-card:hover::before,
.metric-card:hover::before,
.panel:hover::before,
.resource-grid a:hover::before {
  opacity: 1;
}

.build-card {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 22px;
}

.build-card span,
.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.build-card strong {
  font-size: 28px;
}

.build-card small,
.metric-card small {
  color: var(--muted);
}

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

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 20px;
  border-top: 4px solid var(--blue);
}

.metric-card::after {
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 52px;
  height: 22px;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(55, 103, 166, 0.32) 12% 24%, transparent 24% 34%),
    linear-gradient(90deg, rgba(19, 124, 139, 0.28), rgba(55, 103, 166, 0.1));
  clip-path: polygon(0 70%, 14% 40%, 30% 58%, 48% 20%, 68% 44%, 100% 8%, 100% 100%, 0 100%);
  content: "";
  opacity: 0.6;
}

.metric-card.good {
  border-top-color: var(--ok);
}

.metric-card.warn {
  border-top-color: var(--warn);
}

.metric-card.danger {
  border-top-color: var(--danger);
}

.metric-card strong {
  font-size: 36px;
  line-height: 1;
}

.workbench {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  padding: 0 32px 24px;
}

.side-panel,
.section-grid {
  display: grid;
  gap: 16px;
}

.panel {
  padding: 22px;
}

.panel.compact {
  box-shadow: none;
}

.panel-title {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.info-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.info-list div {
  display: grid;
  gap: 4px;
}

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

.info-list dd {
  margin: 0;
  font-weight: 700;
  word-break: break-word;
}

.account-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.account-list span {
  color: var(--muted);
  font-size: 13px;
}

.bars {
  display: grid;
  gap: 12px;
}

.bars div {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  overflow: hidden;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.bars div::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value);
  background: rgba(19, 124, 139, 0.18);
  content: "";
  animation: bar-fill 900ms ease both;
}

.bars span,
.bars b {
  position: relative;
}

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

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, auto);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.tools {
  justify-content: flex-end;
  gap: 12px;
}

input[type="search"] {
  width: 260px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
}

.segmented {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segmented button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

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

.segmented button.active {
  background: var(--ink);
  color: #ffffff;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #edf2f4;
  color: #40505b;
  font-size: 12px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr.is-hidden {
  display: none;
}

tbody tr {
  animation: row-slide-up 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

tbody tr:nth-child(2) {
  animation-delay: 70ms;
}

tbody tr:nth-child(3) {
  animation-delay: 140ms;
}

tbody tr:nth-child(4) {
  animation-delay: 210ms;
}

tbody tr:nth-child(5) {
  animation-delay: 280ms;
}

tbody tr:nth-child(6) {
  animation-delay: 350ms;
}

tbody tr:hover {
  background: rgba(19, 124, 139, 0.06);
}

.status,
.priority {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.status.online,
.status.passed {
  background: #e5f5ed;
  color: var(--ok);
}

.status.blocked,
.status.failed,
.priority.high {
  background: #fae8e8;
  color: var(--danger);
}

.priority.mid {
  background: #fff3da;
  color: var(--warn);
}

.priority.low {
  background: #e9f0fb;
  color: var(--blue);
}

.section-grid {
  grid-template-columns: 0.9fr 1.1fr;
  padding: 0 32px 38px;
}

.timeline {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 6px 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.timeline span {
  grid-row: span 2;
  color: var(--accent);
  font-weight: 800;
}

.timeline p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.resource-grid a {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.resource-grid a:hover {
  border-color: var(--accent);
  box-shadow: 0 18px 36px rgba(37, 50, 61, 0.1);
  transform: translateY(-3px);
}

.resource-grid span {
  color: var(--muted);
  font-size: 13px;
}

.footer {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 24px 32px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.icp-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(194, 106, 0, 0.32);
  border-radius: 8px;
  background: var(--icp-bg);
  color: var(--icp);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(194, 106, 0, 0.12);
}

.icp-link:hover {
  color: #8d4b00;
  text-decoration: underline;
  transform: translateY(-1px);
}

.beian-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
}

.motion-reveal {
  opacity: 0;
  filter: blur(10px);
  transform: translate3d(0, calc(42px + var(--motion-depth, 1) * 2px), 0) scale(0.94);
  transition:
    opacity 760ms cubic-bezier(0.16, 1, 0.3, 1) var(--motion-delay, 0ms),
    filter 760ms cubic-bezier(0.16, 1, 0.3, 1) var(--motion-delay, 0ms),
    transform 760ms cubic-bezier(0.16, 1, 0.3, 1) var(--motion-delay, 0ms);
}

.motion-reveal.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
}

.slide-up-reveal.is-visible {
  animation: pop-settle 780ms cubic-bezier(0.16, 1, 0.3, 1) var(--motion-delay, 0ms) both;
}

@keyframes scan-sheen {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(120%);
  }
}

@keyframes pop-settle {
  0% {
    transform: translate3d(0, 46px, 0) scale(0.94);
  }

  62% {
    transform: translate3d(0, -4px, 0) scale(1.012);
  }

  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes row-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(32, 131, 90, 0.34);
  }

  80% {
    box-shadow: 0 0 0 8px rgba(32, 131, 90, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(32, 131, 90, 0);
  }
}

@keyframes bar-fill {
  from {
    width: 0;
  }

  to {
    width: var(--value);
  }
}

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

  .workbench,
  .section-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 20px;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .dashboard,
  .workbench,
  .section-grid {
    padding-right: 20px;
    padding-left: 20px;
  }

  .dashboard-head,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .tools {
    align-items: stretch;
    flex-direction: column;
  }

  input[type="search"] {
    width: 100%;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 32px;
  }

  .metric-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .footer,
  .account-list li {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  .build-card,
  .metric-card,
  .panel {
    transform: none !important;
  }

  .motion-reveal {
    filter: none !important;
  }
}
