/* === 全局变量（沿用小程序粉色系） === */
:root {
  --primary: #FFB5C5;
  --accent:  #FF7BA0;
  --bg:      #FFF8F0;
  --card:    #FFFFFF;
  --text:    #2C2C2E;
  --sub:     #8E8E93;
  --divider: #F0E6E0;
  --shadow:  0 8px 24px rgba(0,0,0,0.08);
  --shadow-pop: 0 12px 36px rgba(255,123,160,0.35);
  --radius:  16px;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
               "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  padding-bottom: var(--tabbar-h);
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

button { font-family: inherit; cursor: pointer; }

/* === Top bar === */
.topbar {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 16px rgba(255,123,160,0.18);
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.brand-emoji { font-size: 22px; }
.brand-tag { font-size: 12px; opacity: 0.9; }

/* === Page wrapper === */
.page-area { position: relative; }
.page { display: none; animation: fadeIn 0.25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.cute-bg {
  min-height: calc(100vh - var(--tabbar-h) - 60px);
  background:
    radial-gradient(circle at 15% 12%, rgba(255,181,197,0.35) 0%, transparent 35%),
    radial-gradient(circle at 88% 8%,  rgba(255,228,214,0.4)  0%, transparent 32%),
    radial-gradient(circle at 92% 90%, rgba(255,181,197,0.28) 0%, transparent 38%),
    linear-gradient(180deg, #FFF8F0 0%, #FFEDDD 100%);
  padding: 16px 16px 24px;
}

/* === Cute header === */
.cute-header { text-align: center; padding: 16px 8px 12px; }
.cute-emoji {
  font-size: 64px; line-height: 1; margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}
.cute-title { font-size: 24px; font-weight: 800; }
.cute-desc  { font-size: 13px; color: var(--sub); margin-top: 4px; }

/* === Intent grid (Speak) === */
.intent-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 16px;
}
.intent-card {
  background: var(--card);
  border-radius: 18px;
  padding: 20px 14px 16px;
  text-align: center;
  border: 3px solid transparent;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  transition: transform 0.15s;
  cursor: pointer;
  position: relative;
}
.intent-card:active { transform: scale(0.96); }
.intent-card.playing { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.intent-emoji-bg {
  width: 62px; height: 62px; border-radius: 16px;
  margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
}
.intent-emoji { font-size: 36px; line-height: 1; }
.intent-label { font-size: 16px; font-weight: 700; }
.intent-desc  { font-size: 12px; color: var(--sub); margin-top: 2px; }
.intent-tag {
  position: absolute; top: 8px; right: 8px;
  background: var(--accent); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 100px;
}

/* === Tip card === */
.tip-card {
  display: flex; gap: 12px; align-items: center;
  background: rgba(255,181,197,0.15);
  border-radius: 14px;
  padding: 14px;
  margin-top: 24px;
}
.tip-emoji { font-size: 24px; }
.tip-text  { font-size: 12px; color: var(--sub); line-height: 1.6; flex: 1; }

/* === Listen === */
.listen-stage { padding: 32px 0; display: flex; flex-direction: column; align-items: center; }
.big-record {
  width: 168px; height: 168px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-pop);
  position: relative;
  cursor: pointer;
  user-select: none;
}
.big-record.recording { animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.rec-icon { font-size: 56px; line-height: 1; }
.rec-text { margin-top: 4px; font-size: 14px; font-weight: 600; }
.rec-rings { position: absolute; inset: 0; pointer-events: none; }
.big-record.recording .rec-rings::before,
.big-record.recording .rec-rings::after {
  content: ""; position: absolute; inset: -8px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  opacity: 0.5;
  animation: ripple 1.6s ease-out infinite;
}
.big-record.recording .rec-rings::after { animation-delay: 0.8s; }
@keyframes ripple {
  0%   { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}
.rec-status { margin-top: 16px; font-size: 13px; color: var(--sub); }

.result-card {
  margin-top: 24px; background: var(--card);
  border-radius: 18px; padding: 18px;
  box-shadow: var(--shadow);
}
.result-head { display: flex; align-items: center; gap: 14px; }
.result-emoji { font-size: 44px; }
.result-label { font-size: 22px; font-weight: 700; }
.result-sub   { font-size: 12px; color: var(--sub); }
.result-explain { margin-top: 12px; font-size: 13px; color: var(--text); }

/* === Nearby === */
.map-placeholder {
  position: relative;
  width: 100%; height: 260px;
  border-radius: 20px;
  background:
    repeating-linear-gradient(90deg, #E8F0E8 0 40px, #DDE7DD 40px 80px),
    repeating-linear-gradient(0deg, transparent 0 40px, rgba(255,255,255,0.5) 40px 80px),
    #E8F0E8;
  background-blend-mode: multiply;
  box-shadow: var(--shadow);
  margin-top: 16px;
  overflow: hidden;
}
.map-pin {
  position: absolute;
  font-size: 22px;
  background: #fff; border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.2s;
}
.map-pin:active { transform: translate(-50%, -50%) scale(1.2); }
.pin-shop { border: 2px solid #F2994A; }
.pin-hosp { border: 2px solid #EB5757; }
.pin-love { border: 2px solid var(--accent); }
.map-me {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent); color: #fff;
  padding: 4px 12px; border-radius: 100px;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(255,123,160,0.4);
}
.legend-row {
  display: flex; justify-content: center; gap: 18px;
  margin: 14px 0;
  font-size: 12px; color: var(--sub);
}
.dot {
  display: inline-block; width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff; line-height: 22px; text-align: center;
  font-size: 13px;
  margin-right: 4px;
  vertical-align: middle;
}
.dot-shop { border: 2px solid #F2994A; }
.dot-hosp { border: 2px solid #EB5757; }
.dot-love { border: 2px solid var(--accent); }
.shop-list { display: flex; flex-direction: column; gap: 10px; }
.shop-card {
  background: var(--card); border-radius: 14px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.shop-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.shop-name { font-size: 14px; font-weight: 600; }
.shop-meta { font-size: 11px; color: var(--sub); margin-top: 2px; }

/* === Circle === */
.post-feed { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.post-card {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.post-name { font-size: 13px; font-weight: 600; }
.post-time { font-size: 11px; color: var(--sub); }
.post-tag {
  font-size: 10px; padding: 2px 10px; border-radius: 10px;
  margin-left: auto;
}
.post-body { font-size: 14px; line-height: 1.6; color: var(--text); }
.post-actions {
  display: flex; gap: 18px;
  margin-top: 12px;
  font-size: 12px; color: var(--sub);
}
.post-actions span { cursor: pointer; }
.post-actions .liked { color: var(--accent); }

/* === Profile === */
.user-card {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 18px;
  padding: 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 8px 22px rgba(255,123,160,0.25);
}
.user-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: #fff; color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 17px; font-weight: 700; }
.user-bio  { font-size: 12px; opacity: 0.9; margin-top: 2px; }
.user-points { text-align: center; }
.pts-num { font-size: 20px; font-weight: 700; }
.pts-label { font-size: 11px; opacity: 0.9; }

.stat-row {
  display: flex; align-items: center;
  background: var(--card); border-radius: 14px;
  padding: 14px 8px; margin-top: 14px;
  box-shadow: var(--shadow);
}
.stat-row .stat { flex: 1; text-align: center; }
.stat-row .n { font-size: 18px; font-weight: 700; color: var(--accent); }
.stat-row .l { font-size: 11px; color: var(--sub); margin-top: 2px; }
.stat-row .div { width: 1px; height: 24px; background: var(--divider); }

.section {
  background: var(--card); border-radius: 16px;
  padding: 14px 16px; margin-top: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.sec-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }

.cat-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #FFE5EC, #FFF4DA);
  border-radius: 14px; padding: 12px; margin-bottom: 12px;
}
.cb-emoji {
  width: 48px; height: 48px; border-radius: 14px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.cb-info { flex: 1; }
.cb-name { font-size: 14px; font-weight: 600; }
.cb-desc { font-size: 11px; color: var(--sub); margin-top: 2px; }
.cb-btn { background: var(--accent); color: #fff;
          padding: 4px 12px; border-radius: 100px; font-size: 11px;
          cursor: pointer; }

.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.g-item {
  background: var(--bg); border-radius: 12px;
  padding: 14px 6px; text-align: center; font-size: 12px;
  cursor: pointer;
}
.g-e { font-size: 24px; margin-bottom: 4px; }

.row {
  display: flex; align-items: center; padding: 12px 0;
  border-top: 1px solid var(--divider);
  cursor: pointer;
}
.row:first-of-type { border-top: none; }
.ri {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; margin-right: 10px;
}
.ri-pink { background: #FFE5EC; }
.ri-blue { background: #E5F0FF; }
.ri-purple { background: #F3E8FD; }
.ri-gray { background: #F0F0F0; }
.rt { flex: 1; font-size: 14px; }
.rtail { font-size: 12px; color: var(--sub); margin-right: 6px; }
.ra { color: #C7C7CC; }

.footer-tip {
  text-align: center; font-size: 11px; color: var(--sub);
  padding: 18px 0;
}

/* === Tab bar === */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--tabbar-h);
  background: #fff;
  display: flex;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  max-width: 520px;
  margin: 0 auto;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none;
  color: var(--sub);
  font-size: 11px;
  gap: 2px;
  cursor: pointer;
  transition: color 0.15s;
}
.tab.active { color: var(--accent); }
.tab .ti { font-size: 22px; line-height: 1; }

/* === Modal === */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.5);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal.show { display: flex; }
.modal-card {
  background: #fff; border-radius: 18px; padding: 24px;
  max-width: 320px; width: 100%;
  text-align: center;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.modal-body { font-size: 14px; color: var(--text); line-height: 1.7; margin-bottom: 20px; }
.modal-btn {
  background: var(--accent); color: #fff;
  border: none; border-radius: 100px;
  padding: 12px 32px; font-size: 15px; font-weight: 600;
}
