:root {
  --demo-ink: #132238;
  --demo-muted: #4d6279;
  --demo-blue: #125ca8;
  --demo-blue-dark: #0b477e;
  --demo-line: #d8e3ed;
  color: var(--demo-ink);
  background: #f5f9fc;
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; }
a { color: var(--demo-blue-dark); }
:focus-visible { outline: 3px solid var(--demo-blue); outline-offset: 3px; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }

.demo-width {
  width: min(1080px, calc(100% - 2rem));
  margin-inline: auto;
}
.demo-header {
  border-bottom: 1px solid var(--demo-line);
  background: #fff;
}
.demo-header-inner, .demo-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.demo-header-inner {
  min-height: 68px;
  justify-content: space-between;
}
.demo-brand {
  color: var(--demo-blue-dark);
  text-decoration: none;
  line-height: 1.2;
}
.demo-brand img { object-fit: contain; }
.demo-brand strong, .demo-brand small { display: block; }
.demo-brand small { margin-top: .2rem; font-size: .66rem; letter-spacing: .22em; }
.demo-back { padding: .6rem 0; font-size: .9rem; font-weight: 700; text-underline-offset: .25em; }
.demo-intro { padding: clamp(1.75rem, 5vw, 3.5rem) 0 1.65rem; }
.demo-intro h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.2; }
.demo-intro p { margin-top: .6rem; color: var(--demo-muted); }

.demo-layout {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  margin-bottom: 3rem;
}
.demo-progress, .demo-card {
  border: 1px solid var(--demo-line);
  border-radius: 16px;
  background: #fff;
}
.demo-progress { margin: 0; padding: .7rem; list-style: none; }
.demo-progress li {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 56px;
  padding: .55rem .7rem;
  border-radius: 9px;
  color: var(--demo-muted);
}
.demo-progress li[aria-current="step"] { background: #eaf4ff; color: var(--demo-blue-dark); }
.demo-progress li > span {
  display: grid;
  flex: none;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #eef3f8;
  font-size: .85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.demo-progress li[aria-current="step"] > span { background: var(--demo-blue); color: #fff; }
.demo-progress li[data-done] > span { background: #e1f4e9; color: #12603c; }
.demo-card {
  min-height: 365px;
  padding: clamp(1.15rem, 4vw, 2.25rem);
  box-shadow: 0 12px 33px rgb(18 48 78 / 7%);
}
.demo-card h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); line-height: 1.3; }
.demo-card h2 + p { margin-top: .55rem; color: var(--demo-muted); }

.demo-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
  margin-block: 1.5rem;
}
.demo-fields > div, .demo-order {
  min-width: 0;
  border: 1px solid var(--demo-line);
  border-radius: 9px;
  background: #f7fafd;
}
.demo-fields > div { padding: .8rem 1rem; }
.demo-fields dt, .demo-label dt, .demo-order small { color: var(--demo-muted); font-size: .84rem; }
.demo-fields dd, .demo-label dd { margin-top: .18rem; font-weight: 750; overflow-wrap: anywhere; }
.demo-order {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  margin-block: 1.5rem;
  padding: 1rem;
  cursor: pointer;
}
.demo-order input { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--demo-blue); }
.demo-order strong, .demo-order small { display: block; }
.demo-order-price { text-align: right; }

.demo-label {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: 29rem;
  margin-block: 1.5rem;
  padding: 1.05rem 1.2rem;
  border: 1px dashed #879cb1;
  border-radius: 10px;
  background: #f7fafd;
}
.demo-label figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .3rem .7rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--demo-line);
}
.demo-label figcaption span {
  border-radius: 4px;
  padding: .16rem .5rem;
  color: #744306;
  background: #fff0cf;
  font-size: .8rem;
  font-weight: 750;
}
.demo-label dl { display: grid; gap: .5rem; margin-top: .7rem; }
.demo-label-mark {
  position: absolute;
  right: 1.3rem;
  bottom: -.65rem;
  z-index: -1;
  transform: rotate(-14deg);
  font-size: clamp(3rem, 11vw, 5rem);
  color: #e0eaf3;
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .7rem;
  margin-top: 1.45rem;
}
.demo-button, .demo-statuses button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: .55rem 1rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.demo-button { background: var(--demo-blue); color: #fff; }
.demo-button:not(:disabled):hover { background: var(--demo-blue-dark); }
.demo-button-secondary, .demo-statuses button {
  border-color: var(--demo-line);
  background: #f4f8fc;
  color: var(--demo-blue-dark);
}
.demo-button-secondary:not(:disabled):hover, .demo-statuses button:not(:disabled):hover { background: #e6f1fc; }
.demo-button:disabled, .demo-statuses button:disabled {
  border-color: var(--demo-line);
  background: #f3f6f9;
  color: #64758a;
  cursor: default;
}
.demo-statuses { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.45rem; }
.demo-statuses button[aria-pressed="true"] {
  border-color: #bad6eb;
  background: #eaf4ff;
  color: var(--demo-blue-dark);
}
.demo-status-detail {
  min-height: 118px;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--demo-line);
  border-radius: 9px;
  background: #f7fafd;
  color: var(--demo-muted);
}
.demo-status-detail h3 { margin-bottom: .2rem; color: var(--demo-ink); font-size: 1rem; }

[data-demo-target] {
  position: relative;
  z-index: 1;
  border-color: #a76500;
  box-shadow: 0 0 0 3px #ffbd26, 0 0 18px 4px rgb(255 185 34 / 55%);
}
button[data-demo-target],
button[data-demo-target]:not(:disabled):hover {
  background: #ffdb54;
  color: #352200;
}
.demo-order[data-demo-target] { background: #fff3c7; }

@media (prefers-reduced-motion: no-preference) {
  [data-demo-target]::after {
    position: absolute;
    inset: -3px;
    border: 4px solid #ffbe24;
    border-radius: inherit;
    content: "";
    pointer-events: none;
    animation: demo-target-pulse 1.35s ease-out infinite;
  }
}
@keyframes demo-target-pulse {
  0% { inset: -3px; opacity: 1; }
  80%, 100% { inset: -13px; opacity: 0; }
}

@media (max-width: 720px) {
  .demo-layout { grid-template-columns: minmax(0, 1fr); }
  .demo-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: .4rem;
  }
  .demo-progress li {
    flex-direction: column;
    justify-content: center;
    gap: .25rem;
    padding: .4rem .1rem;
    font-size: clamp(.75rem, 2.6vw, .9rem);
    text-align: center;
  }
  .demo-progress li > span { width: 25px; height: 25px; }
  .demo-card { min-height: 0; }
  .demo-fields { grid-template-columns: minmax(0, 1fr); }
  .demo-fields > div {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    align-items: baseline;
    gap: .5rem;
    padding: .65rem .85rem;
  }
  .demo-fields dd { margin-top: 0; }
  .demo-order { grid-template-columns: auto minmax(0, 1fr); }
  .demo-order-price {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
    text-align: left;
  }
  .demo-actions { flex-direction: column; align-items: stretch; }
  .demo-statuses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
