:root {
  color-scheme: light;
  --ink: #28242d;
  --line: rgba(74, 66, 77, 0.34);
  --paper: #fffdf7;
  --panel: rgba(255, 255, 255, 0.78);
  --cream: #fff8d8;
  --mint: #d9ffe7;
  --aqua: #d9fbff;
  --pink: #ffe1f4;
  --lavender: #eee6ff;
  --sun: #fff3a8;
  --shadow: 0 24px 70px rgba(64, 50, 74, 0.16);
  --stroke: 1px solid var(--line);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream);
}

body {
  margin: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 10%, rgba(217, 251, 255, 0.95) 0 15%, transparent 30%),
    radial-gradient(circle at 92% 8%, rgba(255, 225, 244, 0.92) 0 16%, transparent 32%),
    radial-gradient(circle at 84% 92%, rgba(217, 255, 231, 0.95) 0 16%, transparent 34%),
    linear-gradient(120deg, #fff8cf 0%, #fef7ff 48%, #e2fbff 100%);
  color: var(--ink);
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(74, 66, 77, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 66, 77, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  pointer-events: none;
}

button,
a {
  font: inherit;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100% - 24px));
  height: 100vh;
  height: 100svh;
  margin: 0 auto;
  padding: clamp(10px, 2.2vmin, 24px) 0;
  display: grid;
  place-items: center;
}

.experience {
  position: relative;
  width: 100%;
  height: auto;
  max-height: calc(100svh - 24px);
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: clamp(10px, 1.6vmin, 15px);
  padding: clamp(14px, 2vmin, 22px);
  border: var(--stroke);
  border-radius: 8px;
  background:
    linear-gradient(126deg, rgba(255, 253, 247, 0.96), rgba(255, 250, 226, 0.94) 43%, rgba(226, 250, 252, 0.92)),
    var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  isolation: isolate;
  backdrop-filter: blur(14px);
}

.stage-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(74, 66, 77, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 66, 77, 0.055) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.42;
  pointer-events: none;
}

.experience-map {
  position: absolute;
  right: -90px;
  bottom: -74px;
  width: min(620px, 58%);
  height: 260px;
  opacity: 0.22;
  pointer-events: none;
  z-index: -1;
}

.route {
  fill: none;
  stroke-linecap: round;
  stroke-width: 4;
}

.route-base {
  stroke: rgba(74, 66, 77, 0.12);
}

.route-flow {
  stroke-dasharray: 16 20;
}

.route-a {
  stroke: #f6a6cf;
}

.route-b {
  stroke: #8dc8ff;
}

.route-c {
  stroke: #99e9b7;
}

.share-head,
.share-body,
.share-foot {
  position: relative;
  z-index: 2;
}

.share-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(10px, 1.6vmin, 18px);
  align-items: start;
  padding-bottom: clamp(9px, 1.25vmin, 13px);
  border-bottom: var(--stroke);
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  margin: 0 0 8px;
  padding: 0 10px;
  border: var(--stroke);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.title-block h1 {
  max-width: 610px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(36px, 4.8vw, 52px);
  font-weight: 950;
  line-height: 0.92;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.title-block h1 span {
  display: inline-block;
  padding: 0 8px 5px;
  border: var(--stroke);
  border-radius: 8px;
  background: linear-gradient(90deg, var(--aqua), var(--mint));
  color: var(--ink);
  -webkit-text-fill-color: currentColor;
}

.status-cluster {
  display: flex;
  gap: 10px;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: var(--stroke);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-weight: 850;
  white-space: nowrap;
}

.status-dot {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: #d8d4da;
  transform-origin: center;
}

.status-dot[data-tone="loading"] {
  background: #acd4ff;
}

.status-dot[data-tone="ok"] {
  background: #a8efbd;
}

.status-dot[data-tone="warn"] {
  background: #fff0a0;
}

.status-dot[data-tone="error"] {
  background: #ffc2dc;
}

.button {
  display: inline-flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: var(--stroke);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
}

.button:hover {
  background: var(--paper);
  box-shadow: 0 8px 18px rgba(64, 50, 74, 0.12);
}

.button.primary {
  background: linear-gradient(90deg, #d8fbff, #dcffe8);
}

.button.is-done {
  background: linear-gradient(90deg, var(--pink), var(--sun));
}

.share-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(218px, 252px);
  gap: clamp(12px, 1.8vmin, 20px);
  align-content: start;
  align-items: stretch;
  padding: 0;
}

.link-area {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 9px;
}

.section-head,
.qr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-head h2,
.qr-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 2.45vw, 25px);
  font-weight: 950;
  line-height: 1.04;
  letter-spacing: 0;
}

.count-badge {
  display: grid;
  min-width: 78px;
  min-height: 58px;
  place-items: center;
  padding: 8px;
  border: var(--stroke);
  border-radius: 8px;
  background: linear-gradient(120deg, #ffe5f5, #fff5b8);
  color: var(--ink);
  text-align: center;
}

.count-badge strong {
  font-size: 30px;
  font-weight: 950;
  line-height: 0.9;
}

.count-badge span {
  font-size: 12px;
  font-weight: 900;
}

.url-box {
  min-height: clamp(60px, 8.5vh, 82px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: var(--stroke);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(217, 251, 255, 0.78), rgba(255, 253, 247, 0.96), rgba(255, 225, 244, 0.72)),
    var(--paper);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.url-box:hover {
  box-shadow: 0 8px 18px rgba(64, 50, 74, 0.12);
}

.url-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.url-copy {
  flex: 0 0 auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: var(--stroke);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.url-box.is-copied .url-copy {
  background: linear-gradient(90deg, var(--pink), var(--sun));
}

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

.actions .button {
  justify-content: flex-start;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  text-align: left;
}

.btn-icon {
  flex: 0 0 auto;
  font-size: 16px;
}

.btn-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  line-height: 1.16;
}

.btn-title {
  font-size: 14px;
  font-weight: 950;
}

.btn-sub {
  font-size: 11px;
  font-weight: 800;
  color: rgba(44, 40, 48, 0.62);
}

.btn-title,
.btn-sub {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-cluster .button span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-area {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
  padding-left: clamp(12px, 1.6vmin, 18px);
  border-left: var(--stroke);
}

.qr-head {
  align-items: center;
}

.qr-shell {
  position: relative;
  display: grid;
  height: 100%;
  min-height: clamp(156px, 22vh, 186px);
  place-items: center;
  overflow: hidden;
  border: var(--stroke);
  border-radius: 8px;
  background: linear-gradient(135deg, #dcfbff, var(--paper) 47%, #e4ffed);
}

.qr-shell img {
  width: min(214px, 82%);
  max-height: 88%;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: crisp-edges;
  border: var(--stroke);
  border-radius: 8px;
  background: var(--paper);
}

.share-foot {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
  align-items: start;
  padding-top: clamp(8px, 1.2vmin, 12px);
  border-top: var(--stroke);
}

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

.meta-grid div {
  min-width: 0;
  padding: 0;
}

.meta-grid dt {
  margin-bottom: 4px;
  color: rgba(44, 40, 48, 0.6);
  font-size: 12px;
  font-weight: 800;
}

.meta-grid dd {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.location-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  align-content: flex-start;
  min-width: 0;
}

.location-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: var(--stroke);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.flag-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 15px;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(74, 66, 77, 0.24);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.8);
  object-fit: cover;
}

.location-name {
  min-width: 0;
}

.location-chip:nth-child(3n + 1) {
  background: var(--sun);
}

.location-chip:nth-child(3n + 2) {
  background: var(--aqua);
}

.location-chip:nth-child(3n + 3) {
  background: var(--pink);
}

@media (max-width: 760px) {
  .shell {
    width: calc(100% - 14px);
    padding: 7px 0;
  }

  .experience {
    gap: 8px;
    padding: 11px;
    max-height: calc(100svh - 14px);
  }

  .experience-map {
    right: -260px;
    bottom: 116px;
    width: 620px;
    height: 220px;
    opacity: 0.22;
  }

  .share-head {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-bottom: 8px;
  }

  .eyebrow,
  .section-kicker {
    min-height: 23px;
    margin-bottom: 5px;
    padding: 0 8px;
    font-size: 11px;
  }

  .title-block h1 {
    font-size: clamp(28px, 8.7vw, 36px);
    line-height: 0.95;
  }

  .title-block h1 span {
    padding: 0 5px 4px;
  }

  .status-cluster {
    gap: 8px;
    min-width: 0;
  }

  .status-pill {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 37px;
    padding: 0 10px;
    overflow: hidden;
  }

  .status-cluster .button {
    flex: 0 0 auto;
    width: 40px;
    min-height: 37px;
    padding: 0 10px;
  }

  .status-cluster .button span:last-child {
    display: none;
  }

  .share-body {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .link-area {
    gap: 8px;
    grid-template-rows: auto auto auto;
    align-content: start;
  }

  .section-head,
  .qr-head {
    gap: 9px;
  }

  .section-head h2,
  .qr-head h2 {
    font-size: 19px;
  }

  .count-badge {
    display: flex;
    min-width: 86px;
    min-height: 42px;
    justify-content: space-between;
    gap: 8px;
  }

  .count-badge strong {
    font-size: 26px;
  }

  .url-box {
    min-height: 54px;
    padding: 10px 11px;
    font-size: 12px;
    line-height: 1.35;
  }

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

  .button {
    min-height: 38px;
    padding: 0 8px;
    font-size: 13px;
  }

  .button span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .qr-area {
    gap: 8px;
    padding-left: 0;
    padding-top: 9px;
    border-left: 0;
    border-top: var(--stroke);
  }

  .qr-shell {
    height: clamp(132px, 21svh, 176px);
    min-height: 0;
  }

  .qr-shell img {
    width: min(150px, 58%);
    max-height: 88%;
  }

  .share-foot {
    grid-template-columns: 1fr;
    gap: 7px;
    padding-top: 8px;
  }

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

  .meta-grid dt {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .meta-grid dd {
    font-size: 12px;
  }

  .location-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .location-chip {
    padding: 4px 6px;
    font-size: 11px;
  }

  .flag-icon {
    width: 18px;
    height: 13px;
  }
}

@media (max-width: 380px), (max-height: 740px) {
  .experience {
    gap: 6px;
    padding: 9px;
  }

  .title-block h1 {
    font-size: clamp(25px, 8vw, 31px);
  }

  .eyebrow,
  .section-kicker {
    min-height: 21px;
    margin-bottom: 4px;
    font-size: 10px;
  }

  .status-pill,
  .status-cluster .button,
  .button {
    min-height: 34px;
    font-size: 13px;
  }

  .section-head h2,
  .qr-head h2 {
    font-size: 17px;
  }

  .url-box {
    min-height: 46px;
  }

  .qr-shell {
    height: clamp(102px, 17svh, 128px);
  }

  .qr-shell img {
    width: min(116px, 56%);
  }

  .location-strip {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .location-chip {
    padding: 4px 6px;
    font-size: 11px;
  }

  .flag-icon {
    width: 18px;
    height: 13px;
  }
}

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