/* ============================================
   Spark · Home Page (我们的今天)
   双城窗布局：左杭州·小白，右沈阳·小鸡毛
   ============================================ */

/* 顶部 */
.home-header {
  padding: 14px 20px 6px;
  max-width: 480px;
  margin: 0 auto;
}

.logo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.logo-spark {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-dark);
  letter-spacing: 0.5px;
}

.logo-date {
  font-size: 12px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* 双城窗主容器 */
.city-window {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  max-width: 480px;
  margin: 8px auto 0;
  padding: 0 12px;
  min-height: 540px;
}

/* 中间爱心分隔 */
.center-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  position: relative;
  z-index: 5;
}

.heart-svg {
  width: 44px;
  height: 44px;
  animation: heartbeat 1.6s ease-in-out infinite;
  filter: drop-shadow(0 4px 10px rgba(255, 138, 154, 0.5));
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.25); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
}

/* 单城面板 */
.city-panel {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  min-height: 540px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  transition: transform 0.3s ease;
}

.city-panel:active {
  transform: scale(0.98);
}

.city-hangzhou {
  background: linear-gradient(180deg,
    rgba(255, 226, 236, 0.5) 0%,
    rgba(255, 244, 236, 0.6) 100%);
}

.city-shenyang {
  background: linear-gradient(180deg,
    rgba(255, 231, 214, 0.5) 0%,
    rgba(255, 244, 236, 0.6) 100%);
}

/* 天气动效背景层 */
.city-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.weather-fx {
  position: absolute;
  inset: 0;
  opacity: 0.85;
}

/* 天气动效 - 晴 */
.fx-sunny::before {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, #ffd56b 30%, transparent 70%);
  border-radius: 50%;
  filter: blur(2px);
  animation: sunPulse 4s ease-in-out infinite;
}

@keyframes sunPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* 天气动效 - 雨 */
.fx-rainy::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.8) 1px, transparent 2px),
    radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.7) 1px, transparent 2px),
    radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.6) 1px, transparent 2px);
  background-size: 100% 100%;
  animation: rainFall 0.8s linear infinite;
}

@keyframes rainFall {
  0% { transform: translateY(-20px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(20px); opacity: 0; }
}

/* 天气动效 - 雪 */
.fx-snowy::before {
  content: "❄ ❅ ❆ ❄ ❅";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 20px;
  animation: snowFall 6s linear infinite;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

@keyframes snowFall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(560px) rotate(360deg); opacity: 0.3; }
}

/* 天气动效 - 多云 */
.fx-cloudy::before {
  content: "☁️  ☁️";
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  font-size: 28px;
  opacity: 0.5;
  animation: cloudDrift 8s ease-in-out infinite;
}

@keyframes cloudDrift {
  0%, 100% { transform: translateX(-10px); }
  50% { transform: translateX(10px); }
}

/* 城市 meta 信息 */
.city-meta {
  position: relative;
  z-index: 2;
  padding: 4px 6px;
}

.city-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--ink-soft);
  margin-bottom: 8px;
  font-variant: small-caps;
}

.city-weather {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weather-icon {
  font-size: 32px;
  line-height: 1;
}

.weather-info {
  display: flex;
  flex-direction: column;
}

.weather-text {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}

.weather-temp {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-dark);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* 角色区 */
.city-character {
  flex: 1;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
}

.dog-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  position: relative;
}

/* 心情气泡 */
.mood-bubble {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(43, 38, 34, 0.08);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--ink-soft);
  box-shadow: var(--shadow-soft);
  transition: all 0.25s ease;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mood-bubble:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 1);
}

.mood-bubble.has-mood {
  background: var(--bg-pink);
  color: var(--ink-dark);
  font-weight: 500;
  border-color: var(--accent-coral);
}

.mood-emoji {
  font-size: 14px;
  line-height: 1;
}

.mood-text {
  font-size: 12px;
  line-height: 1;
}

/* 头像 */
.dog-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.8),
    var(--shadow-soft);
}

.dog-avatar:hover {
  transform: scale(1.05);
}

.dog-avatar:active {
  transform: scale(0.95);
}

.dog-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dog-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.city-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-dark);
  margin-top: 2px;
}

/* 心情选择弹层 */
.mood-picker {
  position: fixed;
  inset: 0;
  background: rgba(43, 38, 34, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

.mood-picker[hidden] {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mood-picker-inner {
  width: 100%;
  max-width: 480px;
  background: var(--bg-cream);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.mood-picker-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-dark);
  text-align: center;
  margin-bottom: 20px;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.mood-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
}

.mood-option:active {
  transform: scale(0.92);
}

.mood-option.selected {
  background: var(--bg-pink);
  border-color: var(--accent-coral);
}

.mood-option-emoji {
  font-size: 28px;
  line-height: 1;
}

.mood-option-label {
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
}

.mood-cancel {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 15px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--r-md);
  font-weight: 500;
}

.mood-cancel:active {
  background: rgba(255, 255, 255, 0.9);
}

/* 小屏适配 */
@media (max-width: 360px) {
  .city-window {
    padding: 0 8px;
    gap: 0;
  }
  .center-divider {
    width: 24px;
  }
  .dog-avatar {
    width: 90px;
    height: 90px;
  }
}
/* ===== Spark 微聊天 ===== */
.spark-chat {
  max-width: 480px;
  margin: 16px auto 0;
  padding: 0 16px;
}

.spark-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 12px;
}

.spark-chat-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-dark);
}

.spark-chat-sub {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.spark-chat-fab {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-coral) 0%, var(--accent-warm) 100%);
  color: white;
  font-size: 22px;
  font-weight: 300;
  box-shadow: 0 4px 12px rgba(255, 138, 154, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spark-chat-fab:active { transform: scale(0.92); }

.spark-chat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.spark-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border-radius: var(--r-md);
  padding: 10px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  position: relative;
  animation: sparkIn 0.3s ease;
}

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

.spark-msg-hangzhou {
  border-left: 3px solid var(--accent-coral);
}

.spark-msg-shenyang {
  border-left: 3px solid var(--accent-warm);
}

.spark-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
  background: white;
  flex-shrink: 0;
}

.spark-msg-body {
  flex: 1;
  min-width: 0;
}

.spark-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}

.spark-msg-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-dark);
}

.spark-msg-time {
  font-size: 10px;
  color: var(--ink-fade);
  font-variant-numeric: tabular-nums;
}

.spark-msg-text {
  font-size: 13px;
  color: var(--ink-dark);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.spark-msg-del {
  font-size: 12px;
  color: var(--ink-fade);
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.spark-msg:hover .spark-msg-del { opacity: 1; }
.spark-msg-del:active { background: rgba(231, 76, 60, 0.1); color: #c0392b; }

.spark-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--ink-fade);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: var(--r-md);
  border: 1.5px dashed rgba(43, 38, 34, 0.1);
}

/* 城市旁小图标 */
.city-mini-dog {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.5;
  pointer-events: none;
}

.city-mini-dog.right {
  left: auto;
  right: 8px;
}
