/* 样式：按小程序那套配色搬过来的，改成网页的写法（手机优先） */

:root {
  --bg: #f6f7f9;
  --ink: #1f2329;
  --muted: #6b7280;
  --green: #07c160;
  --amber: #b45309;
  --line: #eef2f7;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC',
    sans-serif;
}

/* 手机上是满宽，电脑上收成一条手机宽度居中，免得在大屏上拉得太开 */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadein 0.3s ease;
}

@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.wrap {
  padding: 20px 18px 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 4px 18px;
}

.topbar-sub {
  color: var(--muted);
  font-size: 14px;
}

.topbar-link {
  color: var(--green);
  font-size: 14px;
  cursor: pointer;
}

.backbar {
  padding: 4px 4px 14px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 18px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

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

.title {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 10px;
}

.sub {
  color: var(--muted);
  font-size: 13px;
}

.body-text {
  margin-top: 8px;
  color: #374151;
}

.story {
  white-space: pre-wrap;
  line-height: 1.9;
}

.qline {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.input {
  margin-top: 18px;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  font-size: 16px; /* 不能小于 16px，否则 iPhone 上点输入框会放大页面 */
  color: var(--ink);
}

.input:focus {
  outline: none;
  border-color: var(--green);
  background: #fff;
}

.phone-big {
  margin: 18px 0 4px;
  font-size: 26px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 2px;
  color: #111827;
}

.link {
  margin-top: 16px;
  text-align: center;
  color: var(--green);
  font-size: 14px;
  cursor: pointer;
}

.receipt {
  margin-top: 14px;
  padding: 11px 13px;
  background: #f0fdf4;
  border-radius: 7px;
  color: #047857;
  font-size: 14px;
}

.next-hint {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.btn {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 13px 0;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 17px;
  line-height: 1.2;
  cursor: pointer;
}

.btn:disabled {
  background: #d1d5db;
  cursor: default;
}

.btn-plain {
  margin-top: 12px;
  background: #fff;
  color: var(--green);
  border: 1px solid var(--green);
}

.btn-plain:disabled {
  background: #fff;
  color: #d1d5db;
  border-color: #d1d5db;
}

.option {
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.option-right {
  border-color: var(--green);
  background: #ecfdf5;
}

.option-wrong {
  border-color: #ef4444;
  background: #fef2f2;
}

.tip {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.tip-strong {
  color: var(--amber);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  margin-top: 14px;
  gap: 8px;
}

.checkbox-row input {
  margin-top: 5px;
  width: 18px;
  height: 18px;
  flex: none;
}

.checkbox-row .label {
  font-size: 14px;
  color: #374151;
}

.map-placeholder {
  margin-top: 12px;
  height: 180px;
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, #eef2f7, #eef2f7 10px, #e5eaf1 10px, #e5eaf1 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
}

.score {
  font-size: 48px;
  font-weight: 700;
  color: var(--green);
  text-align: center;
  margin: 10px 0;
}

.center {
  text-align: center;
}

.prod-cover {
  height: 100px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ecfdf5, #e0f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #047857;
  font-size: 15px;
  letter-spacing: 2px;
}

.prod-name {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 600;
}

.tag-row {
  margin-top: 10px;
}

.tag {
  display: inline-block;
  margin-right: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f0fdf4;
  color: #047857;
  font-size: 12px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}

.row:last-of-type {
  border-bottom: none;
}

.row .k {
  color: var(--muted);
}

.row .v {
  color: var(--ink);
}

.play {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.play:first-of-type {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}

.play .prod-name {
  margin-top: 0;
  font-size: 16px;
}

/* 顶部轻提示 */
#toast {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  max-width: 80vw;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.88);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 99;
}

#toast.show {
  opacity: 1;
}

.hidden {
  display: none !important;
}
