:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #68736f;
  --paper: #f4f2e9;
  --paper-deep: #e7e4d8;
  --line: #c9c9bd;
  --green: #16a368;
  --green-dark: #08774a;
  --green-pale: #d9f6e9;
  --yellow: #f1c84c;
  --orange: #ee7a3b;
  --red: #d84d42;
  --white: #fffef9;
  --shadow: 6px 6px 0 rgba(23, 32, 29, 0.15);
  --radius: 3px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.matrix-scroll:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.grid-paper {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(23, 32, 29, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 29, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.topbar,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 50%;
  font-family: "Courier New", monospace;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong,
.eyebrow,
.section-label p,
.card-index,
footer,
.privacy-chip,
.format-kicker,
.method-code {
  font-family: "Courier New", "Songti SC", monospace;
  letter-spacing: 0.09em;
}

.brand-copy strong {
  font-size: 0.95rem;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.68rem;
}

.privacy-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  background: rgba(255, 254, 249, 0.6);
  font-size: 0.68rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(22, 163, 104, 0.5);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 7px rgba(22, 163, 104, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 104, 0); }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.55fr);
  gap: clamp(32px, 7vw, 100px);
  align-items: end;
  padding: clamp(58px, 8vw, 108px) 0 70px;
}

.hero-copy,
.hero-intro,
.setup-footer,
.local-note {
  min-width: 0;
  max-width: 100%;
}

.hero-intro,
.local-note {
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 28px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(3rem, 7.2vw, 6.9rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.06em;
}

h1 em {
  position: relative;
  z-index: 0;
  color: var(--green-dark);
  font-style: normal;
}

h1 em::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.04em;
  right: -0.05em;
  bottom: 0.05em;
  height: 0.18em;
  background: var(--yellow);
  transform: rotate(-1.2deg);
}

.mobile-title-break {
  display: none;
}

.hero-intro {
  max-width: 640px;
  margin-bottom: 0;
  color: #46514d;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

.environment-card {
  position: relative;
  padding: 24px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
}

.environment-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 28px solid var(--paper);
  border-left: 28px solid transparent;
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.card-index {
  color: var(--yellow);
  font-size: 0.68rem;
}

.card-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.environment-status {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 23px 0 18px;
}

.status-light {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 2px var(--yellow);
}

.environment-status.detected .status-light {
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green);
}

.environment-list {
  margin: 0;
}

.environment-list > div {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  font-size: 0.78rem;
}

.environment-list dt {
  color: rgba(255, 255, 255, 0.55);
}

.environment-list dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ua-details {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
}

.ua-details summary {
  cursor: pointer;
}

.ua-details code {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  color: var(--green-pale);
  line-height: 1.45;
}

.setup-panel,
.format-section,
.records-section,
.return-section {
  border-top: 1px solid var(--ink);
}

.setup-panel {
  padding: 32px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.section-label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.section-label > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.section-label p {
  margin: 0 0 4px;
  color: var(--green-dark);
  font-size: 0.65rem;
  font-weight: 700;
}

.section-label h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.1;
}

.setup-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 28px;
  margin: 34px 0 24px 50px;
}

.field {
  display: grid;
  gap: 9px;
}

.field > span {
  font-weight: 700;
  font-size: 0.86rem;
}

.field small {
  color: var(--muted);
  font-size: 0.72rem;
}

.input-shell {
  display: flex;
  align-items: center;
  border: 1px solid var(--ink);
  background: var(--paper);
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

.input-shell:focus-within,
textarea:focus {
  border-color: var(--green-dark);
  box-shadow: 3px 3px 0 var(--green-pale);
}

.input-prefix {
  padding-left: 15px;
  color: var(--green-dark);
  font-family: "Courier New", monospace;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
}

input {
  border: 0;
  padding: 14px 13px 14px 6px;
  font-family: "Courier New", monospace;
  font-size: 1rem;
  outline: none;
}

textarea {
  min-height: 84px;
  padding: 12px 14px;
  resize: vertical;
  outline: none;
}

.field-error {
  min-height: 1em;
  color: var(--red) !important;
  font-weight: 700;
}

.setup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-left: 50px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}

.local-note {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 570px;
  color: var(--muted);
  font-size: 0.76rem;
}

.local-note svg {
  width: 22px;
  flex: 0 0 auto;
  fill: var(--green-dark);
}

.primary-button,
.secondary-button,
.text-button,
.copy-button,
.result-button,
.matrix-trigger {
  cursor: pointer;
  border-radius: 0;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border: 1px solid var(--ink);
  background: var(--green);
  color: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 800;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.primary-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.primary-button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.format-section,
.records-section,
.return-section {
  margin-top: 96px;
  padding-top: 28px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.section-explainer {
  max-width: 360px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 30px;
}

.format-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: rgba(255, 254, 249, 0.78);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.format-card:hover {
  transform: translateY(-3px);
  box-shadow: 4px 5px 0 rgba(23, 32, 29, 0.18);
}

.format-card::after {
  content: attr(data-number);
  position: absolute;
  right: -7px;
  bottom: -28px;
  color: rgba(23, 32, 29, 0.045);
  font-family: Georgia, serif;
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.format-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.format-kicker {
  margin: 0;
  color: var(--green-dark);
  font-size: 0.63rem;
  font-weight: 700;
}

.platform-badge {
  padding: 4px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.62rem;
}

.format-card h3 {
  margin: 23px 0 8px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 1.35rem;
}

.format-card > p {
  min-height: 42px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.76rem;
}

.url-preview {
  position: relative;
  z-index: 1;
  display: block;
  min-height: 70px;
  padding: 11px;
  overflow-wrap: anywhere;
  border-left: 3px solid var(--green);
  background: var(--paper-deep);
  color: #34403c;
  font-family: "Courier New", monospace;
  font-size: 0.66rem;
  line-height: 1.45;
}

.format-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 17px;
}

.copy-button,
.format-quick-link {
  flex: 1;
  padding: 9px 10px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  text-align: center;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
}

.format-quick-link {
  background: var(--ink);
  color: var(--white);
}

.copy-button:hover,
.format-quick-link:hover {
  background: var(--yellow);
  color: var(--ink);
}

.matrix-section {
  margin-top: 96px;
  margin-inline: calc(50% - 50vw);
  padding: 48px max(20px, calc((100vw - 1180px) / 2)) 56px;
  background: var(--ink);
  color: var(--white);
}

.section-label.inverse p {
  color: var(--yellow);
}

.inverse-copy {
  color: rgba(255, 255, 255, 0.62);
}

.inverse-copy strong {
  color: var(--yellow);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 18px;
}

.legend span {
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.68rem;
}

.legend b {
  color: var(--yellow);
}

.matrix-scroll {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #1c2723;
  scrollbar-color: var(--green) #2d3733;
}

.test-matrix {
  width: 100%;
  min-width: 950px;
  border-collapse: collapse;
}

.test-matrix th,
.test-matrix td {
  padding: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.test-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #24302c;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.68rem;
  font-weight: 600;
}

.test-matrix thead th:first-child,
.test-matrix tbody th {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 195px;
  background: #202b27;
  text-align: left;
}

.test-matrix thead th:first-child {
  z-index: 4;
}

.test-matrix tbody th strong,
.test-matrix tbody th small {
  display: block;
}

.test-matrix tbody th strong {
  color: var(--white);
  font-family: "Songti SC", "STSong", serif;
  font-size: 0.9rem;
}

.test-matrix tbody th small {
  margin-top: 4px;
  color: var(--green-pale);
  font-family: "Courier New", monospace;
  font-size: 0.59rem;
  font-weight: 400;
}

.method-code {
  display: block;
  margin-bottom: 2px;
  color: var(--yellow);
  font-size: 0.62rem;
}

.matrix-trigger {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: var(--white);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 800;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.matrix-trigger:hover {
  background: var(--yellow);
  color: var(--ink);
  transform: translateY(-2px);
}

.matrix-trigger.is-disabled,
.format-quick-link.is-disabled {
  cursor: not-allowed;
  opacity: 0.28;
  pointer-events: none;
}

.mobile-scroll-hint {
  display: none;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.68rem;
  text-align: center;
}

.record-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.secondary-button,
.text-button {
  padding: 9px 12px;
  border: 1px solid var(--ink);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 700;
}

.secondary-button:hover {
  background: var(--ink);
  color: var(--white);
}

.text-button {
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button.danger {
  color: var(--red);
}

.result-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 27px 0 15px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.69rem;
}

.result-key > span {
  color: var(--ink);
  font-weight: 800;
}

.result-dot {
  width: 8px;
  height: 8px;
  margin-right: -7px;
  border-radius: 50%;
}

.result-dot.direct { background: var(--green); }
.result-dot.warning { background: var(--yellow); }
.result-dot.web { background: var(--orange); }
.result-dot.fail { background: var(--red); }

.empty-state {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 254, 249, 0.56);
}

.empty-state[hidden] {
  display: none;
}

.empty-state span {
  color: var(--line);
  font-family: Georgia, serif;
  font-size: 2.5rem;
  font-weight: 900;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.records-list {
  display: grid;
  gap: 10px;
}

.record-item {
  display: grid;
  grid-template-columns: 105px minmax(150px, 1fr) minmax(170px, 1.2fr) auto;
  gap: 16px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  background: var(--white);
}

.record-time {
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
}

.record-test strong,
.record-test small {
  display: block;
}

.record-test strong {
  font-size: 0.8rem;
}

.record-test small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.67rem;
}

.record-url {
  overflow: hidden;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-buttons {
  display: flex;
  gap: 5px;
}

.result-button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
}

.result-button:hover,
.result-button.is-active {
  border-color: var(--ink);
  color: var(--ink);
}

.result-button[data-result="direct"].is-active { background: var(--green); color: white; }
.result-button[data-result="warning"].is-active { background: var(--yellow); }
.result-button[data-result="web"].is-active { background: var(--orange); color: white; }
.result-button[data-result="fail"].is-active { background: var(--red); color: white; }

.return-lab {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  margin-top: 30px;
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
}

.return-monitor {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: 36px;
  overflow: hidden;
  border-right: 1px solid var(--ink);
  background: var(--green-pale);
  text-align: center;
  transition: background 220ms ease;
}

.return-monitor::after {
  content: attr(data-state);
  position: absolute;
  right: -12px;
  bottom: -28px;
  color: rgba(8, 119, 74, 0.07);
  font-family: "Courier New", monospace;
  font-size: 4.6rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}

.return-monitor[data-state="armed"] {
  background: #f5edc5;
}

.return-monitor[data-state="captured"] {
  background: #bcefd8;
}

.return-radar {
  position: relative;
  width: 132px;
  height: 132px;
  margin-bottom: 16px;
}

.radar-ring,
.radar-core {
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.radar-ring {
  width: 72px;
  height: 72px;
  border: 1px solid var(--green-dark);
  opacity: 0;
  animation: radar-wave 2.4s infinite;
}

.radar-ring.ring-two {
  animation-delay: 1.2s;
}

.radar-core {
  width: 22px;
  height: 22px;
  border: 5px solid var(--white);
  background: var(--green);
  box-shadow: 0 0 0 2px var(--ink), 0 0 24px rgba(22, 163, 104, 0.45);
}

@keyframes radar-wave {
  0% { width: 34px; height: 34px; opacity: 0.85; }
  100% { width: 132px; height: 132px; opacity: 0; }
}

.return-monitor-copy {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
}

.return-monitor-kicker {
  margin-bottom: 9px;
  color: var(--green-dark);
  font-family: "Courier New", monospace;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.return-monitor-copy strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 1.4rem;
}

.return-monitor-copy p {
  max-width: 290px;
  margin: 9px 0 0;
  color: #52605b;
  font-size: 0.75rem;
}

.return-console {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 4vw, 48px);
}

.return-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 0 27px;
  padding: 0;
  list-style: none;
}

.return-flow li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-inline: 10px;
  text-align: center;
}

.return-flow li:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 13px;
  right: -8px;
  color: var(--green-dark);
  font-family: "Courier New", monospace;
}

.return-flow li > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-family: "Courier New", monospace;
  font-size: 0.65rem;
  font-weight: 800;
}

.return-flow strong,
.return-flow small {
  display: block;
}

.return-flow strong {
  font-size: 0.76rem;
}

.return-flow small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.64rem;
}

.signal-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 15px;
  border: 1px dashed var(--line);
  background: var(--paper);
}

.signal-panel > span,
.signal-panel small {
  color: var(--muted);
  font-size: 0.66rem;
}

.signal-panel strong {
  color: var(--green-dark);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.return-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.return-footnote {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 0.69rem;
}

.coupon-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(11, 17, 15, 0.78);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.coupon-overlay[hidden] {
  display: none;
}

.coupon-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.coupon-card {
  position: relative;
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 10px 10px 0 var(--green);
  transform: translateY(24px) rotate(-0.7deg) scale(0.97);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.coupon-card:focus {
  outline: none;
}

.coupon-overlay.is-visible .coupon-card {
  transform: translateY(0) rotate(-0.7deg) scale(1);
}

.coupon-close {
  position: absolute;
  z-index: 2;
  top: 15px;
  right: 15px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0 0 3px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  font-size: 1.35rem;
  line-height: 1;
}

.coupon-close:hover {
  background: var(--yellow);
  color: var(--ink);
}

.coupon-flag {
  padding: 24px 58px 22px 28px;
  background: var(--green-dark);
  color: var(--white);
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.coupon-body {
  padding: 34px;
}

.coupon-eyebrow {
  margin-bottom: 11px;
  color: var(--green-dark);
  font-family: "Courier New", monospace;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.coupon-body h2 {
  margin-bottom: 16px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.coupon-body h2 em {
  position: relative;
  color: var(--green-dark);
  font-style: normal;
  background: linear-gradient(transparent 78%, var(--yellow) 78%);
}

.coupon-description {
  color: var(--muted);
  font-size: 0.82rem;
}

.coupon-ticket {
  position: relative;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: stretch;
  margin: 25px 0;
  border: 1px solid var(--ink);
  background: var(--white);
}

.coupon-ticket::before,
.coupon-ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transform: translateY(-50%);
}

.coupon-ticket::before { left: -9px; }
.coupon-ticket::after { right: -9px; }

.coupon-ticket > div {
  display: grid;
  align-content: center;
  padding: 20px;
}

.coupon-ticket > div:first-child {
  border-right: 1px dashed var(--ink);
  background: var(--yellow);
}

.coupon-ticket span,
.coupon-code-block small {
  color: #59625e;
  font-family: "Courier New", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.coupon-ticket strong {
  margin-top: 5px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 1.7rem;
  line-height: 1;
}

.coupon-code-block {
  grid-template-columns: 1fr auto;
}

.coupon-code-block small {
  grid-column: 1 / -1;
}

.coupon-code-block code {
  align-self: center;
  font-family: "Courier New", monospace;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.coupon-code-block button {
  align-self: center;
  padding: 7px 9px;
  cursor: pointer;
  border: 1px solid var(--ink);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 800;
}

.coupon-code-block button:hover {
  background: var(--ink);
  color: var(--white);
}

.coupon-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.coupon-source {
  display: block;
  margin-top: 24px;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.59rem;
}

.coupon-demo-label {
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper-deep);
  font-family: "Courier New", monospace;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.notice-panel {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 28px;
  margin: 64px 0 80px;
  padding: 25px 28px;
  border-left: 5px solid var(--yellow);
  background: #ebe5cf;
}

.notice-panel strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 1.1rem;
}

.notice-panel p {
  margin: 0;
  color: #59625e;
  font-size: 0.8rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 30px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.6rem;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  box-shadow: 4px 4px 0 var(--yellow);
  font-size: 0.78rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .environment-card {
    max-width: 520px;
  }

  .setup-grid,
  .format-grid {
    grid-template-columns: 1fr 1fr;
  }

  .phone-field {
    grid-column: 1 / -1;
  }

  .message-field {
    grid-column: 1 / -1;
  }

  .record-item {
    grid-template-columns: 92px 1fr auto;
  }

  .return-lab {
    grid-template-columns: 1fr;
  }

  .return-monitor {
    min-height: 290px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .record-url {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar,
  main,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    min-height: 72px;
  }

  .brand-copy small,
  .privacy-chip {
    display: none;
  }

  .hero {
    gap: 40px;
    padding: 52px 0;
  }

  h1 {
    font-size: clamp(2.75rem, 14vw, 4.4rem);
    overflow-wrap: anywhere;
  }

  .mobile-title-break {
    display: block;
  }

  .environment-card,
  .setup-panel {
    padding: 20px;
  }

  .setup-grid,
  .format-grid {
    grid-template-columns: 1fr;
  }

  .setup-grid,
  .setup-footer {
    margin-left: 0;
  }

  .setup-footer,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    justify-content: space-between;
    width: 100%;
  }

  .format-section,
  .records-section,
  .return-section,
  .matrix-section {
    margin-top: 68px;
  }

  .section-explainer {
    max-width: none;
    text-align: left;
  }

  .format-card {
    min-height: 260px;
  }

  .matrix-section {
    padding-top: 38px;
    padding-bottom: 44px;
  }

  .mobile-scroll-hint {
    display: block;
  }

  .record-actions {
    justify-content: flex-start;
    padding-left: 50px;
  }

  .record-item {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .record-time {
    grid-column: 1 / -1;
  }

  .result-key > span {
    width: 100%;
  }

  .return-flow {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .return-flow li {
    grid-template-columns: 34px 1fr;
    justify-items: start;
    text-align: left;
  }

  .return-flow li:not(:last-child)::after {
    content: "↓";
    top: 34px;
    right: auto;
    left: 12px;
  }

  .signal-panel {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .return-actions,
  .coupon-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .coupon-body {
    padding: 27px 22px;
  }

  .coupon-ticket {
    grid-template-columns: 1fr;
  }

  .coupon-ticket > div:first-child {
    border-right: 0;
    border-bottom: 1px dashed var(--ink);
  }

  .coupon-code-block {
    min-height: 92px;
  }

  .notice-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 56px;
  }

  footer {
    flex-direction: column;
  }
}

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