/* ===== 房树人 HTP 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #f7f4ee;
  color: #2c2c2c;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.page {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  background: #f7f4ee;
  overflow: hidden;
}
.page.active { display: flex; }

.hidden { display: none !important; }

/* ===== 按钮 ===== */
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px 0;
  border: none;
  border-radius: 12px;
  background: #7a6a4f;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(122, 106, 79, 0.3);
}
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 12px 0;
  border: 1px solid #7a6a4f;
  border-radius: 12px;
  background: transparent;
  color: #7a6a4f;
  font-size: 16px;
  cursor: pointer;
}
.btn-secondary:active { background: #f0ebdf; }

/* ===== 封面页 ===== */
#page-cover { justify-content: center; background: linear-gradient(160deg, #f7f4ee 0%, #e9e0cf 60%, #d9cbaf 100%); }
.cover-inner { padding: 40px 32px; text-align: center; }
.cover-title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 4px;
  color: #4a3f2f;
  margin-bottom: 14px;
}
.cover-sub { font-size: 15px; color: #6b5d45; line-height: 1.7; margin-bottom: 28px; }
.cover-steps {
  list-style: none;
  text-align: left;
  background: rgba(255,255,255,0.65);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 30px;
  font-size: 14px;
  color: #5a4c37;
  line-height: 2;
}
.cover-hint { margin-top: 14px; font-size: 12px; color: #a2947e; }

/* ===== 绘画页 ===== */
#page-draw { background: #fff; }
.draw-header { padding: 12px 16px 8px; background: #fff; }
.draw-step-bar { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; }
.step-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #e8e2d5;
  color: #8a7a5f;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  transition: all .2s;
}
.step-dot.active { background: #7a6a4f; color: #fff; }
.step-dot.done { background: #b8a98a; color: #fff; }
.draw-tip {
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: #4a3f2f;
  padding: 6px 0 2px;
}

.canvas-wrap {
  position: relative;
  flex: 1;
  margin: 8px 12px;
  border-radius: 14px;
  overflow: hidden;
  background: #fffdf8;
  box-shadow: inset 0 0 0 1px #e5dcc8;
}
#draw-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.empty-tip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c8bda6;
  font-size: 15px;
  line-height: 1.9;
  text-align: center;
  pointer-events: none;
}

.draw-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 14px;
  background: #fff;
  gap: 10px;
}
.tool-group { display: flex; align-items: center; gap: 8px; }
.tool-color {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
}
.tool-color.active { border-color: #7a6a4f; box-shadow: 0 0 0 2px #fff inset; }
.tool-btn {
  padding: 7px 12px;
  border: 1px solid #d8cfba;
  border-radius: 8px;
  background: #fff;
  color: #5a4c37;
  font-size: 13px;
  cursor: pointer;
}
.tool-btn:active { background: #f0ebdf; }
.tool-next { background: #7a6a4f; border-color: #7a6a4f; color: #fff; font-weight: 600; }
.tool-next:active { background: #665a42; }

/* ===== 分析中 ===== */
#page-loading { justify-content: center; align-items: center; }
.loading-inner { text-align: center; padding: 20px; }
.spinner {
  width: 44px; height: 44px;
  margin: 0 auto 22px;
  border: 4px solid #e5dcc8;
  border-top-color: #7a6a4f;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 18px; color: #4a3f2f; margin-bottom: 10px; }
.loading-detail { font-size: 13px; color: #a2947e; }

/* ===== 结果页 ===== */
#page-result { background: #f7f4ee; overflow-y: auto; }
.result-scroll { padding: 24px 16px 40px; max-width: 640px; margin: 0 auto; width: 100%; }
.result-hero { text-align: center; margin-bottom: 18px; }
.result-title { font-size: 24px; color: #4a3f2f; letter-spacing: 2px; margin-bottom: 6px; }
.result-sub { font-size: 13px; color: #a2947e; }

.card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(74, 63, 47, 0.06);
}
.card h3 { font-size: 17px; color: #4a3f2f; margin-bottom: 12px; }
.card p { font-size: 14px; color: #5a4c37; line-height: 1.85; }

.free-sec { margin-bottom: 14px; }
.free-sec:last-child { margin-bottom: 0; }
.free-sec h4 {
  font-size: 15px; color: #7a6a4f;
  margin-bottom: 6px;
  padding-left: 10px;
  border-left: 3px solid #7a6a4f;
}

.pay-wall { text-align: center; background: linear-gradient(160deg, #fff 0%, #f7f0e3 100%); }
.pay-title { font-size: 19px; }
.pay-list { text-align: left; margin: 0 0 16px; padding-left: 18px; }
.pay-list li { font-size: 13px; color: #6b5d45; line-height: 2; }
.pay-price { font-size: 30px; font-weight: 700; color: #e05a5a; margin-bottom: 12px; }
.pay-hint { font-size: 12px; color: #a2947e; margin-top: 10px; }

/* 完整报告 */
.full-sec { margin-bottom: 16px; }
.full-sec:last-child { margin-bottom: 0; }
.full-sec h4 {
  font-size: 15px; color: #4a3f2f;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: #f5efe3;
  border-radius: 8px;
}
.full-sec .dim-score { font-size: 13px; color: #7a6a4f; font-weight: 600; margin-bottom: 4px; }
.full-sec p { font-size: 14px; color: #5a4c37; line-height: 1.85; }

.poster-area { margin-bottom: 16px; }
.private-area { text-align: center; }
.private-title { font-size: 16px; }
.private-desc { font-size: 13px; color: #a2947e; margin-bottom: 12px; }
.private-qr { width: 160px; height: 160px; margin: 0 auto 10px; }
.private-hint { font-size: 12px; color: #c8bda6; }

/* ===== 海报弹层 ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
}
.poster-wrap { width: 100%; max-width: 380px; }
.poster-tpls { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; }
.tpl-btn {
  padding: 6px 18px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 16px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.tpl-btn.active { background: #7a6a4f; border-color: #7a6a4f; font-weight: 600; }
#poster-canvas { width: 100%; border-radius: 12px; background: #fff; }
.poster-actions { display: flex; gap: 10px; margin-top: 14px; }
.poster-actions .btn-primary, .poster-actions .btn-secondary { flex: 1; }
