:root {
  color: #17383d;
  background: #edf3f1;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }

.topbar {
  min-height: 76px;
  padding: 14px max(20px, calc((100vw - 980px) / 2));
  color: #fff;
  background: #12343b;
  border-bottom: 3px solid #d5a62d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { margin: 0 0 4px; color: #8fd7c8; font-size: .78rem; font-weight: 700; }
h1 { margin: 0; font-size: 1.35rem; letter-spacing: 0; }
.connection-state { color: #c8e5de; font-size: .8rem; }

.shell { width: min(980px, calc(100% - 28px)); margin: 22px auto 64px; }
.state-view { min-height: 300px; display: grid; place-content: center; text-align: center; }
.state-view h2 { margin: 18px 0 8px; }
.state-view p { color: #627478; }
.spinner {
  width: 34px;
  height: 34px;
  margin: auto;
  border: 4px solid #c6d9d5;
  border-top-color: #087d70;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.summary-band {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.3fr;
  background: #fff;
  border: 1px solid #cad9d6;
}
.summary-band > div { min-width: 0; padding: 15px; border-right: 1px solid #dce6e4; }
.summary-band > div:last-child { border-right: 0; }
.label { display: block; margin-bottom: 7px; color: #64777a; font-size: .78rem; }
.summary-band strong { display: block; overflow-wrap: anywhere; }
.status-label { color: #087d70; }

.section {
  margin-top: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid #cad9d6;
}
.section h2 { margin: 0 0 16px; font-size: 1rem; }

.timeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline li {
  position: relative;
  min-width: 0;
  padding: 27px 5px 0;
  color: #718083;
  font-size: .78rem;
  text-align: center;
}
.timeline li::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 4px;
  left: 50%;
  width: 13px;
  height: 13px;
  border: 3px solid #afc2be;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
}
.timeline li::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #cbd9d6;
}
.timeline li:first-child::after { display: none; }
.timeline li.done { color: #17383d; font-weight: 700; }
.timeline li.done::before { border-color: #087d70; background: #087d70; }
.timeline li.done::after { background: #087d70; }

.items { border-top: 1px solid #dbe5e3; }
.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid #dbe5e3;
}
.item-row span:first-child { overflow-wrap: anywhere; }
.item-count { font-variant-numeric: tabular-nums; font-weight: 700; }

.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid #cbd8d6; }
.delivery { display: grid; gap: 8px; }
.delivery p { margin: 0; }
.delivery a { width: fit-content; color: #006b60; font-weight: 700; }

[hidden] { display: none !important; }

@media (max-width: 700px) {
  .topbar { min-height: 66px; padding: 12px 16px; }
  h1 { font-size: 1.12rem; }
  .connection-state { display: none; }
  .shell { width: calc(100% - 20px); margin-top: 10px; }
  .summary-band { grid-template-columns: 1fr 1fr; }
  .summary-band > div { border-bottom: 1px solid #dce6e4; }
  .summary-band > div:nth-child(2n) { border-right: 0; }
  .summary-band > div:nth-last-child(-n + 2) { border-bottom: 0; }
  .section { padding: 15px; }
  .timeline { grid-template-columns: 1fr; }
  .timeline li {
    min-height: 42px;
    padding: 6px 0 10px 34px;
    text-align: left;
  }
  .timeline li::before { top: 5px; left: 7px; transform: none; }
  .timeline li::after { top: -22px; left: 15px; width: 2px; height: 27px; }
  .photos { grid-template-columns: 1fr 1fr; }
}
