/* 拼音学习（全新设计）—— 柔和渐变 + 玻璃卡片 + 明确悬停/发音状态，轻量可动画 */
.pinyin-learning {
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, #e0e7ff 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #ccfbf1 0%, transparent 55%),
    #f6f8fc;
  font-family: var(--font-sans);
}
.pinyin-learning[hidden] { display: none; }
.pinyin-learning * { box-sizing: border-box; }
.pinyin-learning button { cursor: pointer; font: inherit; border: 0; }
.pinyin-learning button:focus-visible { outline: 3px solid #6366f1; outline-offset: 3px; border-radius: 10px; }
.pinyin-learning button:disabled { opacity: .45; cursor: default; }

/* 环境装饰：模糊光斑，轻浮动 */
.pinyin-ambient { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.amb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; }
.blob1 { width: 320px; height: 320px; left: -80px; top: -60px; background: #a5b4fc; animation: pn-float 14s ease-in-out infinite; }
.blob2 { width: 360px; height: 360px; right: -100px; top: 120px; background: #5eead4; animation: pn-float 18s ease-in-out infinite reverse; }
.blob3 { width: 260px; height: 260px; right: 18%; bottom: -80px; background: #fcd34d; opacity: .35; animation: pn-float 16s ease-in-out infinite; }
@keyframes pn-float { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(24px) translateX(12px); } }

/* 顶栏 */
.pinyin-topbar {
  position: relative; z-index: 2;
  flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 26px;
}
.pinyin-topbar h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.pn-icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
  color: #334155; transition: transform .15s;
}
.pn-icon-btn:hover { transform: translateX(-2px); }

/* 内容区 */
.pinyin-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 1100px; margin: 0 auto;
  flex: 1; min-height: 0; overflow: auto;
  padding: 10px 26px 60px;
}
.pn-loading { text-align: center; color: #64748b; padding: 60px 0; }

/* 标题区 */
.pn-hero, .pn-subhead { margin: 6px 0 22px; }
.pn-hero h2, .pn-subhead h2 { margin: 0 0 6px; font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.pn-hero p, .pn-subhead p { margin: 0; color: #64748b; font-size: 14px; line-height: 1.6; }

/* 分类卡片 */
.pn-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.pn-cat-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(15,23,42,.07);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15,23,42,.06);
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.pn-cat-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(15,23,42,.12); }
.pn-cat-glyph {
  flex: none;
  width: 64px; height: 64px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 16px;
  font-size: 26px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.pn-cat-meta { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.pn-cat-meta strong { font-size: 16px; font-weight: 800; }
.pn-cat-meta small { color: #94a3b8; font-size: 12.5px; }
.pn-cat-go { color: #cbd5e1; transition: transform .18s, color .18s; }
.pn-cat-card:hover .pn-cat-go { transform: translateX(4px); color: #6366f1; }

/* 各分类配色 */
.accent-single .pn-cat-glyph { background: linear-gradient(135deg,#fb7185,#f43f5e); }
.accent-initial .pn-cat-glyph { background: linear-gradient(135deg,#6366f1,#4f46e5); }
.accent-compound .pn-cat-glyph { background: linear-gradient(135deg,#14b8a6,#0d9488); }
.accent-whole .pn-cat-glyph { background: linear-gradient(135deg,#f59e0b,#d97706); }
.accent-front .pn-cat-glyph { background: linear-gradient(135deg,#a78bfa,#7c3aed); }
.accent-back .pn-cat-glyph { background: linear-gradient(135deg,#34d399,#059669); }
.accent-single:hover { border-color: #fb7185; }
.accent-initial:hover { border-color: #6366f1; }
.accent-compound:hover { border-color: #14b8a6; }
.accent-whole:hover { border-color: #f59e0b; }
.accent-front:hover { border-color: #a78bfa; }
.accent-back:hover { border-color: #34d399; }

/* 字母网格 */
.pn-letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.pinyin-letter {
  display: flex; flex-direction: column;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.pinyin-letter:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15,23,42,.1); border-color: #c7d2fe; }
.pl-main {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 12px 14px; width: 100%; background: transparent;
}
.pl-glyph { font-size: 34px; font-weight: 800; color: #1e293b; line-height: 1; }
.pl-sound {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #eef2ff; color: #6366f1;
  transition: background .15s, color .15s;
}
.pl-main:hover .pl-sound { background: #6366f1; color: #fff; }
.pl-main.is-playing .pl-sound { background: #6366f1; color: #fff; animation: pn-pulse 1s ease-in-out infinite; }
.pd-big-play.is-playing, .pd-play.is-playing { animation: pn-pulse 1s ease-in-out infinite; }
@keyframes pn-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(99,102,241,.5); } 50% { box-shadow: 0 0 0 8px rgba(99,102,241,0); } }
.pl-tech {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; padding: 9px 8px;
  font-size: 12.5px; font-weight: 700; color: #64748b;
  border-top: 1px solid rgba(15,23,42,.06);
  background: #f8fafc;
  transition: background .15s, color .15s;
}
.pl-tech:hover { background: #eef2ff; color: #4f46e5; }

/* 详情工作室 */
.pd-studio {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 22px;
  padding: 30px 28px;
  box-shadow: 0 16px 40px rgba(15,23,42,.08);
  max-width: 620px; margin: 0 auto;
}
.pd-big { display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 22px; }
.pd-big-glyph { font-size: 72px; font-weight: 900; color: #1e293b; line-height: 1; }
.pd-big-play {
  width: 64px; height: 64px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff;
  box-shadow: 0 12px 26px rgba(99,102,241,.4);
  transition: transform .15s;
}
.pd-big-play:hover { transform: scale(1.06); }
.pd-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid rgba(15,23,42,.07); }
.pd-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: #334155; font-size: 14px; }
.pd-play {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: #eef2ff; color: #4f46e5; font-weight: 700; font-size: 13px;
  transition: background .15s, color .15s;
}
.pd-play:hover { background: #6366f1; color: #fff; }
.pd-technique { margin: 14px 0 4px; color: #475569; font-size: 14px; line-height: 1.75; background: #f8fafc; border-radius: 12px; padding: 14px 16px; }

/* 错误/重试 */
.pn-error { text-align: center; padding: 50px 0; }
.pn-error p { color: #dc2626; margin: 0 0 14px; }
.pn-retry { display: inline-flex; align-items: center; gap: 8px; background: #6366f1; color: #fff; padding: 10px 20px; border-radius: 999px; font-weight: 700; }
.pinyin-status { color: #dc2626; text-align: center; font-size: 13px; }

@media (max-width: 640px) {
  .pinyin-content { padding: 8px 16px 48px; }
  .pn-cat-grid { grid-template-columns: 1fr; }
  .pn-letter-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
}
