:root {
  color: #123c36;
  background: #f7faf9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Noto Sans JP", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, #fbfdfc 0, #f7faf9 54%, #edf4f1 100%);
}

button { font: inherit; }

.loader-header,
footer,
.loader-main {
  width: min(100% - 48px, 1240px);
  margin-inline: auto;
}

.loader-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #d5dfdc;
}

.loader-header img {
  width: 148px;
  height: auto;
  display: block;
  object-fit: contain;
}

.language-switch { display: flex; gap: 2px; }

.language-switch button {
  min-height: 40px;
  padding: 7px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #536874;
  background: transparent;
  cursor: pointer;
}

.language-switch button[aria-current="true"] {
  border-bottom-color: #176b87;
  color: #123c36;
  font-weight: 750;
}

.language-switch button:focus-visible,
.retry-button:focus-visible,
.product-sample:focus-visible {
  outline: 3px solid #e2a63b;
  outline-offset: 3px;
}

.loader-main {
  margin-block: auto;
  padding: 26px 0 32px;
}

.intro {
  max-width: 880px;
  margin-bottom: 22px;
}

.version {
  margin: 0 0 6px;
  color: #176b87;
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 0;
  color: #123c36;
  font-size: 36px;
  line-height: 1.24;
  letter-spacing: 0;
}

.lead {
  margin: 10px 0 0;
  color: #536874;
  font-size: 16px;
  line-height: 1.65;
}

.wake-layout {
  display: grid;
  grid-template-columns: minmax(330px, .78fr) minmax(520px, 1.22fr);
  min-height: 410px;
  overflow: hidden;
  border-top: 1px solid #bfcfca;
  border-bottom: 1px solid #bfcfca;
  background: #fff;
}

.wake-console {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 30px 34px 28px 4px;
  border-right: 1px solid #d5dfdc;
}

.journey-copy {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.activity-indicator {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 4px solid #c1d8d0;
  border-top-color: #27a17b;
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}

.console-label {
  margin: 0 0 2px;
  color: #687b84;
  font-size: 11px;
  font-weight: 750;
}

.live-status {
  min-height: 25px;
  margin: 0;
  color: #176b87;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
}

.timing-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 26px;
  border-top: 1px solid #d5dfdc;
  border-bottom: 1px solid #d5dfdc;
}

.time-metric {
  min-width: 0;
  padding: 16px 18px 15px 0;
}

.time-metric + .time-metric {
  padding-left: 20px;
  border-left: 1px solid #d5dfdc;
}

.time-metric > span {
  display: block;
  color: #687b84;
  font-size: 12px;
  font-weight: 700;
}

.time-metric p {
  min-height: 48px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 5px 0 0;
}

.time-metric strong {
  color: #123c36;
  font-size: 38px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.time-metric.is-check strong {
  color: #176b87;
  font-size: 26px;
  white-space: nowrap;
}

.time-metric small {
  color: #687b84;
  font-size: 12px;
}

.estimate-note {
  min-height: 20px;
  margin: 8px 0 0;
  color: #687b84;
  font-size: 12px;
  line-height: 1.55;
}

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

.status-list li {
  position: relative;
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #7a8a91;
}

.status-list li::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 21px;
  left: 9px;
  width: 1px;
  height: 32px;
  border-left: 1px dashed #b6c5c1;
}

.status-list li:last-child::after { display: none; }

.status-list li > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.status-list strong,
.status-list small {
  line-height: 1.35;
  letter-spacing: 0;
}

.status-list strong { color: inherit; font-size: 14px; }
.status-list small { color: #7a8a91; font-size: 12px; }

.status-mark {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 2px solid #aebcb9;
  border-radius: 50%;
  background: #fff;
}

.status-list li.active { color: #10283f; }

.status-list li.active .status-mark {
  border-color: #c58b24;
  box-shadow: 0 0 0 4px rgb(197 139 36 / 16%);
}

.status-list li.active .status-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #c58b24;
  animation: breathe 1.4s ease-in-out infinite;
}

.status-list li.complete { color: #0a604a; }

.status-list li.complete .status-mark {
  border-color: #27a17b;
  background: #27a17b;
}

.status-list li.complete .status-mark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

.status-list li.error .status-mark {
  border-color: #c37b24;
  background: #fff7e8;
}

.journey {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background: #f7fafb;
}

.scene-caption {
  min-height: 46px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  color: #60747f;
  background: #f8faf9;
  font-size: 11px;
  font-weight: 750;
}

.scene-caption b {
  height: 1px;
  background: linear-gradient(90deg, #0e7258 0 48%, transparent 48% 54%, #e2a63b 54% 100%);
}

.journey-scene {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  background: #f8fbfc;
}

.journey-scene img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.water-signal {
  position: absolute;
  bottom: 16%;
  left: 51%;
  width: 54px;
  height: 12px;
  border: 1px solid #397e9d;
  border-radius: 50%;
  opacity: 0;
  transform: translateX(-50%) scale(.6);
  animation: water-signal 2.8s ease-out infinite;
}

.signal-two { animation-delay: 1.4s; }
body[data-stage="ready"] .water-signal { border-color: #0e7258; }

.product-sample {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(120px, 1.5fr) repeat(3, minmax(88px, 1fr));
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 0;
  border-top: 1px solid #d5dfdc;
  border-radius: 0;
  color: #123c36;
  background: #fff;
  cursor: pointer;
}

.product-sample small {
  color: #687b84;
  font-size: 11px;
  text-align: left;
}

.product-sample span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  letter-spacing: 0;
}

.product-sample span[data-product="zh"] { color: #176b87; font-weight: 800; }
.product-sample.changed span { animation: product-change 360ms ease-out; }

.recovery {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #d5dfdc;
}

.recovery[hidden] { display: none; }

.detail-status {
  margin: 0;
  color: #536874;
  font-size: 13px;
  line-height: 1.55;
}

.retry-button {
  min-height: 42px;
  margin-top: 10px;
  padding: 8px 18px;
  border: 1px solid #176b87;
  border-radius: 5px;
  color: #fff;
  background: #176b87;
  cursor: pointer;
}

footer {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #d5dfdc;
  color: #637781;
  font-size: 12px;
}

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

@keyframes water-signal {
  0% { opacity: 0; transform: translateX(-50%) scale(.6); }
  28% { opacity: .42; }
  100% { opacity: 0; transform: translateX(-50%) scale(1.8); }
}

@keyframes product-change {
  0% { opacity: .55; transform: translateY(3px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes breathe {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}

@media (max-width: 920px) {
  .wake-layout { grid-template-columns: 1fr; }

  .wake-console {
    padding: 26px 0;
    border-right: 0;
    border-bottom: 1px solid #d5dfdc;
  }

  .status-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .status-list li {
    min-height: 48px;
    padding-right: 12px;
  }

  .status-list li::after {
    top: 10px;
    left: 20px;
    width: calc(100% - 20px);
    height: 1px;
    border-top: 1px dashed #b6c5c1;
    border-left: 0;
  }

  .journey-scene {
    aspect-ratio: 2.8 / 1;
    min-height: 210px;
  }
}

@media (max-width: 680px) {
  .loader-header,
  footer,
  .loader-main { width: min(100% - 28px, 1240px); }

  .loader-header { min-height: 72px; gap: 10px; }
  .loader-header img { width: 116px; }

  .language-switch button {
    min-height: 38px;
    padding-inline: 5px;
    font-size: 12px;
  }

  .loader-main { padding: 20px 0 24px; }
  .intro { margin-bottom: 16px; }
  h1 { font-size: 28px; }
  .lead { font-size: 14px; }
  .wake-console { padding: 22px 0 20px; }
  .journey-copy { min-height: 50px; }
  .live-status { font-size: 16px; }
  .timing-board { margin-top: 20px; }
  .time-metric { padding-block: 13px; }
  .time-metric + .time-metric { padding-left: 16px; }
  .time-metric strong { font-size: 34px; }
  .time-metric.is-check strong { font-size: 22px; }

  .status-list {
    grid-template-columns: 1fr;
    width: min(100%, 300px);
    margin-top: 20px;
  }

  .status-list li { min-height: 48px; padding: 0; }

  .status-list li::after {
    top: 20px;
    left: 9px;
    width: 1px;
    height: 28px;
    border-top: 0;
    border-left: 1px dashed #b6c5c1;
  }

  .scene-caption { min-height: 42px; padding-inline: 14px; }

  .journey-scene {
    min-height: 0;
    aspect-ratio: 2.35 / 1;
  }

  .product-sample {
    grid-template-columns: 1fr 1fr 1fr;
    padding: 10px 8px;
  }

  .product-sample small {
    grid-column: 1 / -1;
    text-align: center;
  }

  footer {
    min-height: 68px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
  }
}

@media (max-width: 360px) {
  h1 { font-size: 26px; }
  .loader-header img { width: 106px; }
  .language-switch button { padding-inline: 4px; }
  .time-metric.is-check strong { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .activity-indicator,
  .water-signal,
  .status-list li.active .status-mark::after,
  .product-sample.changed span { animation: none; }
}
