/* =============================================
   Herb Collect Page - 采药
   水墨药田风格
   ============================================= */

/* ---------- Header ---------- */
.herb-collect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.btn-back {
  font-size: 0.85rem;
  padding: 8px 12px;
}

.herb-energy {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2C2C2C;
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.energy-icon {
  font-size: 1rem;
}

.btn-energy-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--gold-leaf);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.15), rgba(201, 169, 110, 0.05));
  color: var(--gold-leaf);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-energy-pill:hover {
  background: linear-gradient(135deg, var(--gold-leaf), var(--gold-leaf));
  color: white;
}
.btn-energy-pill:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-energy-pill:not(:disabled):active {
  transform: scale(0.95);
}

/* ---------- Collect Card ---------- */
.collect-card {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 60;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.collect-card.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.collect-card-inner {
  background: var(--bg-card);
  border: 2px solid var(--herb-green);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  text-align: center;
  box-shadow: 0 8px 24px var(--shadow-heavy);
  min-width: 200px;
}
.collect-card-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--herb-green-dark);
  margin-bottom: 6px;
}
.collect-card-desc {
  font-size: 0.85rem;
  color: var(--ink-gray);
  margin-bottom: 4px;
}
.collect-card-nature {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  background: var(--ink-light);
  color: var(--ink-gray);
}

/* ---------- Location Selector ---------- */
.location-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.loc-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.8rem;
  color: var(--ink-gray);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.loc-btn.active {
  background: var(--herb-green);
  color: white;
  border-color: var(--herb-green-dark);
  box-shadow: 0 2px 6px rgba(91, 140, 90, 0.3);
}
.loc-btn:active {
  transform: scale(0.95);
}
.loc-btn span {
  font-size: 1rem;
}

.location-hint {
  font-size: 0.75rem;
  color: var(--ink-gray-light);
  margin-bottom: 8px;
  text-align: center;
  line-height: 1.4;
}

/* ---------- Location Backgrounds ---------- */
.herb-field.loc-valley {
  background: linear-gradient(180deg,
    rgba(107, 142, 78, 0.15) 0%,
    rgba(78, 110, 50, 0.1) 30%,
    rgba(44, 24, 16, 0.05) 60%,
    transparent 100%
  );
}
.herb-field.loc-stream {
  background: linear-gradient(180deg,
    rgba(74, 144, 217, 0.12) 0%,
    rgba(74, 144, 217, 0.08) 30%,
    rgba(44, 24, 16, 0.05) 60%,
    transparent 100%
  );
}
.herb-field.loc-forest {
  background: linear-gradient(180deg,
    rgba(44, 62, 36, 0.18) 0%,
    rgba(44, 62, 36, 0.12) 30%,
    rgba(44, 24, 16, 0.05) 60%,
    transparent 100%
  );
}

/* individual herb sprite */
.herb-sprite {
  position: absolute;
  cursor: pointer;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  animation: herbAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both, herbFloat 3s ease-in-out infinite;
  animation-delay: 0s, 0.4s;
}

.herb-sprite:active {
  transform: scale(1.3);
}

.herb-sprite.collected {
  animation: herbCollect 0.4s ease forwards;
}

@keyframes herbCollect {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5) translateY(-20px); opacity: 0.6; }
  100% { transform: scale(0) translateY(-40px); opacity: 0; }
}

/* 采药区草药emoji */
.herb-sprite .herb-emoji {
  font-size: 2.2rem;
  display: block;
  text-align: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}
.herb-sprite .herb-field-img {
  width: 52px; height: 52px; object-fit: cover; border-radius: 26px;
  display: block; margin: 0 auto;
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.herb-sprite .herb-name-tag {
  display: block;
  font-size: 0.6rem;
  text-align: center;
  color: #2C2C2C;
  background: rgba(245, 240, 232, 0.85);
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 2px;
  white-space: nowrap;
}

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

.herb-field-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #B8B2A8;
  font-size: 1rem;
  z-index: 2;
}

.field-empty-sub {
  font-size: 0.75rem;
  margin-top: 4px;
}

/* ---------- Inventory ---------- */
.herb-inventory {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}

.inventory-count {
  font-size: 0.75rem;
  color: #B8B2A8;
  margin-left: auto;
}

.inventory-slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.inventory-slot {
  aspect-ratio: 1;
  background: var(--ink-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: #B8B2A8;
  position: relative;
}

.inventory-slot.filled {
  background: rgba(107, 142, 78, 0.1);
  border-color: var(--herb-green);
}

.inventory-slot .slot-emoji {
  font-size: 1.5rem;
}

.inventory-slot .slot-name {
  font-size: 0.7rem;
  margin-top: 2px;
  color: #8B8B8B;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 100%;
}

/* ---------- Collect Particle Effect ---------- */
@keyframes particleBurst {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* ---------- Collect CD Timer ---------- */
.collect-timer {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink-dark);
  color: var(--gold-leaf-light);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 50;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px var(--shadow-heavy);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
}

.collect-timer.show {
  opacity: 1;
}

/* ---------- Brew Success Animation Enhancement ---------- */
@keyframes brewSuccess {
  0% { transform: scale(1); }
  30% { transform: scale(1.1); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.brew-success {
  animation: brewSuccess 0.6s ease-in-out;
}

/* 药材真图 - 图鉴版（大尺寸，显示细节） */
.collection-card .herb-image {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 6px;
  border: 2px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}

/* 药材真图 - 详情弹窗版 */
.detail-image {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
}
