/* ═══════════════════════════════════════════════════════
   成语 · Chengyu — Production Stylesheet
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;700&family=Crimson+Pro:ital,wght@0,300;0,400;1,300;1,400&family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300&display=swap');

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ────────────────────────────────────────────── */
body {
  background: #f5f0e8;
  font-family: 'Crimson Pro', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

input::placeholder { color: #b8a48a; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(139,115,85,0.25);
  border-radius: 2px;
}

/* ── Animations ──────────────────────────────────────── */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0    rgba(139,115,85,0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(139,115,85,0);   }
  100% { box-shadow: 0 0 0 0    rgba(139,115,85,0);   }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Utility ─────────────────────────────────────────── */
.spin {
  animation: spin 1s linear infinite;
}

/* ── Card fade-in ────────────────────────────────────── */
.card-enter {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition:
    opacity  0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.card-enter.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Shuffle / Refresh button ────────────────────────── */
.shuf {
  background: none;
  border: none;
  padding: 4px;
  opacity: 0.45;
  transition: opacity 0.2s, transform 0.4s ease;
  cursor: pointer;
  color: #8B7355;
  display: flex;
  align-items: center;
}
.shuf:hover {
  opacity: 0.85;
  transform: rotate(180deg);
}

/* ── Volume / Pronunciation button ───────────────────── */
.vol {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid rgba(139,115,85,0.4);
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6B5040;
  box-shadow: 0 2px 12px rgba(139,115,85,0.15);
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.vol:hover {
  background: rgba(139,115,85,0.12);
  border-color: rgba(139,115,85,0.7);
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(139,115,85,0.25);
}
.vol.sp {
  background: rgba(139,115,85,0.18);
  animation: pulse-ring 1.2s infinite;
}

/* ── Download button ─────────────────────────────────── */
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(139,115,85,0.35);
  background: rgba(255,253,248,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: #6B5040;
  transition: all 0.25s ease;
  box-shadow: 0 2px 10px rgba(100,80,50,0.07);
}
.dl-btn:hover {
  border-color: rgba(139,90,43,0.6);
  background: rgba(139,90,43,0.08);
  box-shadow: 0 4px 16px rgba(100,80,50,0.12);
}
.dl-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
