:root {
  color-scheme: light;
  --ink: #000000;
  --paper: #ffffff;
  --paper-soft: #fff9e8;
  --yellow: #ffe44d;
  --blue: #7bdcff;
  --pink: #ff8ac2;
  --green: #9dff73;
  --red: #ff8d6b;
  --line: 2px solid #000;
  --shell: min(1180px, calc(100vw - 32px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}

body.theme-public,
body.theme-admin {
  background: #ffffff;
}

body::before {
  content: none;
}

a,
button,
input,
textarea {
  font: inherit;
  border-radius: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: var(--line);
  background: transparent;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease;
}

input:focus,
textarea:focus {
  border-color: #ff3366;
}

textarea {
  resize: vertical;
  min-height: 104px;
}

.shell {
  width: var(--shell);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin-top: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: var(--line);
  background: #fff;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark strong,
.brand-mark small {
  display: block;
}

.brand-mark strong {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark small {
  margin-top: 3px;
  font-size: 0.86rem;
}

.brand-orb {
  width: 36px;
  height: 36px;
  border: var(--line);
  background: var(--blue);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.top-nav a:not(.pill) {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: var(--line);
  background: #fff;
  font-weight: 700;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.top-nav a:not(.pill):hover {
  background: #000;
  color: #fff;
}

.hero-header {
  padding: 64px 0 20px;
}

.hero-header h1,
.hero-copy h1,
.section-title h2,
.card-heading h2,
.admin-panel h1,
.admin-panel h2,
.sheet-head h3,
.list-head h2 {
  margin: 12px 0 0;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-header h1,
.hero-copy h1 {
  font-size: clamp(2.2rem, 5.6vw, 4.2rem);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 440px);
  gap: 30px;
  align-items: stretch;
  padding: 0 0 40px;
}

.hero-copy p,
.card-heading p,
.feature-card p,
.timeline-card p,
.inline-message,
.note-panel p,
.result-item p,
.list-head p,
.item-card p,
.faq-answer p,
.step-box p,
.marketing-alert p {
  color: var(--ink);
}

.marketing-alert {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: var(--line);
  background: #fff;
  display: grid;
  gap: 10px;
}

.marketing-alert p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
}

.eyebrow,
.card-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 10px;
  border: var(--line);
  background: var(--yellow);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow.highlight {
  background: var(--red);
  color: #fff;
}

.alert-badge {
  background: var(--pink);
  color: #000;
}

.card-badge {
  background: var(--blue);
}

.card-badge.success {
  background: var(--green);
}

.brutal-steps {
  display: grid;
  gap: 12px;
  margin: 22px 0 28px;
}

.step-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: var(--line);
  background: #fff;
}

.step-num {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.step-box p {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
}

strong.highlight-text,
p.highlight-text {
  background: var(--yellow);
  color: #000;
  display: inline-block;
  padding: 2px 6px;
}

.hero-actions,
.result-fields,
.stat-grid,
.feature-grid,
.timeline,
.admin-grid,
.media-grid,
.redeem-form,
.stack-form,
.field,
.result-sheet,
.note-panel,
.item-list,
.detail-grid,
.faq-list,
.bullet-list {
  display: grid;
  gap: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 20px;
}

.pill,
.mini-button,
.floating-support {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: var(--line);
  background: #fff;
  color: #000;
  font-weight: 700;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.pill:hover,
.mini-button:hover,
.floating-support:hover,
.pill:focus-visible,
.mini-button:focus-visible,
.floating-support:focus-visible {
  background: #000;
  color: #fff;
}

.pill-primary {
  background: var(--yellow);
}

.pill-secondary {
  background: #fff;
}

.pill-light {
  background: var(--pink);
}

.wide {
  width: 100%;
}

.glass-card {
  border: var(--line);
  background: #fff;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.stat-card,
.feature-card,
.timeline-card,
.admin-panel,
.admin-list,
.redeem-card,
.faq-item,
.detail-sheet,
.video-card,
.guide-card,
.support-card {
  padding: 20px;
}

.redeem-card {
  background: var(--blue);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.feature-card:hover,
.stat-card:hover,
.item-card:hover {
  background: #000;
  color: #fff;
}

.feature-card:hover p,
.feature-card:hover h2,
.feature-card:hover h3,
.stat-card:hover p,
.stat-card:hover h2,
.stat-card:hover h3,
.item-card:hover p,
.item-card:hover h2,
.item-card:hover h3 {
  color: #fff;
}

.stat-card:nth-child(3n + 1) {
  background: var(--yellow);
}

.stat-card:nth-child(3n + 2) {
  background: var(--blue);
}

.stat-card:nth-child(3n + 3) {
  background: var(--green);
}

.feature-grid > .feature-card:nth-child(4n + 1) {
  background: #fff;
}

.feature-grid > .feature-card:nth-child(4n + 2) {
  background: var(--blue);
}

.feature-grid > .feature-card:nth-child(4n + 3) {
  background: var(--pink);
}

.feature-grid > .feature-card:nth-child(4n + 4) {
  background: var(--green);
}

.field span,
.result-item label,
.note-panel label {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 700;
}

.inline-message {
  min-height: 24px;
  font-size: 0.95rem;
  font-weight: 700;
}

.inline-message.success,
.inline-message.error {
  padding: 8px 10px;
  border: var(--line);
}

.inline-message.success {
  background: var(--green);
}

.inline-message.error {
  background: var(--red);
}

.result-sheet {
  padding-top: 10px;
}

.result-fields {
  grid-template-columns: 1fr;
}

.result-item,
.note-panel {
  padding: 14px;
  border: var(--line);
  background: #fff;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.note-panel {
  align-items: start;
}

.note-content {
  display: grid;
  gap: 8px;
}

.result-item p,
.note-panel p,
.item-card h3,
.item-card p {
  margin: 0;
  font-weight: 700;
  word-break: break-word;
}

#createdCode {
  white-space: pre-wrap;
}

.result-item.single {
  align-items: flex-end;
}

.compact {
  margin-top: 6px;
}

.content,
.workflow,
.faq-block {
  padding: 56px 0 26px;
}

.section-title {
  max-width: 760px;
  margin-bottom: 20px;
}

.align-left {
  margin-left: 0;
}

.feature-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card,
.timeline-card {
  min-height: 210px;
}

.feature-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--line);
  background: #fff;
  font-weight: 700;
}

.timeline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.timeline-card span {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border: var(--line);
  background: var(--yellow);
  font-size: 0.8rem;
  font-weight: 700;
}

.faq-item {
  padding: 0;
}

.faq-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  background: transparent;
  color: #000;
  text-align: left;
  font-weight: 700;
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
}

.faq-answer p {
  overflow: hidden;
  margin: 0;
  padding: 0 16px 0;
  font-weight: 600;
}

.faq-item.active .faq-answer {
  grid-template-rows: 1fr;
}

.faq-item.active .faq-answer p {
  padding-bottom: 16px;
}

.media-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.video-frame {
  margin-top: 14px;
  border: var(--line);
  background: #000;
}

.video-frame video {
  width: 100%;
  display: block;
  min-height: 260px;
  background: #000;
}

.resource-actions {
  margin-top: 16px;
}

.bullet-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.bullet-list li {
  position: relative;
  padding-left: 20px;
  font-weight: 600;
}

.bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 9px;
  height: 9px;
  border: var(--line);
  background: var(--red);
}

.floating-support {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  background: var(--pink);
}

.floating-dot {
  width: 10px;
  height: 10px;
  background: #000;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 50;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  max-width: min(92vw, 560px);
  padding: 10px 16px;
  border: var(--line);
  background: var(--yellow);
  font-weight: 700;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hidden {
  display: none !important;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.button-loader {
  width: 14px;
  height: 14px;
  border: var(--line);
  border-top-color: transparent;
  display: none;
  animation: spin 0.8s linear infinite;
}

.is-loading .button-loader {
  display: inline-block;
}

.admin-shell {
  padding: 36px 0 54px;
}

.admin-grid {
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
}

.admin-panel:nth-child(1) {
  background: var(--yellow);
}

.admin-panel:nth-child(2) {
  background: #fff;
}

.admin-list {
  margin-top: 18px;
  background: #fff;
}

.list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.list-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
}

.list-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tabs .pill {
  min-height: 40px;
}

.filter-tabs .pill.is-active {
  background: var(--yellow);
}

.filter-search {
  display: grid;
  gap: 6px;
  min-width: min(360px, 100%);
  flex: 1 1 260px;
}

.filter-search span {
  font-size: 0.8rem;
  font-weight: 700;
}

.filter-search input {
  border: var(--line);
  padding: 10px 12px;
}

.align-right {
  text-align: right;
}

.item-list {
  min-height: 160px;
}

.empty-state {
  place-items: center;
  text-align: center;
  padding: 32px 18px;
  border: var(--line);
  background: var(--paper-soft);
  font-weight: 700;
}

.item-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  border: var(--line);
  background: #fff;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.status-chip {
  padding: 6px 10px;
  border: var(--line);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-chip.pending {
  background: var(--yellow);
}

.status-chip.done {
  background: var(--green);
}

.status-chip.recycled {
  background: var(--pink);
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.14);
}

.detail-sheet {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 28px));
  margin: 8vh auto 0;
  background: #fff;
}

.detail-grid {
  margin-top: 14px;
}

.guide-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--red);
}

.blink-arrow {
  animation: point-left 1.3s infinite ease-in-out;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

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

.mt-auto {
  margin-top: auto;
}

.mt-2 {
  margin-top: 0.5rem;
}

.w-full {
  width: 100%;
}

.w-fit {
  width: fit-content;
}

.block {
  display: block;
}

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

@keyframes point-left {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-8px);
  }
}

@media (max-width: 980px) {
  .hero,
  .admin-grid,
  .feature-grid,
  .timeline,
  .stat-grid,
  .media-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    position: static;
    align-items: flex-start;
  }

  .top-nav {
    width: 100%;
  }

  .hero {
    gap: 22px;
  }

  .hero-copy h1,
  .hero-header h1 {
    max-width: none;
  }

  .video-frame video {
    min-height: 220px;
  }

  .detail-sheet {
    margin-top: 4vh;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 20px, 1180px);
  }

  .site-header,
  .list-head,
  .item-card,
  .result-item {
    display: grid;
  }

  .site-header {
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
  }

  .brand-mark {
    width: 100%;
    align-items: flex-start;
  }

  .brand-mark span:last-child {
    min-width: 0;
  }

  .top-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 8px;
    justify-items: initial;
  }

  .top-nav a:not(.pill),
  .top-nav .pill,
  .top-nav button {
    width: auto;
    min-height: 42px;
    padding: 0 12px;
    flex: 0 0 auto;
    justify-content: center;
    white-space: nowrap;
  }

  .hero-header {
    padding-top: 34px;
    padding-bottom: 14px;
  }

  .hero-header h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
    line-height: 1.15;
  }

  .hero {
    gap: 16px;
    padding-bottom: 26px;
  }

  .glass-card,
  .stat-card,
  .feature-card,
  .timeline-card,
  .admin-panel,
  .admin-list,
  .redeem-card,
  .faq-item,
  .detail-sheet,
  .video-card,
  .guide-card,
  .support-card {
    padding: 16px;
  }

  .hero-actions {
    margin-top: 16px;
    gap: 10px;
  }

  .hero-actions .pill,
  .hero-actions .mini-button {
    width: 100%;
  }

  .guide-arrow {
    width: 100%;
    justify-content: center;
  }

  .guide-arrow span {
    white-space: normal !important;
  }

  .resource-actions {
    margin-top: 12px;
  }

  .result-item {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .result-item .mini-button {
    width: 100%;
  }

  .list-head {
    gap: 8px;
    margin-bottom: 12px;
  }

  .list-head-actions {
    justify-content: flex-start;
  }

  .list-head-actions .pill {
    width: 100%;
  }

  .list-filter-bar {
    align-items: stretch;
  }

  .filter-tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .filter-tabs .pill {
    flex: 0 0 auto;
    min-height: 42px;
  }

  .filter-search {
    width: 100%;
    min-width: 0;
  }

  .align-right {
    text-align: left;
  }

  .item-actions {
    justify-content: flex-start;
  }

  .item-actions .mini-button {
    flex: 1 1 160px;
  }

  .sheet-head,
  .result-sheet .sheet-head {
    display: grid !important;
    gap: 10px;
    justify-content: stretch !important;
  }

  .detail-sheet {
    width: calc(100vw - 16px);
    margin-top: 2.5vh;
    max-height: 90vh;
    overflow-y: auto;
  }

  .detail-sheet.result-sheet {
    padding: 16px !important;
  }

  .floating-support {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }

  .toast {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 560px) {
  :root {
    --shell: min(1180px, calc(100vw - 16px));
  }

  body {
    font-size: 15px;
  }

  .shell {
    width: min(100vw - 16px, 1180px);
  }

  .site-header {
    padding: 10px;
    gap: 8px;
  }

  .brand-mark {
    gap: 8px;
  }

  .brand-orb {
    width: 30px;
    height: 30px;
  }

  .brand-mark strong {
    font-size: 0.94rem;
  }

  .brand-mark small {
    font-size: 0.78rem;
    margin-top: 1px;
  }

  .top-nav {
    gap: 6px;
  }

  .hero-header {
    padding-top: 28px;
  }

  .hero-header h1 {
    font-size: clamp(1.55rem, 9vw, 2rem);
  }

  .eyebrow,
  .card-badge {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
  }

  .step-box {
    padding: 12px;
    gap: 10px;
  }

  .step-num {
    width: 26px;
    height: 26px;
    font-size: 0.9rem;
  }

  .step-box p {
    font-size: 0.95rem;
  }

  .video-frame video {
    min-height: 180px;
  }

  .bullet-list li {
    padding-left: 16px;
    font-size: 0.94rem;
  }

  .bullet-list li::before {
    top: 6px;
    width: 8px;
    height: 8px;
  }

  .result-item,
  .note-panel {
    padding: 12px;
  }

  .result-item p,
  .note-panel p {
    font-size: 0.94rem;
  }

  .floating-support {
    min-height: 44px;
    padding: 0 12px;
    font-size: 0.92rem;
  }

  .toast {
    max-width: calc(100vw - 16px);
    padding: 10px 12px;
  }
}
