:root {
  --bg: #f7f1e8;
  --panel: #fffaf3;
  --ink: #2b2118;
  --muted: #806f5f;
  --line: rgba(91, 63, 39, 0.14);
  --jade: #79a889;
  --jade-dark: #47785e;
  --gold: #c99a4a;
  --shadow: 0 18px 48px rgba(95, 69, 43, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(121, 168, 137, 0.2), transparent 26rem),
    linear-gradient(180deg, #faf6ef 0%, var(--bg) 100%);
}

button {
  font: inherit;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(75, 50, 29, 0.05);
}

.screen {
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 18px 24px;
}

.hidden {
  display: none;
}

.gate-screen {
  display: grid;
  align-items: center;
}

.gate-screen.hidden {
  display: none;
}

.gate-card {
  padding: 26px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.gate-card h1 {
  margin-bottom: 10px;
}

.gate-card > p:last-of-type {
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.55;
}

.gate-form,
.phone-card {
  display: grid;
  gap: 9px;
}

.gate-form label,
.phone-card label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.gate-form input,
.phone-card input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--ink);
  font: inherit;
  background: #fff;
  outline: none;
}

.gate-form input:focus,
.phone-card input:focus {
  border-color: rgba(71, 120, 94, 0.8);
  box-shadow: 0 0 0 3px rgba(121, 168, 137, 0.18);
}

.form-error {
  min-height: 18px;
  margin-bottom: 2px;
  color: #a44d30;
  font-size: 13px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--jade-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.18;
}

.ghost-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 250, 243, 0.76);
}

.progress-wrap {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(108, 82, 54, 0.12);
}

.progress-bar {
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--jade), #b8c88f);
  transition: width 220ms ease;
}

.hero-card {
  margin: 16px 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-visual {
  min-height: 156px;
  background-size: cover;
  background-position: center;
}

.question-row {
  padding: 16px;
}

.question-count {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

#question-title {
  margin-bottom: 6px;
  font-size: 22px;
  line-height: 1.28;
}

.question-note {
  min-height: 20px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.option-card {
  min-height: 174px;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 18px;
  text-align: left;
  color: inherit;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(85, 62, 38, 0.12);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.option-card:active {
  transform: scale(0.98);
}

.option-card.selected {
  border-color: rgba(71, 120, 94, 0.78);
  box-shadow: 0 0 0 3px rgba(121, 168, 137, 0.18), 0 12px 30px rgba(70, 96, 75, 0.18);
}

.option-visual {
  min-height: 96px;
  background: #ece1d0;
  background-size: cover;
  background-position: center;
}

.option-visual.emoji {
  display: grid;
  place-items: center;
  color: #426c55;
  font-size: 42px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.84), transparent 30%),
    linear-gradient(135deg, #d9eadf, #f6ecd9);
}

.option-visual.palette,
.option-visual.fabric,
.option-visual.skin {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 10px;
}

.swatch {
  flex: 1;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(50, 31, 16, 0.08);
}

.option-copy {
  padding: 12px;
}

.option-copy h3 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.22;
}

.option-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.result-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-screen.hidden {
  display: none;
}

.result-top {
  padding-top: 18px;
}

.result-top h1 {
  margin-bottom: 8px;
}

.result-top p:last-child {
  color: var(--muted);
}

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

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.summary-item span:first-child {
  color: var(--muted);
}

.summary-item span:last-child {
  font-weight: 800;
  text-align: right;
}

.advice-card,
.phone-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.advice-card h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.advice-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.contact-button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, #9a6a27, var(--gold));
  box-shadow: 0 16px 32px rgba(154, 106, 39, 0.26);
}

.admin-button {
  width: 100%;
  min-height: 48px;
  border: 1px dashed rgba(91, 63, 39, 0.35);
  border-radius: 15px;
  color: var(--muted);
  font-weight: 800;
  background: rgba(255, 250, 243, 0.7);
}

.admin-panel {
  padding: 15px;
  border: 1px solid rgba(71, 120, 94, 0.24);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-panel.hidden {
  display: none;
}

.admin-panel h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.admin-panel h3 {
  margin: 14px 0 8px;
  font-size: 16px;
}

.admin-meta {
  display: grid;
  gap: 8px;
}

.admin-meta div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.admin-meta span {
  color: var(--muted);
  font-size: 13px;
}

.admin-meta strong {
  min-width: 0;
  font-size: 13px;
  word-break: break-all;
}

.admin-analysis {
  display: grid;
  gap: 10px;
}

.analysis-section {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(91, 63, 39, 0.1);
  border-radius: 14px;
  background: #fffaf3;
}

.analysis-index {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--jade-dark), var(--jade));
}

.analysis-section h4 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.3;
}

.analysis-section p,
.analysis-loading {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.analysis-loading {
  padding: 12px;
  border-radius: 12px;
  background: #fffaf3;
}

.wechat-card {
  display: grid;
  grid-template-columns: 128px 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.wechat-card.hidden {
  display: none;
}

.wechat-card img {
  display: block;
  width: 128px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
}

.wechat-card h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.wechat-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
  word-break: break-all;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--jade-dark), var(--jade));
}

@media (max-width: 360px) {
  .screen {
    padding-inline: 12px;
  }

  .options-grid {
    gap: 9px;
  }

  .option-card {
    min-height: 164px;
  }

  .option-copy h3 {
    font-size: 16px;
  }
}
