/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #fce4ec, #e8eaf6, #fff3e0, #e0f7fa, #f3e5f5, #fce4ec);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  max-width: 480px;
  width: 100%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-radius: 32px;
  padding: 30px 24px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  text-align: center;
}

/* ===== 猫咪 ===== */
.cat-area { position: relative; margin-bottom: 10px; }

.cat {
  display: inline-block;
  position: relative;
  animation: catBounce 2s ease-in-out infinite;
}

@keyframes catBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.cat-body { position: relative; }

.cat-face {
  width: 130px; height: 110px;
  background: #f5a623;
  border-radius: 50% 50% 48% 48%;
  position: relative;
  margin: 0 auto;
  box-shadow: inset 0 -8px 0 rgba(0,0,0,0.06);
}

/* 耳朵 */
.ear {
  position: absolute; top: -18px;
  width: 0; height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 28px solid #f5a623;
}
.ear.left { left: 10px; transform: rotate(-10deg); }
.ear.right { right: 10px; transform: rotate(10deg); }
.ear::after {
  content: ''; position: absolute; top: 6px; left: -8px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid #f7c873;
}

/* 眼睛 */
.eye {
  position: absolute; top: 32px;
  width: 26px; height: 28px;
  background: #fff;
  border-radius: 50%;
  overflow: hidden;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.eye.left { left: 22px; }
.eye.right { right: 22px; }

.pupil {
  width: 14px; height: 14px;
  background: #333;
  border-radius: 50%;
  position: absolute;
  bottom: 3px; left: 6px;
  transition: all 0.3s;
}

/* 眼睛高光 */
.pupil::after {
  content: ''; position: absolute; top: 2px; left: 3px;
  width: 5px; height: 5px;
  background: #fff;
  border-radius: 50%;
}

/* 腮红 */
.blush {
  position: absolute; top: 50px;
  width: 18px; height: 12px;
  background: rgba(255,150,150,0.5);
  border-radius: 50%;
}
.blush.left { left: 6px; }
.blush.right { right: 6px; }

/* 眼睛眯起来 — 开心时 */
.cat.happy .eye { height: 6px; top: 38px; border-radius: 4px; }
.cat.happy .pupil { display: none; }

/* 鼻子 */
.nose {
  position: absolute; top: 48px; left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 8px;
  background: #e8917a;
  border-radius: 50%;
}

/* 嘴巴 */
.mouth {
  position: absolute; top: 56px; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 10px;
  border-bottom: 3px solid #8d6e63;
  border-radius: 0 0 20px 20px;
}

/* 胡须 */
.whisker {
  position: absolute; top: 46px;
  width: 30px; height: 2px;
  background: #8d6e63;
  border-radius: 2px;
}
.whisker.left-top { left: -20px; top: 42px; transform: rotate(-10deg); }
.whisker.left-bottom { left: -20px; top: 50px; transform: rotate(10deg); }
.whisker.right-top { right: -20px; top: 42px; transform: rotate(10deg); }
.whisker.right-bottom { right: -20px; top: 50px; transform: rotate(-10deg); }

/* 猫爪 */
.cat-paw {
  position: absolute; bottom: -10px;
  width: 20px; height: 16px;
  background: #f5a623;
  border-radius: 50%;
}
.cat-paw.left { left: 20px; }
.cat-paw.right { right: 20px; }
.cat-paw::after {
  content: ''; position: absolute; bottom: -4px;
  width: 6px; height: 6px;
  background: #f5a623;
  border-radius: 50%;
}
.cat-paw.left::after { left: 3px; }
.cat-paw.right::after { right: 3px; }

/* ===== 气泡 ===== */
.speech-bubble {
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 2px solid #f5a623;
  border-radius: 20px;
  padding: 10px 16px;
  min-width: 200px;
  max-width: 300px;
  font-size: 14px;
  color: #333;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: all 0.4s;
}
.speech-bubble::after {
  content: ''; position: absolute; bottom: -10px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #fff;
}

/* 气泡闪烁动画 — 算命时 */
.speech-bubble.thinking {
  animation: bubblePulse 0.6s ease-in-out infinite alternate;
}
@keyframes bubblePulse {
  from { transform: translateX(-50%) scale(1); }
  to { transform: translateX(-50%) scale(1.03); }
}

/* ===== 表单 ===== */
.form-area { margin: 20px 0; }

.input-group {
  margin-bottom: 16px;
  text-align: left;
}
.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}
.input-group input,
.input-group select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 14px;
  font-size: 15px;
  background: #fafafa;
  transition: border 0.2s;
  outline: none;
}
.input-group input:focus,
.input-group select:focus {
  border-color: #f5a623;
  background: #fff;
}

button#fortune-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #f5a623, #e8917a);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(245,166,35,0.35);
}
button#fortune-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245,166,35,0.45); }
button#fortune-btn:active { transform: translateY(0); }
button#fortune-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ===== 历史记录 ===== */
.history-area {
  margin-top: 24px;
  text-align: left;
}
.history-item {
  background: #fafafa;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-left: 4px solid #f5a623;
  animation: slideIn 0.4s ease-out;
  font-size: 14px;
  color: #444;
  line-height: 1.6;
}
.history-item .date-label { font-weight: 600; color: #f5a623; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== 猫咪跳舞动画 ===== */
.cat.dance {
  animation: catDance 0.5s ease-in-out 3;
}
@keyframes catDance {
  0% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(-8deg) translateY(-5px); }
  50% { transform: rotate(0deg) translateY(0); }
  75% { transform: rotate(8deg) translateY(-5px); }
  100% { transform: rotate(0deg) translateY(0); }
}

/* ===== 炫彩背景动画 ===== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
