/* ==========================================================
   学习提示词生成器 · 样式
   移动端优先,大字体,易点
   ========================================================== */

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}
body {
  background: #F4F6FB;
  color: #2A2A2A;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ---------- Page 通用 ---------- */
.page {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}
.page-form { padding-bottom: 96px; }  /* 给底部固定按钮留空间 */

/* ---------- Hero(顶部标题) ---------- */
.hero {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #fff;
  padding: 20px 20px 22px;
}
.hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}
.hero-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
}
.hero-titles {
  flex: 1;
  min-width: 0;
}
.hero-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  line-height: 1.2;
}
.hero-subtitle {
  font-size: 14px;
  opacity: 0.92;
  line-height: 1.3;
}

/* ---------- 顶部引导文案卡片(酷视 v3) ---------- */
.guide-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #FFD980;
  border-radius: 16px;
  border-left: 6px solid #f59e0b;
  margin: 16px 16px 8px;
  padding: 16px 18px;
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(255, 159, 91, 0.12);
}
.guide-icon {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1;
}
.guide-text {
  flex: 1;
  min-width: 0;
}
.guide-title {
  font-size: 15px;
  font-weight: 600;
  color: #4A3F35;
  margin: 0 0 4px;
  line-height: 1.4;
}
.guide-desc {
  font-size: 13px;
  color: #8B7E74;
  margin: 0;
  line-height: 1.55;
  word-break: break-word;
}

/* ---------- 题目卡片 ---------- */
.quiz-form {
  padding: 0 16px;
}
.q-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 16px 18px;
  margin-top: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.q-card-optional {
  border: 1px dashed #D8DEEA;
  background: #FBFCFE;
}
.q-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.q-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.q-title {
  font-size: 16px;
  font-weight: 600;
  color: #1A1A1A;
  flex: 1;
}
.q-tag {
  font-size: 12px;
  color: #8893A8;
  background: #EEF1F7;
  padding: 2px 8px;
  border-radius: 10px;
}
.q-hint {
  font-size: 12px;
  color: #6b6b6b;
  margin-top: 12px;
  padding: 8px 12px;
  background: #fff8e1;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
  line-height: 1.55;
}
.q-hint strong {
  color: #f59e0b;
  font-weight: 600;
}
.q-body {
  padding: 0 2px;
}

/* ---------- 分段分隔(前 8 题 / 后 5 题) ---------- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 4px;
  padding: 0 4px;
}
.section-dot {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #D8DEEA, transparent);
}
.section-text {
  font-size: 13px;
  color: #8893A8;
  font-weight: 500;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ---------- emoji 卡片选择(输出类型 #14) ---------- */
.output-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.opt-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 6px;
  background: #F4F6FB;
  border: 1.5px solid #E1E6F0;
  border-radius: 12px;
  min-height: 92px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.opt-card:active { transform: scale(0.97); }
.opt-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.opt-card input[type="radio"]:checked + .opt-emoji {
  /* emoji 自身的微调,选中态主要靠下方 .opt-label */
}
.opt-emoji {
  font-size: 30px;
  line-height: 1;
}
.opt-label {
  font-size: 13px;
  font-weight: 500;
  color: #4A5468;
  text-align: center;
  line-height: 1.2;
}
.opt-tag {
  color: #f59e0b;
  font-size: 0.7em;
  margin-left: 4px;
  font-weight: 600;
}
/* 选中态:由 JS 给 label 加 .active 类 */
.opt-card.active {
  background: #fffbeb;
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.12);
}
.opt-card.active .opt-label {
  color: #f59e0b;
  font-weight: 600;
}

/* ---------- 滑块 ---------- */
.slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #E1E6F0;
  border-radius: 2px;
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: #f59e0b;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
  cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: #f59e0b;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
  cursor: pointer;
}
.slider-value {
  min-width: 70px;
  text-align: right;
  font-weight: 700;
  font-size: 20px;
  color: #f59e0b;
  white-space: nowrap;
  line-height: 1;
}
.slider-unit {
  font-size: 14px;
  font-weight: 500;
  color: #8893A8;
  margin-left: 2px;
}

/* ---------- 二选一/三选一按钮组 ---------- */
.seg {
  display: grid;
  gap: 8px;
}
.seg-2 { grid-template-columns: 1fr 1fr; }
.seg-3 { grid-template-columns: 1fr 1fr 1fr; }
.seg-stack { grid-template-columns: 1fr; }
.seg-btn {
  padding: 12px 8px;
  background: #F4F6FB;
  border: 1.5px solid #E1E6F0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: #4A5468;
  text-align: center;
  transition: all 0.15s ease;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
}
.seg-btn:active { transform: scale(0.97); }
.seg-btn.active {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #f59e0b;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.12);
}

/* ---------- 下拉 ---------- */
.select {
  width: 100%;
  padding: 12px 14px;
  background: #F4F6FB;
  border: 1.5px solid #E1E6F0;
  border-radius: 10px;
  font-size: 16px;
  color: #2A2A2A;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='%238893A8' d='M6 8L0 0h12z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  padding-right: 36px;
}
.select:focus {
  outline: none;
  border-color: #f59e0b;
  background-color: #fff;
}

/* ---------- 多选 chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.chip {
  padding: 9px 14px;
  background: #F4F6FB;
  border: 1.5px solid #E1E6F0;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 500;
  color: #4A5468;
  transition: all 0.15s ease;
  min-height: 38px;
}
.chip:active { transform: scale(0.97); }
.chip.active {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #f59e0b;
  font-weight: 600;
}

/* ---------- 文本输入/textarea ---------- */
.text-input {
  width: 100%;
  padding: 12px 14px;
  background: #F4F6FB;
  border: 1.5px solid #E1E6F0;
  border-radius: 10px;
  font-size: 16px;
  color: #2A2A2A;
  transition: all 0.15s ease;
  margin-top: 4px;
}
.text-input:focus {
  outline: none;
  border-color: #f59e0b;
  background: #fff;
}
.text-input::placeholder {
  color: #A6AEBE;
}
.text-area {
  resize: vertical;
  min-height: 56px;
  line-height: 1.55;
  font-family: inherit;
}

/* ---------- 底部固定按钮栏 ---------- */
.submit-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  z-index: 50;
}
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transition: all 0.15s ease;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- 表单底部留白(避免被固定栏遮挡) ---------- */
.form-bottom-spacer {
  height: 24px;
}

/* =================== Page 2 · 结果页 =================== */
.page-result {
  background: #F4F6FB;
  padding-bottom: 40px;
}
.result-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #EEF1F7;
  position: sticky;
  top: 0;
  z-index: 10;
}
.btn-back {
  background: transparent;
  border: none;
  color: #f59e0b;
  font-size: 16px;
  font-weight: 600;
  padding: 6px 8px;
  margin-left: -8px;
}
.btn-back:active { opacity: 0.6; }

/* ---------- 操作指引 banner(顶部,v0.7 从底部移上来) ---------- */
.instruction-banner {
  background: linear-gradient(135deg, #fff8e1 0%, #fffbeb 100%);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px auto 16px;
  border-left: 4px solid #f59e0b;
  max-width: 480px;
  box-sizing: border-box;
}
.instruction-title {
  font-size: 15px;
  font-weight: 600;
  color: #6b5400;
  margin-bottom: 8px;
}
.instruction-step {
  font-size: 13px;
  color: #2a2a2a;
  line-height: 1.6;
  margin-bottom: 8px;
  word-break: break-word;
}
.instruction-hint {
  font-size: 12px;
  color: #6b6b6b;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.5);
  padding: 6px 10px;
  border-radius: 6px;
  word-break: break-word;
}

/* ---------- 结果插画 ---------- */
.result-illustration {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 16px auto 0;
  padding: 0 16px;
  box-sizing: border-box;
}

.result-card {
  background: #fff;
  margin: 16px 16px 0;
  padding: 18px 18px 20px;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #2A2A2A;
  margin-bottom: 14px;
}
.result-check {
  font-size: 20px;
}
.result-output-wrap {
  background: #F8FAFE;
  border: 1px solid #E1E6F0;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
  max-height: 360px;
  overflow-y: auto;
}
.result-output {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #2A2A2A;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.btn-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transition: all 0.15s ease;
}
.btn-copy:active { transform: scale(0.98); }
.btn-copy.copied {
  background: linear-gradient(135deg, #34C759 0%, #4DD879 100%);
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

/* ---------- 三段引导(视频 / 公众号 / 回顾) ---------- */
.followup {
  margin: 14px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fu-item {
  background: #fff;
  border-radius: 14px;
  padding: 16px 16px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.fu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.fu-title {
  font-size: 18px;
  font-weight: 700;
  color: #1A1A1A;
}
.fu-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.fu-body-text {
  align-items: flex-start;
}
.fu-qr-placeholder {
  width: 140px;
  height: 140px;
  background: #F4F6FB;
  border: 2px dashed #D8DEEA;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.fu-qr-placeholder-lg {
  width: 192px;
  height: 192px;
}
.fu-qr-placeholder-lg .fu-qr-icon {
  font-size: 42px;
}
.fu-qr-placeholder-lg .fu-qr-text {
  font-size: 13px;
}
.fu-qr-img {
  width: 192px;
  height: 192px;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}
.fu-qr-icon {
  font-size: 32px;
  margin-bottom: 4px;
}
.fu-qr-text {
  font-size: 12px;
  font-weight: 500;
  color: #A6AEBE;
}
.fu-qr-hint {
  font-size: 10px;
  color: #C0C7D3;
  margin-top: 2px;
}
.fu-desc {
  font-size: 13px;
  color: #6B7488;
  text-align: center;
  line-height: 1.5;
}
.fu-desc-strong {
  font-size: 14px;
  font-weight: 600;
  color: #2A2A2A;
  text-align: left;
  width: 100%;
}
.fu-desc-hint {
  font-size: 12px;
  color: #6b6b6b;
  margin-top: 8px;
  padding: 6px 10px;
  background: #fff8e1;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
  line-height: 1.5;
  width: 100%;
  text-align: left;
}

/* ---------- 结果页底部 ---------- */
.result-footer {
  text-align: center;
  padding: 20px 16px 10px;
  color: #A6AEBE;
  font-size: 12px;
}
.footer-brand {
  letter-spacing: 0.5px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.3s ease;
  max-width: 90vw;
}
/* 关键修复:hidden 属性必须真正生效 */
.toast[hidden] {
  display: none !important;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 360px) {
  .hero-title { font-size: 20px; }
  .hero-subtitle { font-size: 13px; }
  .q-title { font-size: 15px; }
  .seg-btn { font-size: 14px; padding: 10px 6px; }
  .chip { font-size: 13px; padding: 8px 12px; }
  .fu-title { font-size: 15px; }
}
@media (min-width: 480px) {
  .hero-title { font-size: 24px; }
  .quiz-form, .guide-card, .result-card, .followup, .instruction-banner {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  .guide-card { margin-left: auto; margin-right: auto; }
  .submit-bar .btn-primary {
    max-width: 480px;
    margin: 0 auto;
  }
  .submit-bar {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ---------- 暗色模式微调(可选,非主目标) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}