:root {
  --cream: #FFF6E9;
  --card: #FFFDF8;
  --ink: #3D2B1F;
  --ink-soft: #8A7563;
  --coral: #FF6B4A;
  --coral-deep: #E8532F;
  --sun: #FFC53D;
  --mint: #35B57C;
  --line: #3D2B1F;
  --shadow: 4px 4px 0 rgba(61, 43, 31, 0.9);
  --radius: 18px;
}

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

html { font-size: 16px; }

body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--cream);
  background-image:
    radial-gradient(circle at 8% 4%, rgba(255, 197, 61, 0.28) 0 90px, transparent 91px),
    radial-gradient(circle at 95% 30%, rgba(255, 107, 74, 0.14) 0 130px, transparent 131px),
    radial-gradient(circle at 15% 88%, rgba(53, 181, 124, 0.12) 0 110px, transparent 111px);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page {
  /* 流式边距：小屏 20px 起步，随屏幕宽度增长，大屏不超过 48px；中心内容区最宽 520px */
  max-width: calc(520px + 2 * clamp(20px, 5vw, 48px));
  margin: 0 auto;
  padding: 20px clamp(20px, 5vw, 48px) calc(32px + env(safe-area-inset-bottom));
}

/* ---------- 头部 ---------- */
.header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.logos {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.logos .logo-img {
  display: block;
  width: 116px;
  height: auto;
}


.logo {
  font-size: 44px;
  width: 64px;
  height: 64px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 2.5px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  transform: rotate(-4deg);
}

.header h1 {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ---------- 步骤条 ---------- */
.stepper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 8px 0;
  background: var(--cream);
  min-width: 0;
  max-width: 100%;
}

.step-pill {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: clamp(0.66rem, 2.6vw, 0.75rem);
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 999px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.step-pill .step-num {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  font-size: 0.68rem;
  border-radius: 50%;
  background: var(--ink-soft);
  color: #fff;
  transition: all 0.25s ease;
}

.step-pill.is-active {
  background: var(--coral);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 rgba(61, 43, 31, 0.9);
}

.step-pill.is-active .step-num { background: #fff; color: var(--coral-deep); }

.step-pill.is-done { color: var(--mint); }
.step-pill.is-done .step-num { background: var(--mint); }

.step-line {
  flex: 1;
  height: 3px;
  min-width: 6px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--ink-soft) 0 6px, transparent 6px 12px);
  opacity: 0.4;
}

.step-line.is-done {
  background: var(--mint);
  opacity: 1;
}

/* ---------- 面板与问题 ---------- */
.panel {
  background: var(--card);
  border: 2.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px 18px;
  animation: panelIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.q-title {
  font-size: 1.02rem;
  font-weight: 800;
  margin: 20px 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel .q-title:first-child, .voice-hint + .q-title { margin-top: 0; }

.req { color: var(--coral); font-style: normal; font-size: 1.1em; }

.q-tip {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.q-tip.is-warn {
  color: var(--coral-deep);
  font-weight: 700;
}

/* ---------- 选择卡片（单选） ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pick-card {
  min-height: 52px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink);
  background: #FFFDF8;
  border: 2.5px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-align: center;
}

.pick-card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(61,43,31,0.9); }

.pick-card.is-selected {
  background: var(--coral);
  color: #fff;
  box-shadow: 2px 2px 0 rgba(61, 43, 31, 0.9);
  transform: translate(2px, 2px);
}

/* ---------- 标签（多选） ---------- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 4px;
}

.tag {
  padding: 10px 16px;
  min-height: 44px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink);
  background: #FFFDF8;
  border: 2.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.tag:active { transform: translate(2px, 2px); }

.tag.is-selected {
  background: var(--sun);
  transform: translateY(-2px);
  box-shadow: 2px 3px 0 rgba(61, 43, 31, 0.9);
}

.tag.is-selected::after { content: " ✓"; }

.tag-hint {
  font-size: 0.72rem;
  color: var(--coral-deep);
  font-weight: 700;
  margin: 4px 0 6px;
  min-height: 1em;
}

/* ---------- 文本输入 ---------- */
.voice-hint {
  background: rgba(255, 197, 61, 0.22);
  border: 2px dashed var(--sun);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.text-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #FFFDF8;
  border: 2.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 6px;
  resize: none;
}

.text-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--coral);
  box-shadow: 3px 3px 0 rgba(255, 107, 74, 0.35);
}

.text-input::placeholder { color: #B9A795; }

/* ---------- 按钮与导航 ---------- */
.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
}

.btn {
  font-family: inherit;
  font-weight: 800;
  border: 2.5px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 50px;
  padding: 10px 18px;
  font-size: 0.95rem;
}

.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(61,43,31,0.9); }

.btn-main {
  background: var(--coral);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn-ghost {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}

/* ---------- 生成按钮（内联，位于第三步末尾） ---------- */
.btn-generate {
  display: block;
  width: 100%;
  min-height: 58px;
  margin-top: 14px;
  font-family: inherit;
  font-size: 1.08rem;
  font-weight: 800;
  background: var(--sun);
  color: var(--ink);
  border: 2.5px solid var(--line);
  border-radius: 18px;
  box-shadow: 5px 5px 0 rgba(61, 43, 31, 0.9);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-generate:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(61,43,31,0.9); }

.generate-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* ---------- 结果页 ---------- */
.result-head { text-align: center; margin-bottom: 16px; }

.result-badge {
  display: inline-block;
  padding: 8px 20px;
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--sun);
  border: 2.5px solid var(--line);
  border-radius: 999px;
  box-shadow: 3px 3px 0 rgba(61, 43, 31, 0.9);
  transform: rotate(-2deg);
}

.result-block {
  border: 2.5px solid var(--line);
  border-radius: 16px;
  background: #FFFDF8;
  padding: 14px;
  margin-bottom: 16px;
}

.result-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.result-block-head h3 { font-size: 0.95rem; font-weight: 800; }

.btn-copy-mini {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink);
  background: var(--sun);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  min-height: 34px;
  cursor: pointer;
}

.summary-list { font-size: 0.88rem; }

.summary-row {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1.5px dashed rgba(61, 43, 31, 0.18);
}

.summary-row:last-child { border-bottom: none; }

.summary-row dt {
  flex: none;
  width: 5.6em;
  color: var(--ink-soft);
  font-weight: 700;
}

.summary-row dd { flex: 1; word-break: break-word; }

.summary-row.is-voice dd { color: var(--coral-deep); font-weight: 700; }

.prompt-box {
  font-size: 0.86rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: #FFF9EF;
  border: 2px dashed rgba(61, 43, 31, 0.35);
  border-radius: 12px;
  padding: 12px;
  max-height: 320px;
  overflow-y: auto;
}

.prompt-meta {
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 8px;
  color: var(--ink-soft);
}

.btn-primary-copy {
  width: 100%;
  min-height: 56px;
  font-size: 1.02rem;
  background: var(--coral);
  color: #fff;
  border: 2.5px solid var(--line);
  border-radius: 18px;
  box-shadow: 5px 5px 0 rgba(61, 43, 31, 0.9);
  margin-bottom: 12px;
}

.btn-reset {
  width: 100%;
  min-height: 50px;
  font-size: 0.95rem;
  background: var(--card);
  color: var(--ink);
  border: 2.5px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

/* ---------- 页脚 / 提示 ---------- */
.page-footer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 20px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  z-index: 50;
  max-width: 86vw;
  padding: 11px 20px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 6px 20px rgba(61, 43, 31, 0.35);
}

.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

.toast.is-warn { background: var(--coral-deep); }

/* ---------- 窄屏微调 ---------- */
@media (max-width: 360px) {
  .grid-list { grid-template-columns: 1fr; }
  .stepper { gap: 5px; }
  .step-pill { padding: 4px 8px; }
}

/* 防横向溢出的全局保险 */
body { overflow-x: hidden; }

/* 电脑端：限制宽度居中，保持手机观感 */
@media (min-width: 640px) {
  .page { padding-top: 40px; }
}
