:root {
  --bg: #e7e2d6;
  --card: #fffdf8;
  --soft: #f4ede3;
  --line: #e4d7c4;
  --text: #243934;
  --muted: #6f7f79;
  --green: #2a6c5e;
  --green-deep: #213f38;
  --orange: #f28a2c;
  --orange-soft: #f6d9bd;
  --shadow: 0 16px 40px rgba(51, 61, 56, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
input,
textarea,
select {
  font: inherit;
}

.prototype-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.phone-frame {
  width: 100%;
  display: flex;
  justify-content: center;
}

.phone-screen {
  width: min(100%, 430px);
  min-height: 860px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: 34px;
  background: linear-gradient(180deg, #fbfaf7, #f3eee5);
  box-shadow: var(--shadow);
  border: 1px solid #efe6d8;
}

.mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 26px;
  background: var(--green);
  color: #fff;
}

.mini-caption,
.hero-tag,
.poster-label {
  font-size: 12px;
  letter-spacing: 0.08em;
}

.mini-header h1,
.hero-copy h2,
.challenge-copy h2 {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1.08;
}

.switch-btn,
.primary-btn,
.ghost-btn,
.segment-btn,
.bottom-tab,
.mode-card,
.link-btn {
  border: 0;
  cursor: pointer;
}

.switch-btn,
.ghost-btn {
  padding: 12px 16px;
  border-radius: 999px;
  background: #c9d6cf;
  color: var(--green-deep);
  font-weight: 700;
}

.primary-btn {
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

.activity {
  display: none;
  flex: 1;
  min-height: 0;
  margin-top: 14px;
}

.activity-active {
  display: flex;
  flex-direction: column;
}

.hero-card,
.challenge-top {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, #f68a2f, #f4a74c);
  color: #fff;
}

.hero-card {
  grid-template-columns: 1.15fr 1fr;
}

.hero-copy p,
.challenge-copy p {
  margin: 10px 0 0;
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

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

.stat-box {
  padding: 14px 10px;
  border-radius: 22px;
  text-align: center;
  background: rgba(255, 255, 255, 0.18);
}

.stat-box strong {
  display: block;
  font-size: 16px;
  line-height: 1.3;
}

.stat-box span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

.narrow strong {
  font-size: 14px;
}

.screen-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-top: 14px;
  padding-bottom: 14px;
}

.tab-panel {
  display: none;
}

.tab-panel-active {
  display: block;
}

.section-card,
.poster-card {
  padding: 16px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(42, 50, 45, 0.05);
}

.section-card + .section-card {
  margin-top: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h3 {
  margin: 0;
  font-size: 18px;
}

.link-btn {
  padding: 0;
  background: transparent;
  color: var(--green);
  font-weight: 700;
}

.works-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.work-card,
.my-item,
.rank-item {
  border-radius: 20px;
  background: #fbf6ee;
  border: 1px solid var(--line);
}

.work-cover {
  min-height: 74px;
  display: flex;
  align-items: flex-start;
  padding: 12px;
  background: linear-gradient(180deg, #f5ceb2, #f7e5d6);
}

.tag {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f3e6d7;
  color: #99643b;
  font-size: 12px;
  font-weight: 700;
}

.work-body,
.my-item {
  padding: 14px;
}

.work-body strong,
.rank-main strong,
.my-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.meta-line,
.rank-main span,
.my-item p {
  color: var(--muted);
  font-size: 13px;
}

.my-item p {
  margin: 0 0 10px;
  line-height: 1.6;
}

.info-list {
  display: grid;
  gap: 12px;
}

.info-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--soft);
}

.info-index,
.rank-no {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--orange-soft);
  color: #d76a15;
  font-size: 24px;
  font-weight: 700;
}

.info-row strong {
  display: block;
  margin-bottom: 6px;
}

.info-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.segment-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.segment-btn {
  padding: 10px 16px;
  border-radius: 999px;
  background: #efe8dc;
  color: var(--muted);
  font-weight: 700;
}

.segment-btn.active {
  background: var(--green);
  color: #fff;
}

.rank-list,
.my-list {
  display: grid;
  gap: 12px;
}

.rank-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.rank-score {
  color: var(--muted);
  font-size: 14px;
}

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.step {
  padding: 8px 12px;
  border-radius: 999px;
  background: #efe7da;
  color: var(--muted);
  font-size: 12px;
}

.step.active {
  background: #d7ebe6;
  color: var(--green);
  font-weight: 700;
}

.join-step,
.submit-panel.hidden {
  display: none;
}

.join-step-active,
.submit-panel {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #dfd4c2;
  background: #fffdfa;
  color: var(--text);
}

.full-span {
  grid-column: 1 / -1;
}

.mode-list {
  display: grid;
  gap: 12px;
}

.mode-card {
  padding: 16px;
  border-radius: 18px;
  text-align: left;
  background: #fbf6ee;
  border: 1px solid var(--line);
}

.mode-card.selected {
  background: #eaf3f0;
  border-color: #bfd8d1;
}

.mode-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.mode-card p,
.panel-note p,
.video-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.panel-note,
.video-box {
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: var(--soft);
}

.upload-box {
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed #d9c7ad;
  background: #fdf7ef;
}

.upload-box small {
  color: var(--muted);
}

.poster-card {
  background: linear-gradient(180deg, #fffaf3, #fff);
}

.poster-top strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.25;
}

.poster-body {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
}

.poster-qr {
  height: 110px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: repeating-linear-gradient(45deg, #243934, #243934 10px, #fff 10px, #fff 20px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.share-meta,
.action-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: #efe7da;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.done {
  background: #dcefe9;
  color: var(--green);
}

.bottom-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: auto;
  padding: 8px;
  position: sticky;
  bottom: 0;
  border-radius: 22px;
  background: rgba(255, 250, 244, 0.94);
  box-shadow: 0 -8px 20px rgba(37, 47, 43, 0.08);
}

.bottom-tab {
  padding: 12px 6px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.bottom-tab.active {
  background: var(--green-deep);
  color: #fff;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(33, 63, 56, 0.94);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 560px) {
  html,
  body,
  .prototype-shell {
    min-height: 100dvh;
  }

  .prototype-shell {
    padding: 0;
  }

  .phone-screen {
    width: 100%;
    min-height: 100dvh;
    padding: 12px;
    border-radius: 0;
    box-shadow: none;
    border: 0;
  }

  .mini-header,
  .hero-card,
  .challenge-top,
  .section-card,
  .poster-card {
    border-radius: 22px;
  }

  .mini-header {
    padding: 16px;
  }

  .mini-header h1,
  .hero-copy h2,
  .challenge-copy h2 {
    font-size: 24px;
  }

  .switch-btn {
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
  }

  .hero-card,
  .poster-body,
  .form-grid,
  .works-grid,
  .challenge-stats {
    grid-template-columns: 1fr;
  }

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

  .bottom-tabs {
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: -12px;
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .bottom-tab {
    font-size: 14px;
  }
}
