/* =============================================
   herb-v2.css - 采药体验升级
   v20260610 — 品质发光环、品质圆点、采集回复苏
   ============================================= */

/* ===== 品质发光环 ===== */
.herb-sprite {
  position: relative;
}
.quality-glow {
  position: absolute;
  top: 50%; left: 50%;
  width: 48px; height: 48px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.herb-sprite:hover .quality-glow,
.herb-sprite:active .quality-glow {
  opacity: 0.6;
}
.quality-common .quality-glow { display: none; }
.quality-rare .quality-glow {
  display: block;
  background: radial-gradient(circle, rgba(74, 144, 217, 0.25) 0%, transparent 70%);
  animation: glowPulse 2s ease-in-out infinite;
}
.quality-epic .quality-glow {
  display: block;
  background: radial-gradient(circle, rgba(212, 160, 23, 0.3) 0%, transparent 70%);
  animation: glowPulse 1.5s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.7; }
}

/* ===== 品质圆点 ===== */
.quality-dot {
  position: absolute;
  top: 2px; right: 2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6);
  display: none;
}
.quality-rare .quality-dot {
  display: block;
  background: #4A90D9;
  box-shadow: 0 0 4px rgba(74, 144, 217, 0.6);
}
.quality-epic .quality-dot {
  display: block;
  background: #D4A017;
  box-shadow: 0 0 6px rgba(212, 160, 23, 0.7);
}

/* ===== 采集后草药的"复苏"——重新长出 ===== */
@keyframes herbRespawn {
  0% { transform: scale(0) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(3deg); opacity: 0.8; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.herb-sprite.respawn {
  animation: herbRespawn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

/* ===== 品质标签（炼丹药篓） ===== */
.cauldron-slot .quality-tag.common { color: #B8B2A8; }
.cauldron-slot .quality-tag.rare { color: #4A90D9; }
.cauldron-slot .quality-tag.epic { color: #D4A017; }

/* ===== 丹药品质徽章 ===== */
.brew-result .dan-quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ===== 场景装饰（浮动粒子） ===== */
.herb-field {
  position: relative;
  overflow: hidden;
}
.scene-particles {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
}
.scene-particle {
  position: absolute;
  pointer-events: none;
  opacity: 0.25;
  animation: particleFloat linear infinite;
}
@keyframes particleFloat {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.2; }
  100% { transform: translateY(-120px) rotate(180deg); opacity: 0; }
}

/* ===== 草药出现动画（破土而出） =====
   已移至 herb.css 全局定义，与 herbFloat 串联执行 */
@keyframes herbAppear {
  0% { transform: scale(0) translateY(10px); opacity: 0; }
  60% { transform: scale(1.15) translateY(-4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ===== 草药点击放大 + 品质光环 ===== */
.herb-sprite .herb-emoji {
  font-size: 2.6rem !important; /* 比原来的2.2rem更大 */
  transition: transform 0.15s ease;
}
.herb-sprite .herb-name-tag {
  font-size: 0.6rem !important;
  padding: 1px 4px !important;
  max-width: 70px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px !important;
}

/* 按品质添加光环 */
.herb-sprite[data-quality="1"] .herb-emoji {
  text-shadow: 0 0 8px rgba(74, 144, 217, 0.4);
}
.herb-sprite[data-quality="2"] .herb-emoji {
  text-shadow: 0 0 12px rgba(212, 160, 23, 0.5);
}

/* ===== 连击系统 UI ===== */
.combo-bar {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(44, 44, 44, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 24px;
  padding: 6px 16px 6px 10px;
  border: 1px solid rgba(212, 167, 74, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}
.combo-bar.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.combo-fire {
  font-size: 1.2rem;
  animation: fireFlicker 0.3s ease infinite alternate;
}
@keyframes fireFlicker {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}
.combo-count {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--gold-leaf-light, #E4C87A);
  min-width: 24px;
  text-align: center;
}
.combo-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
}
.combo-bar .combo-bonus {
  font-size: 0.65rem;
  color: #F5A623;
  background: rgba(245, 166, 35, 0.15);
  padding: 1px 6px;
  border-radius: 8px;
  border: 1px solid rgba(245, 166, 35, 0.3);
}

/* ===== 连击弹出数字动画 ===== */
.combo-popup {
  position: fixed;
  pointer-events: none;
  z-index: 60;
  font-size: 1.8rem;
  font-weight: bold;
  color: #D4A74A;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
  animation: comboPopupFloat 0.8s ease-out forwards;
}
@keyframes comboPopupFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-50px) scale(1.3); }
}

/* ===== 首次采集闪光 ===== */
.herb-sprite.first-collect {
  animation: firstCollect 1s ease 2;
}
@keyframes firstCollect {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4) drop-shadow(0 0 12px rgba(212, 167, 74, 0.8)); }
}

/* ===== 采集后草药被采走的消散效果 ===== */
@keyframes herbCollectV2 {
  0% { transform: scale(1); opacity: 1; filter: brightness(1); }
  30% { transform: scale(1.3); opacity: 0.8; filter: brightness(1.5); }
  100% { transform: scale(0); opacity: 0; filter: brightness(2); }
}
.herb-sprite.collected {
  animation: herbCollectV2 0.5s ease forwards !important;
}

/* ===== 采集结果的品质闪光 ===== */
.collect-card.show .collect-card-inner {
  animation: cardPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes cardPopIn {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* 按品质色彩 */
.collect-card-inner.quality-common {
  border-color: var(--herb-green, #5B8C5A);
}
.collect-card-inner.quality-rare {
  border-color: #4A90D9;
  box-shadow: 0 8px 24px rgba(74, 144, 217, 0.3);
}
.collect-card-inner.quality-epic {
  border-color: #D4A017;
  box-shadow: 0 8px 24px rgba(212, 160, 23, 0.3);
  background: linear-gradient(135deg, #FFFDF5, #FEF7E0) !important;
}

/* ===== 药田场景特效 ===== */
.herb-field {
  min-height: 320px;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--border, #D4C5A9);
  position: relative;
  margin-bottom: 12px;
  overflow: hidden;
}

/* 场景装饰 —— 底部土地纹理 */
.herb-field::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(180deg, transparent 0%, rgba(44, 24, 16, 0.08) 100%);
  pointer-events: none;
  z-index: 0;
}

/* 场景装饰 — 草丛 */
.grass-decoration {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.grass-blade {
  position: absolute;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to top, rgba(91, 140, 90, 0.2), transparent);
  border-radius: 2px 2px 0 0;
  animation: grassSway 2s ease-in-out infinite alternate;
}
@keyframes grassSway {
  0% { transform: rotate(-3deg); }
  100% { transform: rotate(3deg); }
}

/* ===== CD计时器增强 ===== */
.collect-timer {
  background: rgba(44, 44, 44, 0.9) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 8px 24px !important;
  font-size: 0.9rem !important;
  letter-spacing: 2px !important;
}
.collect-timer .cd-icon {
  display: inline-block;
  animation: cdPulse 1s ease infinite;
}
@keyframes cdPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== 药篓满提示增强 ===== */
.inventory-full-notice {
  background: rgba(194, 59, 34, 0.08);
  border: 1px solid rgba(194, 59, 34, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  font-size: 0.75rem;
  color: #C23B22;
  margin-top: 6px;
  display: none;
}
.inventory-full-notice.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ===== 手机竖屏优化 ===== */
@media (max-width: 400px) {
  .herb-sprite .herb-emoji {
    font-size: 2.2rem !important;
  }
  .inventory-slots {
    grid-template-columns: repeat(4, 1fr);
  }
  .combo-bar {
    bottom: 72px;
    padding: 5px 14px 5px 8px;
  }
  .combo-count {
    font-size: 1rem;
  }
}

/* 针对大屏优化 */
@media (min-width: 500px) {
  .herb-sprite .herb-emoji {
    font-size: 3rem !important;
  }
  .herb-sprite .herb-name-tag {
    font-size: 0.65rem !important;
    max-width: 80px !important;
  }
}

/* =============================================
   🧘 修炼系统 — 每日打坐调息
   ============================================= */

/* 修炼卡片 */
.meditation-card-inner {
  padding: 4px 0;
}
.meditation-badge-done {
  font-size: 0.7rem;
  color: #5B8C5A;
  font-weight: normal;
}

/* 已完成状态 */
.meditation-done-view {
  text-align: center;
  padding: 8px 0;
}
.meditation-rest-icon {
  font-size: 48px;
  margin: 8px 0;
  animation: meditateFloat 3s ease-in-out infinite;
}
@keyframes meditateFloat {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-8px); opacity: 1; }
}
.meditation-done-text {
  font-size: 14px;
  color: #5D4037;
  margin: 8px 0;
}

/* 打坐说明 */
.meditation-desc {
  font-size: 13px;
  color: #8B8B8B;
  text-align: center;
  line-height: 1.6;
  margin: 8px 0;
}

/* 打坐区域 */
.meditation-start-area {
  text-align: center;
  padding: 8px 0;
}

/* 奖励预览 */
.meditation-benefits {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}
.benefit-item {
  font-size: 12px;
  color: #5D4037;
  background: rgba(91, 140, 90, 0.1);
  border: 1px solid rgba(91, 140, 90, 0.2);
  border-radius: 16px;
  padding: 4px 12px;
}

/* 环形计时器 */
.meditation-timer-circle {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 8px auto;
}
.meditation-ring {
  width: 100%;
  height: 100%;
  transform: rotate(0deg);
}
.meditation-timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: bold;
  color: #3E2723;
  font-family: serif;
}

/* 打坐提示文字 */
.meditation-reminder {
  font-size: 14px;
  color: #5B8C5A;
  margin: 8px 0;
  font-weight: 500;
  animation: meditatePulse 2s ease-in-out infinite;
}
@keyframes meditatePulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* 连续天数条 */
.meditation-streak-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: #8D6E63;
  padding: 6px 12px;
  background: rgba(212, 197, 169, 0.2);
  border-radius: 8px;
}
