/* ===== CSS 变量 ===== */
:root {
  --pink:    #f48fb1;
  --pink-l:  #fce4ec;
  --purple:  #ce93d8;
  --purple-l:#f3e5f5;
  --blue:    #90caf9;
  --blue-l:  #e3f2fd;
  --mint:    #80cbc4;
  --yellow:  #C8920A;
  --text:    #5d4e75;
  --text-l:  #9e8fb5;
  --white:   #ffffff;
  --card-bg: rgba(255, 255, 255, 0.80);
  --shadow:  0 8px 32px rgba(206, 147, 216, 0.18);
  --shadow-h:0 16px 48px rgba(206, 147, 216, 0.30);
  --radius:  24px;
  --radius-s:14px;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== 页面背景 ===== */
body {
  min-height: 100vh;
  background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 40%, #e3f2fd 100%);
  font-family: -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

/* ===== 背景光晕 ===== */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb1 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #f48fb1, #ce93d8);
  top: -100px; left: -80px;
  animation-delay: 0s;
}
.orb2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #90caf9, #80cbc4);
  top: 40%; right: -60px;
  animation-delay: 3s;
}
.orb3 {
  width: 260px; height: 260px;
  background: radial-gradient(circle, #fff59d, #f48fb1);
  bottom: -80px; left: 30%;
  animation-delay: 6s;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-24px) scale(1.05); }
}

/* ===== 主容器 ===== */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 40px;
}

/* ===== 头部 ===== */
.app-header {
  padding: 16px 0 12px;
  text-align: center;
}
.header-emoji {
  font-size: 44px;
  display: block;
  text-align: center;
  margin-bottom: 4px;
  animation: emojiBounce 2.5s ease-in-out infinite;
}
@keyframes emojiBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.app-title {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, var(--pink), var(--purple), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.app-subtitle {
  text-align: center;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-l);
}
.subtitle-star {
  font-size: 18px;
  filter: sepia(1) saturate(2.8) hue-rotate(3deg) brightness(1.08) drop-shadow(0 0 4px rgba(195, 155, 30, 0.6));
}

/* ===== 卡片基础 ===== */
.fortune-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1.5px solid rgba(255,255,255,0.7);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.fortune-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-h);
}

/* 卡片入场动画 */
.fortune-card {
  opacity: 0;
  transform: translateY(28px);
  animation: cardIn 0.55s ease forwards;
}
@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 卡片标签 ===== */
.card-tag {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-l);
  margin-bottom: 14px;
  letter-spacing: 1px;
}

/* ===== 输入区卡片 ===== */
.input-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  border: 1.5px solid rgba(255,255,255,0.7);
}
.input-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
}
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-l);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #f0e6f8;
  border-radius: var(--radius-s);
  font-size: 16px;
  color: var(--text);
  background: rgba(255,255,255,0.9);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.input-group input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(206,147,216,0.18);
}
.input-group input::placeholder { color: #c9bcd6; }

/* ===== 占卜按钮 ===== */
.divination-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(244,143,177,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.divination-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(244,143,177,0.55);
}
.divination-btn:active { transform: translateY(0); }

.error-msg {
  margin-top: 10px;
  font-size: 13px;
  color: #e57373;
  text-align: center;
  min-height: 18px;
}

/* ===== 命盘卡 ===== */
.identity-card { padding-bottom: 18px; }

.bazi-row {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  margin-bottom: 16px;
}
.bazi-pillar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(160deg, #fce4ec, #f3e5f5);
  border-radius: 16px;
  padding: 12px 8px;
  border: 1.5px solid rgba(244,143,177,0.25);
}
.pillar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-l);
  margin-bottom: 6px;
}
.pillar-gan {
  font-size: 22px;
  font-weight: 800;
  color: var(--pink);
  line-height: 1;
}
.pillar-zhi {
  font-size: 22px;
  font-weight: 800;
  color: var(--purple);
  line-height: 1;
  margin-top: 4px;
}
.pillar-element {
  font-size: 10px;
  color: var(--text-l);
  margin-top: 6px;
}

.identity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.meta-badge {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.animal-badge { background: #fce4ec; color: #e91e8c; }
.star-badge   { background: #e8eaf6; color: #7c4dff; }
.date-badge   { background: #e0f7fa; color: #0097a7; }

/* ===== 总运卡 ===== */
.overall-card { text-align: center; }

.star-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}
.star {
  font-size: 17px;
  color: #d4c2e8;
  transition: transform 0.3s;
}
.star.active {
  color: unset;
  animation: starPop 0.4s ease;
}
.mini-stars .star { font-size: 13px; }@keyframes starPop {
  0%   { transform: scale(0.5); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.energy-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 8px;
}
.energy-bar-bg {
  flex: 1;
  height: 10px;
  background: #f0e6f8;
  border-radius: 999px;
  overflow: hidden;
}
.energy-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--blue));
  transition: width 1.2s cubic-bezier(0.17, 0.67, 0.35, 1.2);
  box-shadow: 0 0 8px rgba(206,147,216,0.5);
}
.energy-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  min-width: 36px;
  text-align: right;
}

.fortune-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  padding: 8px 4px 0;
  text-align: center;
}

/* ===== 四维运势网格 ===== */
.four-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.mini-card {
  padding: 16px 14px;
  text-align: center;
  margin-bottom: 0;
}
.mini-icon {
  font-size: 28px;
  margin-bottom: 6px;
}
.mini-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-l);
  margin-bottom: 8px;
}
.mini-stars {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-bottom: 8px;
}
.mini-stars .star { font-size: 14px; }
.mini-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
}

/* 四卡顶部色条 */
#love-card   { border-top: 3px solid var(--pink); }
#wealth-card { border-top: 3px solid #ffcc80; }
#career-card { border-top: 3px solid var(--blue); }
#health-card { border-top: 3px solid var(--mint); }

/* ===== 五行能量卡 ===== */
.element-list { display: flex; flex-direction: column; gap: 12px; }
.element-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.element-name {
  width: 28px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  flex-shrink: 0;
}
.element-bar-bg {
  flex: 1;
  height: 8px;
  background: #f0e6f8;
  border-radius: 999px;
  overflow: hidden;
}
.element-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 1.3s cubic-bezier(0.17, 0.67, 0.35, 1.2);
}
.element-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-l);
  min-width: 24px;
  text-align: right;
}

/* ===== 幸运元素卡 ===== */
.lucky-grid {
  display: flex;
  justify-content: space-around;
  gap: 12px;
}
.lucky-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  background: linear-gradient(160deg, #fce4ec20, #e8eaf620);
  border-radius: var(--radius-s);
}
.lucky-icon { font-size: 24px; margin-bottom: 6px; }
.lucky-label {
  font-size: 11px;
  color: var(--text-l);
  font-weight: 600;
  margin-bottom: 4px;
}
.lucky-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

/* ===== 格言卡 ===== */
.motto-card {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(244,143,177,0.12), rgba(206,147,216,0.12), rgba(144,202,249,0.12));
}
.motto-deco {
  font-size: 18px;
  color: var(--purple);
  opacity: 0.5;
  margin: 4px 0;
}
.today-motto {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.8;
  color: var(--text);
  padding: 12px 0;
  border: none;
  font-style: normal;
}

/* ===== 操作按钮 ===== */
.action-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}
.action-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
  letter-spacing: 1px;
}
.action-btn:hover { transform: translateY(-2px); }
.action-btn:active { transform: translateY(0); }

.sense-btn {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  box-shadow: 0 6px 20px rgba(144,202,249,0.4);
}
.back-btn {
  background: rgba(255,255,255,0.8);
  color: var(--text);
  border: 2px solid #f0e6f8;
}

/* ===== Footer ===== */
.app-footer {
  text-align: center;
  padding-top: 8px;
  font-size: 12px;
  color: var(--text-l);
  opacity: 0.7;
}

/* ===== 卡片入场延迟 ===== */
.fortune-section .fortune-card:nth-child(1) { animation-delay: 0.05s; }
.fortune-section .fortune-card:nth-child(2) { animation-delay: 0.15s; }
.four-grid .mini-card:nth-child(1) { animation-delay: 0.25s; }
.four-grid .mini-card:nth-child(2) { animation-delay: 0.30s; }
.four-grid .mini-card:nth-child(3) { animation-delay: 0.35s; }
.four-grid .mini-card:nth-child(4) { animation-delay: 0.40s; }
.fortune-section .fortune-card:nth-child(4) { animation-delay: 0.50s; }
.fortune-section .fortune-card:nth-child(5) { animation-delay: 0.60s; }
.fortune-section .fortune-card:nth-child(6) { animation-delay: 0.70s; }

/* ===== 输入区新布局 ===== */
.input-row3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.input-hour-row { margin-bottom: 20px; }
.hour-group label { color: var(--text-l); font-size: 12px; }

/* ===== 公历/农历 切换 ===== */
.cal-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.cal-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-s);
  border: 2px solid #f0e6f8;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-l);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  background: rgba(255,255,255,0.6);
}
.cal-opt:has(input:checked) {
  border-color: var(--purple);
  background: #f3e5f5;
  color: var(--text);
}
.cal-opt input { display: none; }

.lunar-tip {
  font-size: 12px;
  color: var(--purple);
  margin-bottom: 10px;
  padding: 6px 12px;
  background: #f3e5f540;
  border-radius: 8px;
  border-left: 3px solid var(--purple);
}

.leap-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.leap-label input { accent-color: var(--purple); width: 15px; height: 15px; }

/* ===== 幸运时辰两行显示 ===== */
#lucky-hour {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.hour-range {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-l);
}
@media (max-width: 360px) {
  .bazi-pillar { padding: 10px 4px; }
  .pillar-gan, .pillar-zhi { font-size: 18px; }
  .four-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* ===== 问卷区 ===== */
.quiz-header {
  text-align: center;
  padding: 8px 0 8px;
}
.quiz-orb-icon {
  font-size: 40px;
  display: block;
  text-align: center;
  margin-bottom: 4px;
  animation: emojiBounce 2.5s ease-in-out infinite;
}
.quiz-title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.quiz-subtitle {
  font-size: 13px;
  color: var(--text-l);
  text-align: center;
  margin: 4px 0 12px;
}
.quiz-dots-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 4px;
}
.qdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f0e6f8;
  transition: background 0.3s, transform 0.3s, width 0.3s;
}
.qdot.active {
  background: var(--purple);
  transform: scale(1.25);
  width: 24px;
  border-radius: 999px;
}

.quiz-card { margin-bottom: 0; }
.quiz-q {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  margin-bottom: 4px;
}
.quiz-q-hint {
  font-size: 13px;
  color: var(--text-l);
  text-align: center;
  margin-bottom: 16px;
}
.quiz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.quiz-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: rgba(255,255,255,0.7);
  border: 2px solid #f0e6f8;
  border-radius: var(--radius-s);
  cursor: pointer;
  font-size: 30px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.quiz-opt span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-l);
}
.quiz-opt:hover {
  transform: translateY(-3px);
  border-color: var(--purple);
  background: #f9f0ff;
}
.quiz-opt.selected {
  border-color: var(--purple);
  background: linear-gradient(135deg, #f3e5f5, #e8eaf6);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(206,147,216,0.35);
}
.quiz-opt.selected span { color: var(--text); }

/* ===== 塔罗牌 ===== */
.tarot-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 12px 0 4px;
}
.tarot-card {
  width: 84px;
  height: 136px;
  perspective: 800px;
  cursor: pointer;
  flex-shrink: 0;
}
.tarot-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.tarot-card.flipped .tarot-inner {
  transform: rotateY(180deg);
}
.tarot-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tarot-back-face {
  background: linear-gradient(160deg, #4a148c, #880e4f);
  color: rgba(255,255,255,0.75);
  font-size: 30px;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 8px 28px rgba(74,20,140,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
.tarot-card:not(.flipped):hover .tarot-back-face {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(74,20,140,0.55);
}
.tarot-front-face {
  background: linear-gradient(135deg, #fce4ec, #e8eaf6);
  border: 2px solid rgba(206,147,216,0.45);
  font-size: 36px;
  transform: rotateY(180deg);
}
.tarot-front-face .tarot-word {
  font-size: 12px;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: 1px;
}

/* ===== 专属聚焦解读区 ===== */
.chosen-wrap {
  margin-bottom: 4px;
}
.chosen-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 4px 0 12px;
}
.chosen-tag {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(206,147,216,0.35);
  color: var(--text);
  animation: cardIn 0.4s ease forwards;
  opacity: 0;
}

/* ===== 专属聚焦主解读卡 ===== */
.fortune-card.personal-main-card {
  background: rgba(255,255,255,0.96) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(244,143,177,0.18);
  box-shadow: 0 8px 32px rgba(206,147,216,0.16);
}
.fortune-card.personal-main-card .card-tag {
  font-size: 14px;
  font-weight: 800;
  background: linear-gradient(135deg, #f48fb1, #ce93d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}
.personal-main-text {
  font-size: 15px;
  line-height: 2.1;
  color: #4a3360;
  text-align: center;
  padding: 0 0 14px;
}
.personal-energy-note {
  font-size: 13px;
  color: #7840a0;
  padding: 12px 16px 12px 18px;
  background: linear-gradient(135deg, #fdf0ff, #fff4fb);
  border-radius: var(--radius-s);
  line-height: 1.9;
  border-left: 4px solid #ce93d8;
  font-weight: 500;
  text-align: left;
}

/* ===== 专属建议卡（三条 tip）===== */
.fortune-card.tips-card {
  background: rgba(255,255,255,0.96) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(244,143,177,0.18);
  box-shadow: 0 8px 32px rgba(206,147,216,0.12);
}
.fortune-card.tips-card .card-tag {
  font-size: 14px;
  font-weight: 800;
  background: linear-gradient(135deg, #f48fb1, #ce93d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}
.tips-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
.tip-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: #fdf8ff;
  border-radius: var(--radius-s);
  border-left: 3px solid #ce93d8;
}
.tip-num {
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f48fb1, #ce93d8);
  color: #fff;
}
.tip-text {
  font-size: 13px;
  line-height: 1.65;
  color: #4a3360;
}

/* ===== 宇宙补给卡 ===== */
.fortune-card.cross-card {
  background: linear-gradient(145deg, #ddd0ff 0%, #eddbff 50%, #fad8f8 100%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1.5px solid rgba(190,140,235,0.28);
  box-shadow: 0 8px 28px rgba(180,100,220,0.15);
}
.fortune-card.cross-card .card-tag {
  color: #7840b8 !important;
  -webkit-text-fill-color: #7840b8 !important;
  font-weight: 700;
  letter-spacing: 1px;
}
.cross-text {
  font-size: 15px;
  line-height: 2.1;
  color: #4a3068;
  text-align: center;
  padding: 4px 0;
  font-weight: 500;
}

/* ===== AI 追问对话卡 ===== */
.chat-card { padding: 20px; }

.chat-guide {
  font-size: 13px;
  color: var(--text-l);
  margin: 0 0 12px;
  line-height: 1.6;
}

.chat-suggestions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.chat-suggestions::-webkit-scrollbar { display: none; }

.chat-suggest-btn {
  padding: 7px 13px;
  border: 1.5px solid rgba(206,147,216,0.4);
  border-radius: 20px;
  background: rgba(206,147,216,0.08);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-suggest-btn:hover {
  background: rgba(206,147,216,0.18);
  border-color: var(--purple);
}

.chat-messages {
  min-height: 0;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.chat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.chat-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-ai {
  align-self: flex-start;
  background: rgba(206, 147, 216, 0.12);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-msg-ai.typing::after {
  content: '▌';
  animation: blink .7s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid rgba(206,147,216,0.35);
  border-radius: 20px;
  font-size: 16px;
  color: var(--text);
  background: rgba(255,255,255,0.9);
  outline: none;
  transition: border-color .2s;
}

.chat-input:focus { border-color: var(--purple); }

.chat-send-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}

.chat-send-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== 历史记录入口按钮（header 角落） ===== */
.app-header { position: relative; }

.history-header-btn {
  position: absolute;
  top: 12px;
  right: 0;
  transform: none;
  background: rgba(255,255,255,0.75);
  border: 1.5px solid rgba(206,147,216,0.35);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s, transform 0.2s;
  line-height: 1;
}
.history-header-btn:hover {
  background: rgba(255,255,255,0.95);
  transform: translateY(-50%) scale(1.06);
}

/* ===== quiz 返回修改生日的链接按钮 ===== */
.quiz-back-link {
  background: none;
  border: none;
  color: var(--text-l);
  font-size: 13px;
  cursor: pointer;
  padding: 0 0 8px 0;
  display: block;
  transition: color 0.2s;
}
.quiz-back-link:hover { color: var(--purple); }

/* ===== 历史记录卡片 ===== */
.history-card {
  padding: 16px 18px;
  margin-bottom: 12px;
}
.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.history-date {
  font-size: 12px;
  color: var(--text-l);
  font-weight: 600;
}
.history-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
}
.history-birth {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 8px;
}
.history-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.history-motto {
  font-size: 12px;
  color: var(--text-l);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(206,147,216,0.10);
  border-radius: var(--radius-s);
  border-left: 3px solid var(--purple);
}
.history-scores-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-l);
  font-weight: 600;
}
.history-tap-hint {
  text-align: right;
  font-size: 11px;
  color: var(--purple);
  margin-top: 10px;
  margin-bottom: 0;
  opacity: 0.7;
}
.history-card:active {
  transform: scale(0.98);
  transition: transform 0.1s;
}


