/* 词卡与联想画面 */

.ex-card { gap: 0; }
.wcard { --c: var(--c4); display: grid; gap: 14px; justify-items: center; text-align: center; padding: 16px 16px 18px; border-radius: 26px; background: var(--surface); border: 2px solid var(--line); border-top: 8px solid var(--c); box-shadow: var(--shadow); }
.wcard-c1 { --c: var(--c1); } .wcard-c2 { --c: var(--c2); } .wcard-c3 { --c: var(--c3); } .wcard-c4 { --c: var(--c4); } .wcard-c5 { --c: var(--c5); }
.wcard > * { min-width: 0; max-width: 100%; }
.wcard-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }

/* 类别徽章：五类五色 */
.cls-badge { --c: var(--c4); display: inline-flex; align-items: center; border-radius: 999px; overflow: hidden; font-size: 13px; font-weight: 800; border: 2px solid var(--c); color: var(--c); white-space: nowrap; }
.cls-badge b { padding: 2px 9px; background: var(--c); color: #fff; }
.cls-badge span { padding: 2px 10px 2px 7px; }
.cls-1 { --c: #0E9C8B; } .cls-2 { --c: #2F7BEA; } .cls-3 { --c: #8457E8; } .cls-4 { --c: #D07F00; } .cls-5 { --c: #D93A48; }
@media (prefers-color-scheme: dark) { .cls-badge { color: #fff; } }

.wcard-lemma { font-weight: 900; line-height: 1.05; letter-spacing: -.01em; overflow-wrap: anywhere; color: var(--ink); }
.lemma-xl { font-size: 68px; } .lemma-lg { font-size: 52px; } .lemma-md { font-size: 40px; } .lemma-sm { font-size: 31px; }
.wcard-say { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 28px; }
.ipa { font-size: 19px; color: var(--muted); font-family: "Charis SIL", "Doulos SIL", "Lucida Sans Unicode", "Segoe UI", "Noto Sans", sans-serif; }
.wcard-zh { font-size: 26px; font-weight: 800; line-height: 1.3; }

/* 一/二/三类：与英语并排，逐字母高亮差异 */
.cmp, .ff { width: 100%; display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--r-md); background: var(--soft); text-align: left; }
.cmp-row, .ff-en, .ff-sv { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cmp-tag { flex: none; width: 52px; padding: 2px 0; border-radius: 8px; text-align: center; font-size: 12px; font-weight: 800; color: #fff; }
.cmp-sv { background: #2F6FB8; } .cmp-en { background: #7B8194; }
.cmp-word { display: flex; flex-wrap: wrap; gap: 3px; font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace; font-size: 26px; font-weight: 800; line-height: 1.2; }
.ltr { display: inline-block; min-width: .78em; padding: 1px 2px; border-radius: 6px; text-align: center; }
.ltr-diff { background: var(--sun); color: #2A1B00; box-shadow: 0 2px 0 #B5761B; animation: pop .4s .5s both; }
.cmp-tip { font-size: 14px; color: var(--muted); }

/* 五类：英语意思划掉 + 醒目警告 */
.ff { background: var(--lingon-soft); border: 2px solid var(--c5); }
.ff-struck { position: relative; font-size: 22px; font-weight: 800; color: var(--muted); }
.ff-struck-note { font-size: 15px; font-weight: 600; font-family: var(--font); }
.ff-struck::after { content: ""; position: absolute; left: -4px; right: -4px; top: 52%; height: 4px; border-radius: 2px; background: #D93A48; transform-origin: left center; animation: strike .5s .45s both; }
@keyframes strike { from { transform: scaleX(0) rotate(-3deg); } to { transform: scaleX(1) rotate(-3deg); } }
.ff-x { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #D93A48; color: #fff; font-size: 14px; font-weight: 900; animation: pop .35s .9s both; }
.ff-real { font-size: 17px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.ff-real b { font-size: 22px; font-weight: 900; }
.ff-warn { display: flex; gap: 8px; align-items: flex-start; margin-top: 2px; padding: 10px 12px; border-radius: 12px; background: #D93A48; color: #fff; font-size: 16px; font-weight: 700; line-height: 1.45; }
.ff-warn-ico { flex: none; font-size: 20px; line-height: 1.3; animation: shake-x .5s 1.1s; }

/* 组合词：积木拼合 */
.bricks { display: grid; gap: 6px; justify-items: center; width: 100%; padding: 12px 8px 8px; border: 2px dashed var(--line); border-radius: var(--r-md); background: var(--soft); color: var(--ink); }
.bricks-row { display: flex; align-items: stretch; justify-content: center; max-width: 100%; }
.brick { --bc: #4C5FE0; position: relative; z-index: calc(10 - var(--i, 0)); display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; padding: 8px 14px 9px; background: var(--bc); color: #fff; border-radius: 12px; box-shadow: 0 5px 0 color-mix(in srgb, var(--bc) 68%, #000); }
.brick-0 { --bc: #4C5FE0; } .brick-1 { --bc: #D07F00; } .brick-2 { --bc: #0E9C8B; } .brick-3 { --bc: #D8508F; }
.brick-sv { font-size: 24px; font-weight: 900; line-height: 1.15; }
.brick-zh { font-size: 13px; font-weight: 600; opacity: .95; white-space: nowrap; }
/* 积木右侧的凸起，拼合后嵌进下一块 */
.brick:not(:last-child)::after { content: ""; position: absolute; z-index: 2; right: -9px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--bc); }
.brick-plus { display: grid; place-items: center; width: 34px; font-size: 24px; font-weight: 900; color: var(--muted); overflow: hidden; }
.bricks-hint { font-size: 12px; color: var(--muted); font-weight: 600; }
.is-built .brick { animation: brick-in 1s cubic-bezier(.3, 1.5, .5, 1) both; }
.is-built .brick-plus { animation: plus-out 1s both; }
.is-built.is-compound .wcard-lemma { animation: pop .5s .95s both; }
@keyframes brick-in {
  0% { transform: translateX(calc(var(--dir) * 46px)) rotate(calc(var(--dir) * 7deg)); opacity: 0; }
  30% { transform: translateX(calc(var(--dir) * 30px)) rotate(calc(var(--dir) * 5deg)); opacity: 1; }
  55% { transform: translateX(calc(var(--dir) * 30px)) rotate(calc(var(--dir) * 5deg)); }
  85% { transform: translateX(calc(var(--dir) * -3px)) rotate(0); }
  100% { transform: none; }
}
@keyframes plus-out { 0%, 50% { width: 34px; opacity: 1; } 85%, 100% { width: 0; opacity: 0; } }

.forms { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.form { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--line); font-size: 15px; }
.form-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.form-word { font-weight: 800; }

.hook { display: flex; gap: 8px; align-items: flex-start; width: 100%; padding: 10px 14px; border-radius: var(--r-md); background: var(--sun-soft); border-left: 6px solid var(--sun); font-size: 17px; font-weight: 800; text-align: left; line-height: 1.4; }
.hook-ico { flex: none; }
.story { width: 100%; font-size: 16px; text-align: left; line-height: 1.6; }
.example { width: 100%; padding: 10px 12px; border-radius: var(--r-md); border: 2px solid var(--line); text-align: left; }
.example-sv { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; line-height: 1.3; }
.example-sv > span[lang] { min-width: 0; overflow-wrap: anywhere; }
.example-zh { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* —— 联想画面 —— */
.scene { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden; container-type: inline-size; isolation: isolate; cursor: pointer; background: var(--soft); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .06); }
.scene-decor { position: absolute; inset: 0; z-index: 0; }
.scene-sky { background: linear-gradient(#7CC8FF, #DDF3FF); }
.scene-sky .scene-decor { background: radial-gradient(ellipse 22% 10% at 22% 22%, #fff 60%, transparent 62%), radial-gradient(ellipse 16% 8% at 34% 27%, #fff 60%, transparent 62%), radial-gradient(ellipse 20% 9% at 78% 16%, rgba(255, 255, 255, .9) 60%, transparent 62%); }
.scene-grass { background: linear-gradient(#8ED3FF 0 58%, #6CC56B 58% 100%); }
.scene-grass .scene-decor { background: radial-gradient(ellipse 60% 22% at 30% 60%, #7FD27C 60%, transparent 61%), radial-gradient(circle at 86% 16%, #FFE27A 0 7%, transparent 7.5%); }
.scene-night { background: linear-gradient(#141A45, #3A2A6B); }
.scene-night .scene-decor { background: radial-gradient(circle at 14% 22%, #fff 0 .7%, transparent 1%), radial-gradient(circle at 32% 12%, #fff 0 .5%, transparent .8%), radial-gradient(circle at 58% 20%, #fff 0 .7%, transparent 1%), radial-gradient(circle at 74% 10%, #fff 0 .5%, transparent .8%), radial-gradient(circle at 90% 30%, #fff 0 .6%, transparent .9%), radial-gradient(circle at 86% 14%, #FFF3B8 0 5%, transparent 5.5%); }
.scene-room { background: linear-gradient(#F7E4C3 0 68%, #C7996A 68% 100%); }
.scene-room .scene-decor { background: linear-gradient(#B98A5C, #B98A5C) 0 68% / 100% 2.5% no-repeat, linear-gradient(#BFE3FF, #E8F6FF) 82% 16% / 20% 30% no-repeat; }
.scene-sea { background: linear-gradient(#9FDBFF 0 48%, #2F8FD6 48% 100%); }
.scene-sea .scene-decor { background: radial-gradient(ellipse 12% 5% at 20% 62%, rgba(255, 255, 255, .55) 60%, transparent 62%), radial-gradient(ellipse 14% 5% at 62% 78%, rgba(255, 255, 255, .45) 60%, transparent 62%), radial-gradient(circle at 84% 16%, #FFE27A 0 7%, transparent 7.5%); }
.scene-sand { background: linear-gradient(#A6E0FF 0 52%, #F3D9A0 52% 100%); }
.scene-sand .scene-decor { background: radial-gradient(ellipse 50% 14% at 70% 54%, #F8E3B4 60%, transparent 61%), radial-gradient(circle at 14% 18%, #FFE27A 0 7%, transparent 7.5%); }
.scene-snow { background: linear-gradient(#C4DDF2 0 60%, #FFFFFF 60% 100%); }
.scene-snow .scene-decor { background: radial-gradient(circle at 12% 18%, #fff 0 1.2%, transparent 1.5%), radial-gradient(circle at 30% 40%, #fff 0 1%, transparent 1.3%), radial-gradient(circle at 52% 14%, #fff 0 1.2%, transparent 1.5%), radial-gradient(circle at 70% 36%, #fff 0 1%, transparent 1.3%), radial-gradient(circle at 88% 20%, #fff 0 1.2%, transparent 1.5%), radial-gradient(ellipse 50% 16% at 28% 62%, #fff 60%, transparent 61%); }
.scene-plain { background: linear-gradient(135deg, #EEF0FF, #FFF4DA); }

.actor { position: absolute; z-index: 1; left: var(--x); top: var(--y); transform: translate(-50%, -50%); line-height: 1; font-size: 54px; }
.actor-s1 { font-size: 34px; font-size: 11cqw; }
.actor-s2 { font-size: 54px; font-size: 17cqw; }
.actor-s3 { font-size: 78px; font-size: 25cqw; }
.actor-in { display: inline-block; animation-delay: var(--delay); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif; }
.scene.is-replay .actor, .scene.is-replay .actor-in { animation: none !important; }

/* 10 种 anim */
.anim-none { animation: none; }
.anim-shake { animation: a-shake .9s ease-in-out infinite; }
.anim-bounce { animation: a-bounce 1s cubic-bezier(.3, 0, .7, 1) infinite alternate; }
.anim-zoom { animation: a-zoom 1.8s ease-in-out infinite; }
.anim-spin { animation: a-spin 2.4s linear infinite; }
.anim-float { animation: a-float 3s ease-in-out infinite; }
.anim-slide { animation: a-slide 2.4s ease-in-out infinite alternate; }
.anim-flip { animation: a-flip 2.2s ease-in-out infinite; }
.anim-pulse { animation: a-pulse 1.2s ease-in-out infinite; }
.anim-merge { animation: a-merge-in 3.2s ease-in-out infinite; animation-delay: 0s; }
.actor-merge { animation: a-merge 3.2s ease-in-out infinite; }
@keyframes a-shake { 0%, 100% { transform: rotate(0); } 15% { transform: translateX(-7%) rotate(-9deg); } 30% { transform: translateX(7%) rotate(9deg); } 45% { transform: translateX(-5%) rotate(-6deg); } 60% { transform: translateX(5%) rotate(6deg); } 75% { transform: rotate(0); } }
@keyframes a-bounce { from { transform: translateY(8%) scale(1.06, .94); } to { transform: translateY(-34%) scale(.97, 1.04); } }
@keyframes a-zoom { 0%, 100% { transform: scale(.7); } 50% { transform: scale(1.3); } }
@keyframes a-spin { to { transform: rotate(360deg); } }
@keyframes a-float { 0%, 100% { transform: translateY(6%) rotate(-4deg); } 50% { transform: translateY(-16%) rotate(4deg); } }
@keyframes a-slide { from { transform: translateX(-55%); } to { transform: translateX(55%); } }
@keyframes a-flip { 0%, 30% { transform: rotateY(0); } 50%, 80% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
@keyframes a-pulse { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255, 220, 120, 0)); } 50% { transform: scale(1.16); filter: drop-shadow(0 0 10px rgba(255, 220, 120, .9)); } }
/* merge：外层向画面中心靠拢，内层在合体瞬间鼓一下 */
@keyframes a-merge { 0%, 18% { left: var(--x); top: var(--y); } 48%, 82% { left: var(--mx); top: var(--my); } 100% { left: var(--x); top: var(--y); } }
@keyframes a-merge-in { 0%, 44% { transform: scale(1); } 52% { transform: scale(1.25); } 60%, 100% { transform: scale(1); } }

.scene-caption { position: absolute; z-index: 2; left: 50%; bottom: 8px; transform: translateX(-50%); max-width: calc(100% - 20px); padding: 3px 12px; border-radius: 999px; background: rgba(20, 22, 45, .72); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (prefers-reduced-motion: reduce) {
  .ff-struck::after { transform: scaleX(1) rotate(-3deg); }
  .brick-plus { width: 0; opacity: 0; }
}
