/* Chapter 04 Appendix · 48 国际音标点读卡 · 定稿视觉复刻（2026-10-02）
   颜色语义（业务规则，最高优先级）：元音 = 粉色，辅音 = 蓝色。
   只改展示层；数据 / 音频 / 点击逻辑不变。 */

:root {
  --navy-900: #102E5B; --navy-800: #173E73; --navy-700: #24558E;
  --blue-600: #1669DE; --blue-500: #278AF0; --blue-400: #61B3F9; --blue-300: #9BD3FF;
  --blue-200: #CBE8FF; --blue-100: #EAF7FF; --blue-050: #F5FBFF;
  --pink-600: #EF3E7C; --pink-500: #F65D91; --pink-400: #FA7FA8; --pink-300: #FDB1C8;
  --pink-200: #FFD3E0; --pink-100: #FFEAF1; --pink-050: #FFF7FA;
  --cream-000: #FFFEFB; --cream-050: #FFF9F3;
  --text-main: #102E5B; --text-secondary: #6F86A8; --text-muted: #93A5BE;
  --border-blue: #C9E4FA; --border-pink: #F7D2DE;
  --white: #FFFFFF; --yellow: #FFD75A; --green: #6BCB9E;

  --radius-xs: 10px; --radius-sm: 14px; --radius-md: 16px; --radius-lg: 18px; --radius-pill: 999px;
  --page-max: 520px; --page-pad: 16px; --nav-h: 46px;
  --section-gap: 24px; --card-gap: 9px; --grid-gap: 8px;
  --combo-card-h: 118px; --ipa-card-h: 82px;
  --combo-radius: 18px; --ipa-radius: 16px;
  --section-bar-h: 42px; --play-combo: 28px; --play-ipa: 22px;
}

* { box-sizing: border-box; }

body.appendix-ipa {
  margin: 0;
  background: #FFF7FA;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "SF Pro Display",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}

.reading-page {
  min-height: 100vh;
  color: var(--text-main);
  background: linear-gradient(180deg, #FFF7FA 0, #FFFAFC 260px, #FFFFFF 760px);
}

.page-inner {
  width: min(calc(100% - 32px), var(--page-max));
  margin: 0 auto;
  padding: 0 0 48px;
  box-sizing: border-box;
}

/* ---------- 顶部导航 ---------- */
.reading-page .apx-nav {
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 8px 0 14px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.reading-page .apx-nav-back,
.reading-page .apx-nav-links a {
  color: #7C91AD;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.reading-page .apx-nav-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.reading-page .apx-nav-links a { position: relative; }
.reading-page .apx-nav a:hover,
.reading-page .apx-nav a:focus { color: var(--pink-600); text-decoration: none; }
.reading-page .apx-nav a.is-active { color: var(--pink-600); font-weight: 700; }
.reading-page .apx-nav a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px;
  height: 2px; border-radius: 99px; background: var(--pink-600);
}

/* ---------- 页面主标题区 ---------- */
.reading-header { position: relative; min-height: 105px; padding-right: 94px; }
.reading-kicker {
  margin: 0 0 4px; font-size: 12px; letter-spacing: .16em;
  font-weight: 700; color: var(--text-muted);
}
.reading-title {
  margin: 0; font-size: 32px; line-height: 1.15; font-weight: 800;
  letter-spacing: -.5px; color: var(--navy-900);
}
.reading-subtitle {
  margin: 8px 0 0; font-size: 15px; line-height: 23px;
  font-weight: 400; color: #7389A7;
}
.reading-header__mascot {
  position: absolute; right: 0; bottom: 0; width: 94px; height: auto;
  pointer-events: none;
}
.reading-header__mascot img { width: 100%; height: auto; display: block; }

.ipa-status {
  margin: 0 0 16px; min-height: 20px; font-size: 13px; line-height: 20px;
  font-weight: 500; color: var(--text-secondary);
}

/* ---------- 分组 ---------- */
.ipa-groups { display: block; }
.ipa-cat { margin: 0; }
.ipa-cat-title {
  margin: 0 0 10px; font-size: 15px; line-height: 21px; font-weight: 700;
  letter-spacing: .02em; color: var(--navy-700);
}
.ipa-group { margin: 0 0 var(--section-gap); }
.ipa-group-title { margin: 0 0 var(--grid-gap); }

/* ---------- 栏目标题条 ---------- */
.section-titlebar {
  height: var(--section-bar-h); min-height: var(--section-bar-h);
  padding: 0 12px; display: flex; align-items: center;
  border-radius: var(--radius-md); background: #ECF7FF;
}
.section-titlebar.is-vowel { background: #FFF0F5; }
.section-titlebar__num {
  flex: 0 0 auto; width: 38px; height: 26px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; line-height: 1; color: #FFFFFF;
  background: var(--blue-400);
}
.section-titlebar.is-vowel .section-titlebar__num { background: var(--pink-500); }
.section-titlebar__title {
  margin-left: 10px; font-size: 17px; line-height: 24px;
  font-weight: 700; color: var(--navy-800);
}
.section-titlebar__count {
  margin-left: 8px; font-size: 13px; font-weight: 500; color: #8DA1BC;
}

/* ---------- 音标网格（4 列） ---------- */
.ipa-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--grid-gap);
}

/* ---------- 音标卡 ---------- */
.ipa-cell {
  height: var(--ipa-card-h); padding: 8px 4px 9px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--border-pink);
  border-radius: var(--ipa-radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .94),
              0 2px 0 rgba(208, 83, 126, .13),
              0 6px 12px rgba(208, 83, 126, .07);
  cursor: pointer; font: inherit; color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 140ms ease, box-shadow 140ms ease,
              border-color 140ms ease, background-color 140ms ease;
}
.ipa-cell.is-consonant {
  border-color: var(--border-blue);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .94),
              0 2px 0 rgba(37, 104, 160, .13),
              0 6px 12px rgba(37, 104, 160, .07);
}
.ipa-cell .glyph {
  font-family: "Charis SIL", "Noto Sans", "Segoe UI Symbol", "Apple Symbols", sans-serif;
  font-size: 25px; line-height: 30px; font-weight: 400;
  white-space: nowrap; color: var(--pink-600);
}
.ipa-cell.is-consonant .glyph { color: var(--blue-600); }

/* ---------- 小圆播放钮（CSS 绘制，非 emoji） ---------- */
.ipa-cell .spk {
  width: var(--play-ipa); height: var(--play-ipa); margin-top: 7px;
  border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--pink-400);
  box-shadow: 0 0 0 3px rgba(250, 127, 168, .10);
  transition: transform 120ms ease;
}
.ipa-cell .spk::before {
  content: ""; width: 0; height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #FFFFFF;
  transform: translateX(1px);
}
.ipa-cell.is-consonant .spk {
  background: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(97, 179, 249, .10);
}
.ipa-cell:hover .spk { transform: scale(1.04); }
.ipa-cell:active .spk { transform: scale(.96); }

.ipa-cell:focus-visible {
  outline: 3px solid rgba(239, 62, 124, .28); outline-offset: 2px;
}
.ipa-cell.is-consonant:focus-visible {
  outline-color: rgba(22, 105, 222, .28);
}
.ipa-cell:active,
.ipa-cell.playing {
  transform: translateY(2px);
  background: rgba(255, 242, 247, .92);
  border-color: var(--pink-400);
  box-shadow: inset 0 2px 5px rgba(208, 83, 126, .16),
              inset 0 1px 0 rgba(255, 255, 255, .58),
              0 1px 2px rgba(208, 83, 126, .05);
}
.ipa-cell.is-consonant:active,
.ipa-cell.is-consonant.playing {
  background: rgba(237, 247, 255, .94);
  border-color: var(--blue-400);
  box-shadow: inset 0 2px 5px rgba(37, 104, 160, .16),
              inset 0 1px 0 rgba(255, 255, 255, .58),
              0 1px 2px rgba(37, 104, 160, .05);
}

.ipa-foot { margin: 24px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--text-muted); }

/* ---------- 卡片右上角的小书本：去第一章重学这个音标（2026-10-29） ---------- */
.ipa-cell-slot { position: relative; }
.ipa-cell-slot > .ipa-cell { width: 100%; }

/* 32×32 的可点区域（手机好点），里面只画一条很小的线描书本：没有底色、没有边框、没有阴影。
   尺寸和内缩都是被卡片宽度逼出来的：四列手机卡只有 84px 宽，最宽的 /ʊə/ /əʊ/ /aɪ/ 这类
   带斜杠的四字符音标左右各只剩 18px 空隙；内缩 6px 能让图标稳稳落在 16px 圆角里面
   （不骑在边框上），剩下的 12px 正好不碰最后一个斜杠。屏越宽卡越大，图标才放到 16px。 */
.ipa-cell-book {
  position: absolute; top: 0; right: 0;
  width: 32px; height: 32px;
  display: grid; align-items: start; justify-items: end;
  padding: 6px 6px 0 0;
  color: #B58A9A;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  animation: ipa-book-in 150ms ease-out;
}
.ipa-cell-book svg { width: 12px; height: 12px; display: block; }
.ipa-cell-book:hover { color: #9C7383; }
.ipa-cell-book:focus-visible {
  outline: 2px solid rgba(181, 138, 154, .62);
  outline-offset: -3px;
  border-radius: 10px;
}
@media (min-width: 420px) {
  .ipa-cell-book svg { width: 16px; height: 16px; }
}
@media (max-width: 385px) {
  .ipa-cell-book { padding: 5px 5px 0 0; }
  .ipa-cell-book svg { width: 11px; height: 11px; }
}
@media (max-width: 345px) {
  .ipa-cell-book { padding: 4px 4px 0 0; }
  .ipa-cell-book svg { width: 9px; height: 9px; }
}

@keyframes ipa-book-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (min-width: 700px) {
  .page-inner { border-radius: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .ipa-cell,
  .ipa-cell .spk { transition: none; }
  .ipa-cell-book { animation: none; }
}
