/* Talkney responsive UI system
   Visual layer only: content, data loading and interaction logic remain in index.html. */

:root {
  --purple: #9b6cff;
  --purple-dark: #7449ca;
  --purple-soft: #f0e9ff;
  --mint: #62d6aa;
  --mint-dark: #2fae83;
  --mint-soft: #e8fbf4;
  --ink: #24212d;
  --muted: #746f7f;
  --line: #ded9e8;
  --line-strong: #c9c2d7;
  --paper: #ffffff;
  --canvas: #f7f4fb;
  --danger: #ef6b76;
  --success: #38b98b;
  --shadow-sm: 0 3px 0 rgba(63, 46, 91, .10);
  --shadow-md: 0 7px 0 rgba(63, 46, 91, .12), 0 14px 34px rgba(63, 46, 91, .10);
  --shadow-lg: 0 10px 0 rgba(63, 46, 91, .13), 0 24px 58px rgba(63, 46, 91, .14);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --page-width: 1440px;
  --nav-height: 84px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 4% 2%, rgba(155, 108, 255, .14), transparent 26rem),
    radial-gradient(circle at 96% 4%, rgba(98, 214, 170, .13), transparent 25rem),
    var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
button { color: inherit; }
button, [role="button"], .chip { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible {
  outline: 3px solid rgba(155, 108, 255, .42);
  outline-offset: 3px;
}

.app-shell { width: calc(100% - 40px); max-width: var(--page-width); margin: 20px auto 44px; }

/* Header and primary navigation */
.top-nav {
  position: sticky;
  top: 14px;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: var(--nav-height);
  padding: 11px 18px;
  border: 2px solid rgba(255, 255, 255, .94);
  border-radius: 30px;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px) saturate(1.2);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  cursor: pointer;
  user-select: none;
}
.brand-mark { display: block; width: 52px; height: 52px; object-fit: contain; }
.brand-copy { display: grid; gap: 1px; }
.brand-name { font-size: 20px; font-weight: 900; letter-spacing: -.4px; }

.top-tabs {
  grid-column: 2;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f7f5fa;
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 19px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: #8b8693;
  font-weight: 850;
  cursor: pointer;
  transition: transform .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease;
}
.tab:hover { color: var(--ink); background: #fff; }
.tab:active { transform: translateY(2px); }
.tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), #a989ff 52%, var(--mint));
  box-shadow: 0 4px 0 var(--purple-dark), 0 8px 18px rgba(116, 73, 202, .20);
}
.tab-icon { width: 22px; height: 22px; flex: 0 0 auto; }
.tab-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab-label-mobile { display: none; }

/* Page shell and filters */
.home-card { margin-top: 20px; }
.main-page { display: none; }
.main-page.active { display: block; animation: page-in .25s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }

.filter-panel {
  width: 100%;
  max-width: 100%;
  margin-bottom: 18px;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 26px;
  background: rgba(255, 255, 255, .84);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.library-row { display: flex; align-items: center; width: 100%; min-width: 0; min-height: 78px; padding: 11px 18px; }
.chip-scroll { width: 100%; max-width: 100%; min-width: 0; padding: 3px 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-wrap { display: flex; align-items: center; justify-content: safe center; gap: 9px; width: max-content; min-width: 100%; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 15px;
  border: 2px solid transparent;
  border-radius: 15px;
  color: #7c7785;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.chip:hover { color: var(--ink); background: var(--purple-soft); }
.chip:active { transform: translateY(2px); }
.nav-emoji {
  display: inline-block;
  margin-right: 6px;
  font-size: 1.08em;
  line-height: 1;
  vertical-align: -0.08em;
}
.chip.active-chip {
  color: var(--purple-dark);
  border-color: #d5c6fb;
  background: var(--purple-soft);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}
@media (min-width: 901px) {
  .filter-panel {
    margin-bottom: 14px;
    border-width: 1px;
    border-color: #ebe7f1;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(67,49,98,.055);
    backdrop-filter: none;
  }
  .library-row {
    min-height: 66px;
    padding: 9px 14px;
  }
  .chip-wrap { gap: 6px; }
  .chip {
    min-height: 42px;
    padding: 0 13px;
    border-width: 1px;
    border-radius: 13px;
    color: #706a78;
    font-size: 13.5px;
    box-shadow: none;
  }
  .chip:hover {
    color: #6840c6;
    border-color: transparent;
    background: #f7f4fb;
  }
  .chip.active-chip {
    color: #6540bd;
    border-color: #d8caf6;
    background: #f0e9ff;
    box-shadow: none;
  }
  .nav-emoji {
    margin-right: 6px;
    font-size: 16px;
  }
}
.mobile-filter-toggle { display: none; }

.content-panel {
  position: relative;
  min-height: 480px;
  padding: 58px 28px 32px;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow-md);
}
.section-label { position: absolute; top: 18px; right: 24px; left: 24px; display: flex; justify-content: flex-end; }
.section-label h2 { display: none; }

/* Shared view switch */
.view-switch { display: flex; align-items: center; gap: 8px; }
.view-switch-label {
  padding: 0;
  border: 0;
  background: transparent;
  color: #9993a2;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.view-switch-label.active { color: var(--purple-dark); }
.view-switch-track {
  position: relative;
  width: 52px;
  height: 30px;
  padding: 0;
  border: 2px solid var(--line-strong);
  border-bottom-width: 4px;
  border-radius: 999px;
  background: #f5f2f8;
  cursor: pointer;
}
.view-switch-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--mint));
  box-shadow: 0 2px 4px rgba(36, 33, 45, .22);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.view-switch:has(.view-switch-label:last-child.active) .view-switch-thumb { transform: translateX(22px); }

@media (min-width: 901px) {
  #libraryPage .content-panel,
  #culturePage .content-panel { padding-top: 66px; }
  #libraryPage .section-label,
  #culturePage .section-label {
    top: 14px;
    right: 28px;
    left: 28px;
    min-height: 40px;
    align-items: center;
  }
  #libraryPage .view-switch,
  #culturePage .view-switch {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(72px, 1fr));
    gap: 0;
    padding: 3px;
    border: 1px solid rgba(78,70,88,.10);
    border-radius: 14px;
    background: rgba(239,237,242,.62);
    box-shadow: inset 0 1px 2px rgba(35,29,42,.035);
  }
  #libraryPage .view-switch-label,
  #culturePage .view-switch-label {
    position: relative;
    z-index: 2;
    min-height: 32px;
    padding: 0 13px;
    border-radius: 10px;
    color: #9a959e;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .01em;
    transition: color .2s ease, transform .2s ease;
  }
  #libraryPage .view-switch-label:hover,
  #culturePage .view-switch-label:hover { color: #3f3946; }
  #libraryPage .view-switch-label.active,
  #culturePage .view-switch-label.active { color: #4b4650; }
  #libraryPage .view-switch-label:active,
  #culturePage .view-switch-label:active { transform: scale(.97); }
  #libraryPage .view-switch-label:focus-visible,
  #culturePage .view-switch-label:focus-visible {
    outline: 2px solid rgba(63,57,70,.32);
    outline-offset: 2px;
  }
  #libraryPage .view-switch-track,
  #culturePage .view-switch-track {
    position: absolute;
    top: 3px;
    left: 3px;
    z-index: 1;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.90);
    box-shadow: 0 2px 7px rgba(35,29,42,.09), inset 0 1px 0 rgba(255,255,255,.90);
    pointer-events: none;
    transition: transform .26s cubic-bezier(.2,.8,.2,1);
  }
  #libraryPage .view-switch-thumb,
  #culturePage .view-switch-thumb { display: none; }
  #libraryPage .view-switch:has(.view-switch-label:last-child.active) .view-switch-track,
  #culturePage .view-switch:has(.view-switch-label:last-child.active) .view-switch-track { transform: translateX(100%); }
}

/* Shared card primitives */
.expression-grid, .culture-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.expression-card, .culture-card, .swipe-card { min-width: 0; perspective: 1400px; }
.expression-card, .culture-card { transition: transform .22s ease, filter .22s ease; }
.expression-card:hover, .culture-card:hover { transform: translateY(-5px); filter: drop-shadow(0 12px 18px rgba(55, 40, 80, .10)); }
.expression-card { height: 420px; cursor: pointer; }
.culture-card { height: 420px; cursor: pointer; }
.expression-card-inner, .culture-card-inner, .swipe-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .58s cubic-bezier(.2, .76, .2, 1);
}
.expression-card.flipped .expression-card-inner,
.culture-card.flipped .culture-card-inner,
.swipe-card.flipped .swipe-card-inner { transform: rotateY(180deg); }
.expression-card-face, .culture-face, .swipe-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 211, 229, .92);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(74, 55, 103, .10), 0 15px 36px rgba(74, 55, 103, .12);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.expression-card-back, .culture-back, .swipe-back { transform: rotateY(180deg); }

/* Expression cards */
.expression-card-front, .swipe-front {
  display: flex;
  align-items: flex-end;
  padding: 25px;
  background:
    linear-gradient(180deg, rgba(20, 16, 29, .08) 8%, rgba(20, 16, 29, .10) 40%, rgba(20, 16, 29, .90) 100%),
    var(--expression-scene-image, linear-gradient(140deg, #c6afff, #77dfbd));
  background-position: center;
  background-size: cover;
  color: #fff;
}
.expression-card-front::before, .swipe-front::before {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: 0;
  background: inherit;
  background-position: center;
  background-size: cover;
  filter: blur(1.2px) saturate(.98) brightness(.96);
  transform: scale(1.01);
  pointer-events: none;
}
.expression-front-scene, .expression-back-scene, .expression-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  max-width: 58%;
  min-height: 30px;
  padding: 0 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  background: rgba(28, 23, 37, .46);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(14px) saturate(1.15);
}
.expression-front-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; width: 100%; }
.expression-front-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.88);
  font-size: 0;
  font-weight: 850;
  backdrop-filter: blur(10px);
}
.expression-front-kicker::before { display: none; content: none; }
.expression-front-kicker::after { content: "猜猜它是什么意思？"; display: block; font-size: 11px; }
.emoji-badge, .culture-emoji {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 15px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 6px 18px rgba(20, 15, 28, .20);
  font-size: 25px;
}
.expression-prompt-row { display: flex; flex-direction: column; align-items: flex-start; gap: 13px; width: 100%; }
.expression-front-emoji { flex: 0 0 auto; }
.expression-meaning, .swipe-meaning { max-width: none; margin: 0; font-size: clamp(26px, 2.2vw, 36px); font-weight: 950; line-height: 1.16; letter-spacing: -.8px; text-wrap: balance; }
.expression-flip-cue {
  display: inline-flex;
  align-self: flex-end;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin-top: 16px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 999px;
  background: rgba(24,19,32,.48);
  color: rgba(255,255,255,.92);
  box-shadow: 0 7px 18px rgba(21,16,29,.14);
  font-size: 11px;
  font-weight: 850;
  backdrop-filter: blur(12px) saturate(1.1);
}

@media (min-width: 901px) {
  .expression-card-front {
    align-items: flex-end;
    padding: 14px;
  }
  .expression-card-front::before {
    filter: blur(5px) saturate(.90) brightness(.90);
    transform: scale(1.035);
  }
  .expression-card-front .expression-front-copy {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 16px 18px 14px;
    border: 1px solid rgba(255,255,255,.42);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(29,25,37,.78), rgba(20,17,27,.64));
    box-shadow: 0 14px 34px rgba(20,15,28,.24), inset 0 1px 0 rgba(255,255,255,.15);
    backdrop-filter: blur(18px) saturate(1.12);
  }
  .expression-card-front .expression-prompt-row {
    align-items: flex-start;
    gap: 8px;
  }
  .expression-card-front .expression-front-emoji,
  .expression-card-front .expression-meaning,
  .expression-card-front .expression-front-kicker { align-self: flex-start; text-align: left; }
  .expression-card-front .expression-front-emoji {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 23px;
    box-shadow: 0 5px 14px rgba(11,8,16,.24);
  }
  .expression-card-front .expression-meaning {
    font-size: clamp(25px, 2vw, 32px);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -.65px;
    text-shadow: 0 2px 15px rgba(0,0,0,.28);
  }
  .expression-card-front .expression-front-kicker {
    gap: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255,255,255,.72);
    font-size: 0;
    font-weight: 750;
    backdrop-filter: none;
  }
  .expression-card-front .expression-front-kicker::before {
    width: 5px;
    height: 5px;
    box-shadow: 0 0 0 3px rgba(98,214,170,.14);
  }
  .expression-card-front .expression-front-kicker::after { font-size: 11px; }
  .expression-card-front .expression-flip-cue {
    align-self: flex-end;
    min-height: 0;
    margin-top: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255,255,255,.62);
    box-shadow: none;
    font-size: 10px;
    font-weight: 800;
    backdrop-filter: none;
  }
}

.expression-card-back, .swipe-back { display: grid; grid-template-rows: minmax(150px, 40%) 1fr; background: #f8f6fc; }
.expression-back-hero, .swipe-back-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 60px 24px 24px;
  background:
    linear-gradient(180deg, rgba(31,24,42,.08), rgba(31,24,42,.88)),
    var(--expression-scene-image, linear-gradient(135deg, #9b6cff, #62d6aa));
  background-position: center;
  background-size: cover;
  color: #fff;
}
.expression-card-back .expression-back-hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: rgba(255,255,255,.28);
  pointer-events: none;
}
@media (min-width: 901px) {
  .expression-card-back {
    --expression-back-panel-height: 184px;
    display: block;
    background: #17131f;
  }
  .expression-card-back .expression-back-hero {
    position: absolute;
    inset: 0;
    overflow: hidden;
    align-items: flex-end;
    /* Reserve a real title zone above the fixed detail panel. */
    padding: 70px 22px calc(var(--expression-back-panel-height) + 34px);
  }
  .expression-card-back .expression-back-hero::after {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    height: auto;
    background: linear-gradient(180deg, rgba(14,10,19,.04) 18%, rgba(14,10,19,.18) 38%, rgba(14,10,19,.72) 62%, rgba(14,10,19,.92) 100%);
    pointer-events: none;
  }
  .expression-card-back .expression-back-hero::before {
    content: "";
    position: absolute;
    inset: -3px;
    z-index: 0;
    background: inherit;
    background-position: center;
    background-size: cover;
    filter: blur(2.4px) saturate(.94) brightness(.93);
    transform: scale(1.02);
    pointer-events: none;
  }
  .expression-card-back .expression-back-hero > * { z-index: 1; }
  .expression-card-back .expression-back-scene {
    top: 16px;
    right: auto;
    left: 16px;
  }
  .expression-card-back .expression-top {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    width: 100%;
  }
  .expression-card-back .expression-title-row {
    display: block;
    min-width: 0;
    width: auto;
    flex: 1;
  }
  .expression-card-back .expression-title-row > .emoji-badge { display: none; }
  .expression-card-back .expression-title-copy { width: 100%; }
  .expression-card-back .expression-title-copy h3 {
    width: 100%;
    max-width: none;
    font-size: var(--expression-title-fit, 29px);
    line-height: 1.06;
    text-wrap: balance;
  }
  .expression-card-back .expression-back-counterpart {
    max-width: calc(100% - 4px);
    margin-top: 8px;
    color: rgba(255,255,255,.82);
    font-size: 13px;
    line-height: 1.3;
  }
  .expression-card-back .expression-actions {
    position: static;
    flex: 0 0 auto;
    margin: 0 0 1px;
  }
  .expression-card-back .sound-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 12px;
    background: rgba(22,17,29,.28);
    color: rgba(255,255,255,.90);
    box-shadow: 0 4px 12px rgba(12,8,17,.12), inset 0 1px 0 rgba(255,255,255,.12);
    backdrop-filter: blur(10px) saturate(1.08);
  }
  .expression-card-back .sound-btn .sound-icon { width: 18px; height: 18px; stroke-width: 1.8; }
  .expression-card-back .sound-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 7px rgba(12,8,17,.12);
  }
  .expression-card-back .expression-back-body {
    position: absolute;
    right: 14px;
    bottom: 14px;
    left: 14px;
    z-index: 2;
    box-sizing: border-box;
    height: var(--expression-back-panel-height);
    max-height: none;
    min-height: var(--expression-back-panel-height);
    gap: 0;
    padding: 15px 17px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 20px;
    background: rgba(20,16,27,.78);
    box-shadow: 0 14px 34px rgba(10,7,14,.28), inset 0 1px 0 rgba(255,255,255,.10);
    backdrop-filter: blur(18px) saturate(1.06);
  }
  .expression-card-back .expression-explain-block {
    padding: 1px 2px 12px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.14);
    border-radius: 0;
    background: transparent;
    color: rgba(255,255,255,.88);
    font-size: 12.5px;
    font-weight: 620;
    line-height: 1.48;
    box-shadow: none;
  }
  .expression-card-back .expression-example {
    margin-top: 11px;
    padding: 1px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255,255,255,.92);
    font-size: 12px;
    font-weight: 680;
    line-height: 1.44;
    box-shadow: none;
  }
  .expression-card-back .example-context { color: rgba(132,226,190,.86); }
  .expression-card-back .example-dialogue-line strong { color: rgba(190,166,255,.92); }
}
.expression-top, .swipe-title-row { display: flex; align-items: flex-end; gap: 13px; width: 100%; }
.expression-title-row { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.expression-title-copy, .swipe-title-copy { min-width: 0; flex: 1; }
.expression-title-copy h3, .swipe-title-copy h3 { margin: 0; font-size: var(--expression-title-fit, 29px); font-weight: 900; line-height: 1.08; letter-spacing: -.65px; overflow-wrap: anywhere; }
.expression-pronunciation, .swipe-pronunciation { margin-top: 6px; color: rgba(255,255,255,.76); font-size: 12px; font-weight: 700; }
.expression-actions { margin-left: auto; }
.sound-btn, .culture-sound-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  color: var(--purple-dark);
  box-shadow: 0 4px 0 rgba(33,25,45,.20);
  cursor: pointer;
}
.sound-btn:active, .culture-sound-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(33,25,45,.20); }
.sound-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.culture-sound-btn {
  position: relative;
  width: 42px;
  height: 42px;
  overflow: visible;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(255,255,255,.97), rgba(237,235,240,.93));
  color: #46404d;
  box-shadow: 0 6px 16px rgba(18,12,27,.22), inset 0 1px 0 #fff;
  transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease, color .2s ease, background .2s ease;
}
.culture-sound-btn::before {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: -1;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: inherit;
  opacity: 0;
  transform: scale(.84);
  transition: opacity .2s ease, transform .2s ease;
}
.culture-sound-btn .sound-icon {
  width: 19px;
  height: 19px;
  stroke-width: 2.1;
  transition: transform .2s ease;
}
.culture-sound-btn:hover {
  color: #211d26;
  background: #fff;
  box-shadow: 0 9px 21px rgba(18,12,27,.27), 0 0 0 3px rgba(255,255,255,.20), inset 0 1px 0 #fff;
  transform: translateY(-2px) scale(1.025);
}
.culture-sound-btn:hover::before { opacity: 1; transform: scale(1); }
.culture-sound-btn:hover .sound-icon { transform: scale(1.08); }
.culture-sound-btn:active {
  color: #17141b;
  box-shadow: 0 3px 9px rgba(18,12,27,.24), 0 0 0 3px rgba(255,255,255,.16);
  transform: translateY(1px) scale(.97);
}
.culture-sound-btn:focus-visible {
  outline: 3px solid rgba(255,255,255,.88);
  outline-offset: 3px;
}
.expression-back-body, .swipe-back-content { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px; overflow: auto; }
.expression-explain-block, .swipe-back-content .expression-meaning {
  position: relative;
  padding: 14px 15px;
  border: 1px solid rgba(121,91,184,.14);
  border-radius: 16px;
  background: rgba(255,255,255,.88);
  color: #504a59;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.58;
  box-shadow: 0 4px 14px rgba(61,45,90,.05);
}
.expression-explain-block::before {
  display: none;
  content: none;
}
.expression-example {
  position: relative;
  margin: 0;
  padding: 14px 15px;
  border: 1px solid rgba(105,205,167,.30);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(246,242,255,.96), rgba(237,251,246,.96));
  color: #54466f;
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.5;
  box-shadow: 0 4px 14px rgba(61,45,90,.05);
}
.expression-example::before {
  display: none;
  content: none;
}
.example-context { display: block; margin-bottom: 5px; color: #8b6fd0; font-size: 10.5px; font-weight: 850; text-transform: uppercase; }
.example-text { display: block; }
.example-dialogue { display: grid; gap: 7px; }
.example-dialogue-line {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
}
.example-dialogue-line strong {
  display: block;
  min-width: 0;
  color: #6f52bd;
  font-weight: 900;
}
.example-dialogue-line:first-child strong { color: #7654cc; }
.example-dialogue-line:nth-child(2) strong { color: #2fae83; }
@media (min-width: 901px) {
  .expression-card-back .example-dialogue-line:first-child strong { color: #c9b6ff; }
  .expression-card-back .example-dialogue-line:nth-child(2) strong { color: #77d6b0; }
}
.expression-back-counterpart { display: flex; align-items: center; gap: 7px; margin-top: 5px; color: #fff; font-size: 14px; font-weight: 850; }
.expression-counterpart-emoji { flex: 0 0 auto; font-size: 15px; line-height: 1; opacity: .78; }

/* Culture cards */
.culture-front {
  display: flex;
  align-items: flex-end;
  padding: 25px;
  background:
    linear-gradient(180deg, rgba(20,17,27,.06) 8%, rgba(20,17,27,.10) 42%, rgba(20,17,27,.90) 100%),
    var(--culture-image, linear-gradient(135deg, #a98bff, #62d6aa));
  background-position: center;
  background-size: cover;
  color: #fff;
}
.culture-front-tag, .culture-back-subtheme-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  max-width: 62%;
  padding: 7px 11px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  background: rgba(27,23,35,.46);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(14px) saturate(1.15);
}
.culture-front-content { position: relative; z-index: 1; width: 100%; }
.culture-reveal-cue { display: none !important; }
.culture-front-content h3 { margin: 14px 0 7px; font-size: 31px; font-weight: 950; line-height: 1.08; letter-spacing: -.9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.culture-front-sub { max-width: 92%; margin: 0; color: rgba(255,255,255,.80); font-size: 13px; font-weight: 750; line-height: 1.48; }
@media (min-width: 901px) {
  .culture-front {
    padding: 14px;
    background:
      linear-gradient(180deg, rgba(18,15,24,.04) 0%, rgba(18,15,24,.08) 42%, rgba(18,15,24,.52) 100%),
      var(--culture-image, linear-gradient(135deg, #a98bff, #62d6aa));
    background-position: center;
    background-size: cover;
  }
  .culture-front::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.12), transparent 34%);
    pointer-events: none;
  }
  .culture-front-tag {
    top: 14px;
    right: 14px;
    padding: 7px 12px;
    border-color: rgba(255,255,255,.34);
    background: rgba(24,20,32,.42);
    color: rgba(255,255,255,.92);
    box-shadow: 0 5px 14px rgba(20,15,28,.12), inset 0 1px 0 rgba(255,255,255,.08);
    backdrop-filter: blur(14px) saturate(1.12);
  }
  .culture-front-content {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 0 12px;
    padding: 17px 18px 15px;
    border: 1px solid rgba(255,255,255,.42);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(29,25,37,.74), rgba(20,17,27,.60));
    box-shadow: 0 14px 34px rgba(20,15,28,.22), inset 0 1px 0 rgba(255,255,255,.16);
    backdrop-filter: blur(18px) saturate(1.14);
  }
  .culture-front-content .culture-emoji {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 22px;
    box-shadow: 0 5px 14px rgba(11,8,16,.22);
  }
  .culture-front-content h3 {
    min-width: 0;
    margin: 0;
    font-size: 31px;
    letter-spacing: -1px;
  }
  .culture-front-sub {
    grid-column: 1 / -1;
    max-width: none;
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid rgba(255,255,255,.16);
    color: rgba(255,255,255,.82);
    font-size: 12.5px;
    line-height: 1.45;
  }
  .culture-reveal-cue {
    display: inline-flex !important;
    align-items: center;
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: 9px;
    color: rgba(255,255,255,.66);
    font-size: 0;
    font-weight: 850;
    letter-spacing: .02em;
  }
  .culture-reveal-cue::before {
    content: "揭晓答案 ↗";
    font-size: 10px;
  }
  .culture-reveal-cue > span { display: none; }
}
.culture-back { background: #fff; }
.culture-back-main { display: grid; grid-template-rows: minmax(168px, 40%) 1fr; height: 100%; }
.culture-back-title-row {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 58px 20px 20px;
  background:
    linear-gradient(180deg, rgba(25,20,34,.12), rgba(25,20,34,.86)),
    var(--culture-back-image, linear-gradient(135deg, #9b6cff, #62d6aa));
  background-position: center;
  background-size: cover;
  color: #fff;
}
.culture-back-title-copy { min-width: 0; flex: 1; }
.culture-back-title-copy h3 {
  --culture-back-title-base: var(--culture-back-title-size, 26px);
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: var(--culture-back-title-size, 26px);
  font-weight: 950;
  line-height: 1.08;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.culture-counterpart { margin-top: 6px; color: rgba(255,255,255,.84); font-size: 13px; font-weight: 800; }
.culture-back-subtheme-tag { left: 18px; right: auto; }
.culture-info-block {
  min-width: 0;
  max-width: 100%;
  padding: 22px;
  overflow-x: hidden;
  overflow-y: auto;
}
.culture-info-text {
  width: 100%;
  max-width: 100%;
  margin: 0;
  color: #504a59;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.culture-info-text.is-long { font-size: 13px; line-height: 1.62; }
.culture-info-text.is-very-long { font-size: 12px; line-height: 1.55; }

/* Desktop swipe stage is intentionally hidden */
.swipe-stage { display: none; }

/* Quiz */
.quiz-panel {
  position: relative;
  display: block;
  font-family: inherit;
  min-height: 0;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.94);
  border-radius: var(--radius-lg);
  background: #17131f;
  box-shadow: var(--shadow-lg);
  transition: opacity .14s ease, transform .14s ease;
}
.quiz-panel::before,
.quiz-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.quiz-panel::before {
  inset: -12px;
  z-index: 0;
  background: var(--quiz-panel-scene-image, linear-gradient(135deg, #9b6cff, #62d6aa)) center / cover no-repeat;
  filter: blur(4.2px) saturate(.76) brightness(.78);
  transform: scale(1.025);
}
.quiz-panel::after {
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(18,14,25,.16) 8%, rgba(18,14,25,.40) 54%, rgba(18,14,25,.76) 100%);
}
.quiz-panel > * { position: relative; z-index: 1; }
.quiz-panel.is-changing { opacity: .65; transform: scale(.995); }
.quiz-scene-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 300px;
  padding: 30px 0 182px;
  background: transparent;
  color: #fff;
}
.quiz-scene-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 88% 82% at 34% 42%, rgba(12,9,18,.52) 0%, rgba(12,9,18,.34) 38%, rgba(12,9,18,.13) 66%, transparent 86%);
  pointer-events: none;
}
.quiz-scene-content { position: relative; z-index: 1; width: min(calc(100% - 96px), 860px); margin: 0 auto; padding: 0 32px; }
.quiz-scene-content::before {
  content: attr(data-subtheme);
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.30);
  border-radius: 999px;
  background: rgba(28,23,37,.32);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.quiz-scene-title { margin: 0; }
.quiz-scene-subtitle { width: 100%; max-width: 100%; margin: 0 0 8px; overflow: hidden; font-size: 28px; font-weight: 750; line-height: 1.25; letter-spacing: -.3px; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 2px 14px rgba(0,0,0,.34); }
.quiz-context-english { color: #fff; }
.quiz-prompt-row { display: flex; align-items: center; gap: 8px; }
.quiz-prompt-emoji { flex: 0 0 auto; font-size: 16px; line-height: 1; filter: saturate(.78); }
.quiz-question { max-width: 760px; margin: 0; overflow: hidden; color: rgba(255,255,255,.74); font-size: 13px; font-weight: 600; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.quiz-swipe-hint { display: none; }
.quiz-body {
  width: min(calc(100% - 96px), 860px);
  margin: -152px auto 0;
  padding: 32px 32px 40px;
  border: 1px solid rgba(255,255,255,.30);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(255,255,255,.32), rgba(255,255,255,.20));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42), 0 18px 42px rgba(14,9,23,.14);
  -webkit-backdrop-filter: blur(22px) saturate(1.10);
  backdrop-filter: blur(22px) saturate(1.10);
}
.quiz-answer-heading { margin: 0 0 24px; color: #fff; font-size: clamp(19px, 1.7vw, 22px); font-weight: 750; letter-spacing: -.2px; text-shadow: 0 2px 12px rgba(12,8,20,.42); }
.answer-grid { display: grid; grid-template-columns: 1fr; align-content: start; gap: 20px; }
.answer-item { min-width: 0; }
.answer-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 76px;
  padding: 14px 18px;
  border: 2px solid #e4dfea;
  border-radius: 19px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,244,251,.94));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.92), 0 7px 0 #c9c0d3, 0 14px 24px rgba(46,34,68,.13);
  text-align: left;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
  transform: translateY(0);
  transition: transform .18s cubic-bezier(.2,.8,.3,1), opacity .2s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.answer-btn:hover {
  border-color: #bba3f3;
  background: #fff;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.96), 0 9px 0 #8f69df, 0 18px 28px rgba(104,70,176,.20);
  transform: translateY(-3px);
}
.answer-btn:active { transform: translateY(6px); box-shadow: inset 0 1px 0 rgba(255,255,255,.84), 0 1px 0 #9e7be9, 0 4px 8px rgba(104,70,176,.10); }
.answer-btn-label {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 2px solid #d8c9fb;
  border-radius: 13px;
  background: linear-gradient(180deg, #f7f2ff, #ede4ff);
  box-shadow: inset 0 1px 0 #fff, 0 4px 0 #cbb8f5, 0 7px 12px rgba(101,71,166,.12);
  color: var(--purple-dark);
  font-size: 16px;
  font-weight: 900;
}
.answer-copy { display: flex; flex: 1; flex-direction: column; align-items: flex-start; min-width: 0; text-align: left; }
.answer-btn-text { display: block; width: 100%; font-weight: 750; line-height: 1.35; }
.answer-btn.correct, .answer-btn.wrong { align-items: flex-start; }
.answer-btn.correct {
  border-color: #42be91;
  background: linear-gradient(180deg, #f5fffb, #eafaf3);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.90), 0 8px 0 #279b73, 0 0 0 4px rgba(98,214,170,.18), 0 16px 28px rgba(47,174,131,.20);
  animation: answer-correct-pop .46s cubic-bezier(.2,.85,.3,1.25) both;
}
.answer-btn.correct .answer-btn-label { border-color: #42be91; background: var(--mint); box-shadow: inset 0 1px 0 rgba(255,255,255,.62), 0 4px 0 #279b73; color: #164f3b; animation: answer-label-pop .48s cubic-bezier(.2,.9,.25,1.35) both; }
.answer-btn.wrong {
  border-color: #ef7e88;
  background: linear-gradient(180deg, #fff7f7, #ffebed);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.88), 0 8px 0 #cc4e5a, 0 0 0 4px rgba(239,107,118,.16), 0 16px 26px rgba(196,70,82,.18);
  animation: answer-wrong-shake .42s ease both;
}
.answer-btn.wrong .answer-btn-label { border-color: #ef7e88; background: #f7a0a7; box-shadow: inset 0 1px 0 rgba(255,255,255,.56), 0 4px 0 #cc4e5a; color: #722c32; animation: answer-label-pop .42s cubic-bezier(.2,.9,.25,1.35) both; }
.answer-grid:has(.answer-btn.correct, .answer-btn.wrong) .answer-btn:not(.correct):not(.wrong) { opacity: .58; transform: scale(.985); }
@keyframes answer-correct-pop {
  0% { transform: scale(.97); }
  48% { transform: translateY(-4px) scale(1.018); }
  100% { transform: translateY(-1px) scale(1); }
}
@keyframes answer-wrong-shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-8px); }
  44% { transform: translateX(7px); }
  64% { transform: translateX(-4px); }
  82% { transform: translateX(2px); }
}
@keyframes answer-label-pop {
  0% { transform: scale(.72) rotate(-8deg); }
  55% { transform: scale(1.18) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}
.answer-feedback-slot:empty { display: none; }
.answer-feedback-slot:not(:empty) { display: block; width: 100%; }
.answer-feedback-inline { width: 100%; margin-top: 8px; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: left; transform-origin: top left; animation: answer-feedback-reveal .34s .08s cubic-bezier(.2,.75,.25,1) both; }
.answer-feedback-inline.correct { color: #26795d; background: transparent; }
.answer-feedback-inline.wrong { color: #a4444c; background: transparent; }
.feedback-line { display: flex; align-items: flex-start; gap: 8px; width: 100%; margin: 0; overflow: hidden; color: inherit; font-size: 11.5px; font-weight: 600; line-height: 1.45; white-space: nowrap; }
.feedback-mark { position: static; flex: 0 0 auto; width: auto; margin-top: -1px; text-align: left; font-size: 14px; line-height: 1.35; }
.feedback-copy { display: block; flex: 1 1 auto; width: auto; min-width: 0; overflow-wrap: normal; text-align: left; white-space: nowrap; }
@keyframes answer-feedback-reveal {
  from { opacity: 0; transform: translateY(-7px) scaleY(.82); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}
.quiz-feedback { display: none; }
.quiz-nav-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(calc(100% - 96px), 860px);
  margin: 16px auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.quiz-arrow-btn, .next-btn {
  display: grid;
  place-items: center;
  width: auto;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(255,255,255,.64);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.next-btn { border: 0; background: transparent; color: rgba(255,255,255,.76); }
.quiz-arrow-btn:hover, .next-btn:hover { background: transparent; color: #fff; }
.quiz-arrow-btn:active, .next-btn:active { transform: translateY(2px); }

.empty-state { grid-column: 1 / -1; padding: 60px 24px; color: var(--muted); text-align: center; font-weight: 800; }
.foot-section {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 14px 20px 30px;
  text-align: center;
}
.foot-section a {
  color: #9d97a5;
  font-size: 12px;
  text-decoration: none;
}
.foot-section a:hover { color: #746f7f; }
.public-security-registration { display: inline-flex; align-items: center; gap: 5px; }
.public-security-registration img { display: block; width: 18px; height: 20px; object-fit: contain; }

/* Compact desktop */
@media (max-width: 1180px) and (min-width: 901px) {
  .top-nav { grid-template-columns: auto 1fr; }
  .brand-copy { display: none; }
  .top-tabs { grid-column: 2; justify-self: end; }
  .tab { padding-inline: 14px; }
  .expression-grid, .culture-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Full-screen mobile / narrow desktop preview */
@media (max-width: 900px) {
  :root { --mobile-top: 74px; --mobile-bottom: 20px; }
  html, body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
  body { background: #17131f; }
  .app-shell { width: 100%; height: 100dvh; margin: 0; }

  .top-nav {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    pointer-events: none;
  }
  .brand-logo {
    position: absolute;
    top: max(11px, calc(env(safe-area-inset-top) + 2px));
    left: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 5px;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 50%;
    background: rgba(22,18,29,.56);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.16);
    backdrop-filter: blur(18px) saturate(1.25);
    pointer-events: auto;
  }
  .brand-mark { width: 34px; height: 34px; }
  .brand-copy { display: none; }

  .top-tabs {
    position: absolute;
    top: max(11px, calc(env(safe-area-inset-top) + 2px));
    right: 66px;
    bottom: auto;
    left: 66px;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 999px;
    background: rgba(22,18,29,.56);
    box-shadow: 0 8px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.14);
    backdrop-filter: blur(18px) saturate(1.25);
    pointer-events: auto;
  }
  .tab { min-width: 0; min-height: 38px; padding: 3px 5px; border-radius: 999px; color: rgba(255,255,255,.66); box-shadow: none; gap: 4px; }
  .tab:hover { color: #fff; background: rgba(255,255,255,.08); }
  .tab.active { color: #3f3155; background: rgba(255,255,255,.94); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
  .tab.active .tab-icon { color: #8059d5; }
  .tab-icon { width: 17px; height: 17px; }
  .tab-label-full { display: none; }
  .tab-label-mobile { display: inline; font-size: 11px; font-weight: 900; }

  .home-card, .main-page, .main-page.active { width: 100%; height: 100dvh; margin: 0; }
  .main-page.active { animation: none; }
  .filter-panel {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: calc(var(--mobile-bottom) + 22px + env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    z-index: 90;
    display: none;
    max-height: min(58dvh, 470px);
    margin: 0;
    padding: 12px 8px 10px;
    border: 1px solid rgba(255,255,255,.52);
    border-radius: 28px;
    background: rgba(247,244,251,.94);
    box-shadow: 0 22px 60px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.8);
    overflow-x: hidden;
    overflow-y: auto;
    backdrop-filter: blur(28px) saturate(1.35);
  }
  .filter-panel.open { display: block; animation: filter-in .18s ease both; }
  .filter-panel::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    margin: 0 auto 9px;
    border-radius: 999px;
    background: rgba(56,47,67,.18);
  }
  @keyframes filter-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
  .library-row { min-height: 0; padding: 7px 8px; }
  .chip-scroll { overflow: visible; }
  .chip-wrap {
    flex-wrap: wrap;
    justify-content: flex-start;
    width: auto;
    min-width: 0;
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  .chip {
    min-height: 42px;
    padding-inline: 14px;
    border: 1px solid rgba(69,58,82,.10);
    border-radius: 14px;
    background: rgba(255,255,255,.72);
    color: #665f6f;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(39,31,48,.05);
  }
  .chip:hover { color: var(--purple-dark); background: #fff; }
  .chip.active-chip { border-color: transparent; background: linear-gradient(135deg, #8f64ee, #63d2ad); color: #fff; box-shadow: 0 7px 18px rgba(102,72,172,.22); }
  .mobile-filter-toggle {
    position: fixed;
    top: max(11px, calc(env(safe-area-inset-top) + 2px));
    right: 12px;
    z-index: 85;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 999px;
    background: rgba(22,18,29,.56);
    color: #fff;
    font-size: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.14);
    backdrop-filter: blur(18px) saturate(1.25);
  }
  .mobile-filter-toggle::before,
  .mobile-filter-toggle::after {
    content: "";
    position: absolute;
    width: 17px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .18s ease, box-shadow .18s ease;
  }
  .mobile-filter-toggle::before { box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
  .mobile-filter-toggle::after { opacity: 0; }
  .mobile-filter-toggle:has(+ .filter-panel.open) { background: rgba(255,255,255,.94); color: #4d3b68; border-color: rgba(255,255,255,.7); }
  .mobile-filter-toggle:has(+ .filter-panel.open)::before { box-shadow: none; transform: rotate(45deg); }
  .mobile-filter-toggle:has(+ .filter-panel.open)::after { opacity: 1; transform: rotate(-45deg); }

  .content-panel { width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .section-label { display: none; }
  .view-switch { gap: 0; }
  .view-switch-label { display: none; }
  .view-switch-track { width: 62px; height: 42px; border: 1px solid rgba(255,255,255,.30); border-radius: 15px; background: rgba(25,20,34,.62); backdrop-filter: blur(16px); }
  .view-switch-track::before { content: "中   EN"; position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 950; letter-spacing: .4px; pointer-events: none; }
  .view-switch-thumb { top: 5px; left: 4px; width: 27px; height: 30px; border-radius: 11px; background: linear-gradient(135deg, rgba(155,108,255,.96), rgba(98,214,170,.92)); box-shadow: 0 2px 8px rgba(0,0,0,.28); }
  .view-switch:has(.view-switch-label:last-child.active) .view-switch-thumb { transform: translateX(25px); }

  .expression-grid, .culture-grid { display: none; }
  .swipe-stage, .culture-swipe-stage { display: block; width: 100%; height: 100%; }
  .swipe-shell, .swipe-card-row { width: 100%; height: 100%; }
  .swipe-card-row { position: relative; }
  .swipe-card, .culture-swipe-card { width: 100%; height: 100dvh; cursor: grab; touch-action: none; user-select: none; }
  .culture-swipe-card:hover { transform: none; filter: none; }
  .swipe-card.is-dragging, .culture-swipe-card.is-dragging { cursor: grabbing; }
  .swipe-card-inner, .culture-swipe-card > .culture-card-inner { width: 100%; height: 100%; }
  .swipe-card-inner,
  .culture-swipe-card > .culture-card-inner {
    transform: none !important;
    transform-style: flat;
    transition: none;
  }
  .swipe-face, .culture-swipe-card .culture-face {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
  }
  .swipe-front, .culture-swipe-card .culture-front {
    z-index: 1;
    transition: transform .52s cubic-bezier(.2,.8,.2,1), filter .52s ease;
  }
  .swipe-back, .culture-swipe-card .culture-back {
    top: 56%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(calc(100% - 64px), 292px);
    height: 82px;
    z-index: 3;
    opacity: 0;
    transform: translate(-50%,-42%) scale(.9);
    border: 1px dashed rgba(255,255,255,.78);
    border-radius: 20px;
    box-shadow: 0 16px 42px rgba(13,9,19,.30), inset 0 1px 0 rgba(255,255,255,.78);
    pointer-events: none;
    transition: opacity .28s ease, transform .42s cubic-bezier(.18,.82,.22,1), height .28s ease;
    will-change: transform;
  }
  .swipe-card.flipped .swipe-front,
  .culture-swipe-card.flipped .culture-front { transform: scale(.975); filter: brightness(.72) saturate(.82); }
  .swipe-card.flipped .swipe-back,
  .culture-swipe-card.flipped .culture-back {
    height: clamp(320px, 60dvh, 430px);
    max-height: calc(100dvh - 112px);
    opacity: 1;
    transform: translate(-50%,-50%) scale(1);
    border-radius: 18px;
    pointer-events: auto;
    transition: opacity .28s ease, transform .42s cubic-bezier(.18,.82,.22,1), height .48s cubic-bezier(.2,.8,.2,1);
  }
  .swipe-front, .culture-swipe-card .culture-front { padding: calc(var(--mobile-top) + 28px) 23px calc(var(--mobile-bottom) + 42px); }
  .swipe-front::after, .culture-swipe-card .culture-front::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13,10,18,.40), transparent 22%, rgba(13,10,18,.08) 48%, rgba(13,10,18,.72) 100%);
    pointer-events: none;
  }
  .expression-front-copy, .culture-front-content { z-index: 2; }
  .swipe-front .expression-front-copy {
    position: absolute;
    inset: 0 24px;
    display: flex;
    max-width: none;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .swipe-front .expression-front-kicker { display: none; }
  .swipe-front .expression-prompt-row {
    position: absolute;
    top: 50%;
    left: 0;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    transform: translateY(-112px);
  }
  .swipe-front .swipe-meaning { width: 100%; text-align: center; text-wrap: balance; }
  .expression-front-scene, .expression-back-scene, .expression-tag, .culture-front-tag, .culture-back-subtheme-tag { top: max(76px, calc(env(safe-area-inset-top) + 66px)); right: 18px; }
  .culture-back-subtheme-tag { right: auto; left: 18px; }
  .swipe-front .expression-front-copy { max-width: none; }
  .swipe-meaning, .culture-front-content h3 { font-size: clamp(34px, 10vw, 54px); white-space: normal; overflow: visible; text-overflow: clip; }
  .swipe-front .swipe-meaning { font-size: clamp(34px, 9.4vw, 48px); text-shadow: 0 2px 18px rgba(0,0,0,.38); }
  .swipe-front .expression-prompt-row { gap: 12px; }
  .swipe-front .expression-front-emoji { width: 44px; height: 44px; border-radius: 14px; font-size: 22px; box-shadow: 0 5px 16px rgba(20,15,28,.24); }
  .expression-front-kicker { margin: 0; font-size: 0; }
  .expression-front-kicker::after { font-size: 12px; }
  .swipe-front .expression-flip-cue {
    position: absolute;
    top: 56%;
    right: auto;
    left: 50%;
    width: min(calc(100% - 16px), 292px);
    height: 82px;
    min-height: 82px;
    margin: 0;
    padding: 12px 18px;
    justify-content: center;
    border-radius: 18px;
    transform: translate(-50%,-50%);
    transition: opacity .2s ease, transform .28s ease;
    font-size: 0;
  }
  .swipe-front .expression-flip-cue::before { content: "用英文怎么说"; font-size: 12px; }
  .swipe-front .expression-flip-cue > span { font-size: 12px; }
  .expression-flip-cue > span, .culture-reveal-cue > span { display: inline-block; animation: reveal-cue 1.5s ease-in-out infinite; }
  .swipe-front .expression-flip-cue,
  .culture-reveal-cue {
    position: absolute;
    top: 56%;
    right: auto;
    left: 50%;
    overflow: hidden;
    border: 1px dashed rgba(255,255,255,.74);
    background:
      linear-gradient(115deg, transparent 22%, rgba(255,255,255,.38) 38%, transparent 54%) 0 0 / 220% 100%,
      repeating-linear-gradient(135deg, rgba(190,176,207,.90) 0 8px, rgba(226,218,234,.94) 8px 16px);
    color: #352d40;
    box-shadow: 0 8px 24px rgba(15,10,21,.24), inset 0 1px 0 rgba(255,255,255,.76);
    text-shadow: 0 1px 0 rgba(255,255,255,.58);
    animation: ticket-shimmer 2.8s linear infinite;
  }
  .culture-reveal-cue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: min(calc(100% - 16px), 292px);
    height: 82px;
    min-height: 82px;
    margin: 0;
    padding: 9px 13px;
    justify-content: center;
    border-radius: 20px;
    transform: translate(-50%,-50%);
    transition: opacity .2s ease, transform .28s ease;
    font-size: 11px;
    font-weight: 850;
    backdrop-filter: blur(12px);
  }
  @keyframes reveal-cue { 50% { transform: translateY(-3px); } }
  @keyframes ticket-shimmer { to { background-position: -220% 0, 0 0; } }
  .swipe-card.flipped .expression-flip-cue,
  .culture-swipe-card.flipped .culture-reveal-cue { opacity: 0; transform: translate(-50%,-50%) scale(.92); }
  .swipe-card.inline-revealed .expression-flip-cue,
  .culture-swipe-card.inline-revealed .culture-reveal-cue {
    opacity: 1;
    transform: translate(-50%,-50%) scale(1);
  }
  .swipe-card.inline-revealed.flipped .swipe-front,
  .culture-swipe-card.inline-revealed.flipped .culture-front { transform: none; filter: none; }
  .swipe-card.inline-revealed .swipe-meaning,
  .culture-swipe-card.inline-revealed .culture-front-content h3 { opacity: 1; visibility: visible; }
  .culture-swipe-card .culture-reveal-cue { display: inline-flex !important; }
  .swipe-card.inline-revealed .expression-flip-cue::before,
  .culture-swipe-card.inline-revealed .culture-reveal-cue::before {
    content: attr(data-answer);
    font-size: clamp(22px, 6.6vw, 30px);
    font-weight: 950;
    line-height: 1.1;
  }
  .swipe-card.inline-revealed .expression-flip-cue > span,
  .culture-swipe-card.inline-revealed .culture-reveal-cue > span { display: none; }
  .swipe-card.inline-revealed.flipped .swipe-back,
  .culture-swipe-card.inline-revealed.flipped .culture-back {
    top: calc(56% + 48px);
    height: min(30dvh, 250px);
    opacity: 0;
    transform: translateX(-50%);
    animation: delayed-details-shell .3s 2s ease forwards;
  }
  .swipe-card.inline-revealed .swipe-back-hero,
  .culture-swipe-card.inline-revealed .culture-back-title-row { display: none; }
  .swipe-card.inline-revealed .swipe-back-content,
  .culture-swipe-card.inline-revealed .culture-info-block { top: 0; }
  @keyframes delayed-details-shell { to { opacity: 1; } }
  .swipe-card.is-counting::after,
  .culture-swipe-card.is-counting::after {
    content: attr(data-countdown);
    position: absolute;
    top: calc(56% - 80px);
    left: 50%;
    z-index: 12;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 999px;
    background: rgba(24,18,32,.72);
    color: #fff;
    box-shadow: 0 10px 30px rgba(13,9,19,.28), inset 0 1px 0 rgba(255,255,255,.18);
    font-size: 30px;
    font-weight: 950;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,.34);
    backdrop-filter: blur(12px);
    transform: translate(-50%,-50%);
    animation: countdown-pop 1s cubic-bezier(.16,.82,.24,1) infinite;
    pointer-events: none;
  }
  @keyframes countdown-pop {
    0% { opacity: 0; transform: translate(-50%,-50%) scale(.72); }
    22%,72% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%,-50%) scale(1.08); }
  }
  .swipe-front .expression-prompt-row { transition: opacity .2s ease, transform .28s ease; }
  .swipe-card.flipped:not(.inline-revealed) .swipe-front .expression-prompt-row {
    opacity: 0;
    transform: translateY(-112px) scale(.96);
  }
  .swipe-card.inline-revealed .swipe-front .expression-prompt-row {
    opacity: 1;
    transform: translateY(-112px);
  }
  .culture-front-sub { font-size: 14px; }

  .swipe-back { grid-template-rows: 42% 58%; padding: 0; background: #f7f4fb; }
  .swipe-back { display: block; background: transparent; }
  .swipe-back-hero {
    height: 82px;
    padding: 15px 18px;
    border-radius: 17px;
    background:
      linear-gradient(115deg, transparent 22%, rgba(255,255,255,.38) 38%, transparent 54%) 0 0 / 220% 100%,
      repeating-linear-gradient(135deg, #bfb2cd 0 8px, #e5ddeb 8px 16px);
    color: #332a3e;
    animation: ticket-shimmer 2.8s linear infinite;
  }
  .swipe-title-row { align-items: center; }
  .swipe-title-copy { text-align: center; }
  .swipe-title-copy h3 { color: #332a3e; font-size: var(--expression-title-fit, clamp(25px, 7vw, 34px)); text-shadow: 0 1px 0 rgba(255,255,255,.6); }
  .swipe-front .expression-front-emoji,
  .culture-swipe-card .culture-front-content > .culture-emoji,
  .swipe-back .emoji-badge,
  .swipe-back .expression-counterpart-emoji { display: none !important; }
  .swipe-back .expression-back-scene,
  .swipe-back .swipe-pronunciation,
  .swipe-back .sound-btn { display: none; }
  .swipe-back .expression-back-counterpart {
    display: block;
    margin-top: 5px;
    color: rgba(51,42,62,.76);
    font-size: 13px;
    font-weight: 850;
    text-shadow: 0 1px 0 rgba(255,255,255,.58);
  }
  .swipe-back-content {
    position: absolute;
    top: 82px;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    padding: 20px 18px;
    overflow: auto;
    border-radius: 0 0 17px 17px;
    background: rgba(255,255,255,.97);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .18s ease, transform .18s ease;
  }
  .swipe-card.flipped .swipe-back-content {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .3s .08s ease, transform .3s .08s ease;
  }
  .swipe-back-content .expression-meaning { font-size: 14px; line-height: 1.55; }
  .swipe-back-content .expression-example { margin-top: 10px; padding: 11px 12px; font-size: 13px; }
  .swipe-back-content { z-index: 2; overscroll-behavior: contain; }
  .swipe-back-content .expression-meaning { color: #4f4858; font-size: 16px; line-height: 1.65; }
  .swipe-back-content .expression-example { margin-top: 12px; }

  .culture-swipe-card .culture-back { background: #fff; }
  .culture-swipe-card .culture-back-main { display: block; height: 100%; }
  .culture-swipe-card .culture-back-title-row {
    height: 82px;
    padding: 15px 18px;
    border-radius: 17px;
    background:
      linear-gradient(115deg, transparent 22%, rgba(255,255,255,.38) 38%, transparent 54%) 0 0 / 220% 100%,
      repeating-linear-gradient(135deg, #bfb2cd 0 8px, #e5ddeb 8px 16px);
    color: #332a3e;
    animation: ticket-shimmer 2.8s linear infinite;
  }
  .culture-swipe-card .culture-back-title-copy { text-align: center; }
  .culture-swipe-card .culture-back-title-copy h3 { color: #332a3e; font-size: var(--culture-back-title-size, clamp(25px, 7vw, 34px)); white-space: normal; overflow-wrap: anywhere; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
  .culture-swipe-card .culture-back .culture-emoji { display: none !important; }
  .swipe-card.flipped .swipe-back::before,
  .culture-swipe-card.flipped .culture-back::before,
  .swipe-card.flipped .swipe-back::after,
  .culture-swipe-card.flipped .culture-back::after {
    position: absolute;
    z-index: 8;
    pointer-events: none;
    white-space: nowrap;
    filter: drop-shadow(0 5px 8px rgba(20,14,28,.24));
  }
  .swipe-card.flipped .swipe-back::before,
  .culture-swipe-card.flipped .culture-back::before {
    content: "✨  🎉  💫";
    top: 38%;
    left: 50%;
    font-size: 25px;
    animation: emoji-burst-left .72s cubic-bezier(.16,.8,.25,1.2) both;
  }
  .swipe-card.flipped .swipe-back::after,
  .culture-swipe-card.flipped .culture-back::after {
    content: "⭐  🥳  ✨";
    top: 42%;
    left: 50%;
    font-size: 22px;
    animation: emoji-burst-right .76s .04s cubic-bezier(.16,.8,.25,1.2) both;
  }
  @keyframes emoji-burst-left {
    0% { opacity: 0; transform: translate(-50%,-20%) scale(.3); }
    48% { opacity: 1; }
    100% { opacity: 0; transform: translate(-118%,-210%) rotate(-12deg) scale(1.08); }
  }
  @keyframes emoji-burst-right {
    0% { opacity: 0; transform: translate(-50%,-20%) scale(.3); }
    48% { opacity: 1; }
    100% { opacity: 0; transform: translate(18%,-190%) rotate(11deg) scale(1.06); }
  }
  .culture-swipe-card .culture-back-subtheme-tag,
  .culture-swipe-card .culture-sound-btn { display: none; }
  .culture-swipe-card .culture-info-block {
    position: absolute;
    top: 82px;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    padding: 20px 18px;
    overflow: auto;
    border-radius: 0 0 17px 17px;
    background: rgba(255,255,255,.97);
    opacity: 0;
    transform: translateY(12px);
    overscroll-behavior: contain;
    transition: opacity .18s ease, transform .18s ease;
  }
  .culture-swipe-card.flipped .culture-info-block {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .3s 2.3s ease, transform .3s 2.3s ease;
  }
  .culture-swipe-card .culture-info-text { color: #50485a; font-size: 14px; line-height: 1.65; }
  .culture-swipe-card .culture-info-text.is-long { font-size: 12.5px; line-height: 1.58; }
  .culture-swipe-card .culture-info-text.is-very-long { font-size: 11.5px; line-height: 1.5; }
  .culture-swipe-card .culture-front-content h3 {
    display: block;
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    margin: 0;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 18px rgba(0,0,0,.42);
    transform: translateY(-92px);
  }
  .culture-swipe-card .culture-front-content {
    position: absolute;
    inset: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .culture-swipe-card .culture-front-content > .culture-emoji { transform: translateY(-88px); }
  .culture-swipe-card .culture-front-sub { display: none; }
  .culture-swipe-card .culture-back-title-copy h3 { display: none; }
  .culture-swipe-card .culture-counterpart {
    display: block;
    margin: 0;
    color: #332a3e;
    font-size: clamp(24px, 6.8vw, 32px);
    font-weight: 950;
    line-height: 1.15;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255,255,255,.6);
  }

  .swipe-control-btn { display: none; }
  .mobile-swipe-hint,
  .quiz-swipe-hint {
    display: block;
    position: fixed;
    right: 0;
    bottom: calc(var(--mobile-bottom) + 13px + env(safe-area-inset-bottom));
    left: 0;
    z-index: 20;
    color: rgba(255,255,255,.68);
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    pointer-events: none;
    animation: hint-float 2.2s ease-in-out infinite;
  }
  .swipe-card.flipped ~ .mobile-swipe-hint { color: #81798c; }
  .quiz-swipe-hint { color: #81798c; }
  @keyframes hint-float { 50% { transform: translateY(-4px); } }
  @keyframes mobile-enter-next { from { opacity: .4; transform: translateY(55px) scale(.98); } }
  @keyframes mobile-enter-prev { from { opacity: .4; transform: translateY(-55px) scale(.98); } }
  .mobile-card-enter-next { animation: mobile-enter-next .26s ease both; }
  .mobile-card-enter-prev { animation: mobile-enter-prev .26s ease both; }

  /* Mobile uses the same direct front/back card model as desktop. */
  .swipe-card-inner,
  .culture-swipe-card > .culture-card-inner {
    transform-style: preserve-3d;
    transition: transform .58s cubic-bezier(.2,.76,.2,1);
  }
  .swipe-card.flipped .swipe-card-inner,
  .culture-swipe-card.flipped > .culture-card-inner { transform: rotateY(180deg) !important; }
  .swipe-face,
  .culture-swipe-card .culture-face {
    position: absolute;
    inset: 0;
    height: 100%;
    opacity: 1;
    border-radius: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    animation: none !important;
  }
  .swipe-front,
  .culture-swipe-card .culture-front { z-index: 1; transform: none !important; filter: none !important; }
  .swipe-back,
  .culture-swipe-card .culture-back,
  .swipe-card.flipped .swipe-back,
  .culture-swipe-card.flipped .culture-back {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: 100%;
    opacity: 1;
    transform: rotateY(180deg) !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    pointer-events: auto;
    animation: none !important;
  }
  .swipe-card.flipped .swipe-back::before,
  .swipe-card.flipped .swipe-back::after,
  .culture-swipe-card.flipped .culture-back::before,
  .culture-swipe-card.flipped .culture-back::after { content: none !important; animation: none !important; }
  .swipe-front .expression-front-copy {
    position: relative;
    inset: auto;
    display: flex;
    max-width: 340px;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
  }
  .swipe-front .expression-prompt-row {
    position: static;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    opacity: 1 !important;
    transform: none !important;
  }
  .swipe-front .expression-front-emoji,
  .culture-swipe-card .culture-front-content > .culture-emoji,
  .swipe-back .emoji-badge,
  .culture-swipe-card .culture-back .culture-emoji { display: inline-grid !important; }
  .swipe-front .swipe-meaning { text-align: left; }
  .swipe-front .expression-flip-cue {
    position: static;
    width: auto;
    height: auto;
    min-height: 38px;
    margin-top: 18px;
    padding: 9px 13px;
    opacity: 1 !important;
    border: 1px solid rgba(255,255,255,.34);
    border-radius: 999px;
    background: rgba(24,19,32,.48);
    color: #fff;
    box-shadow: none;
    font-size: 0;
    text-shadow: none;
    transform: none !important;
    animation: none;
  }
  .swipe-front .expression-flip-cue::before { content: "点击翻面"; color: #fff; font-size: 12px; }
  .swipe-front .expression-flip-cue > span { display: inline !important; color: #fff; font-size: 12px; animation: none; }
  .culture-swipe-card .culture-front-content {
    position: relative;
    inset: auto;
    display: block;
    text-align: left;
  }
  .culture-swipe-card .culture-front-content h3 {
    position: static;
    display: block;
    width: auto;
    margin: 14px 0 7px;
    text-align: left;
    transform: none;
  }
  .culture-swipe-card .culture-front-sub { display: block; }
  .culture-swipe-card .culture-reveal-cue { display: none !important; }
  .swipe-back {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    background:
      linear-gradient(180deg, rgba(20,15,28,.08), rgba(20,15,28,.46)),
      var(--expression-scene-image, linear-gradient(135deg, #9b6cff, #62d6aa)) center / cover no-repeat !important;
  }
  .swipe-back-hero {
    display: flex !important;
    height: auto;
    padding: calc(var(--mobile-top) + 34px) 22px 27px;
    border-radius: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(31,24,42,.10) 52%, rgba(31,24,42,.52) 100%) !important;
    background-position: center !important;
    background-size: cover !important;
    color: #fff;
    animation: none;
  }
  .swipe-back .expression-back-scene,
  .swipe-back .expression-back-counterpart,
  .swipe-back .swipe-pronunciation,
  .swipe-back .sound-btn { display: initial; }
  .swipe-back .expression-back-counterpart { display: block; }
  .swipe-back .sound-btn { display: grid; }
  .swipe-back-content {
    position: relative;
    inset: auto;
    display: flex;
    padding: 27px 22px calc(var(--mobile-bottom) + 38px);
    overflow: auto;
    border-radius: 26px 26px 0 0;
    background: rgba(25,20,34,.76);
    color: #fff;
    box-shadow: 0 -12px 34px rgba(8,5,12,.18), inset 0 1px 0 rgba(255,255,255,.16);
    -webkit-backdrop-filter: blur(20px) saturate(1.08);
    backdrop-filter: blur(20px) saturate(1.08);
    opacity: 1;
    transform: none;
    transition: none;
    max-height: 46dvh;
  }
  .culture-swipe-card .culture-back {
    background:
      linear-gradient(180deg, rgba(20,15,28,.08), rgba(20,15,28,.46)),
      var(--culture-back-image, linear-gradient(135deg, #9b6cff, #62d6aa)) center / cover no-repeat !important;
  }
  .culture-swipe-card .culture-back-main { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; }
  .culture-swipe-card .culture-back-title-row {
    display: flex !important;
    height: auto;
    padding: calc(var(--mobile-top) + 34px) 22px 27px;
    border-radius: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(25,20,34,.10) 52%, rgba(25,20,34,.52) 100%) !important;
    background-position: center !important;
    background-size: cover !important;
    color: #fff;
    animation: none;
  }
  .culture-swipe-card .culture-back-title-copy h3,
  .culture-swipe-card .culture-counterpart,
  .culture-swipe-card .culture-sound-btn,
  .culture-swipe-card .culture-info-block { display: block; }
  .culture-swipe-card .culture-sound-btn { display: grid; }
  .culture-swipe-card .culture-info-block {
    position: relative;
    inset: auto;
    padding: 25px 22px calc(var(--mobile-bottom) + 28px);
    overflow: auto;
    border-radius: 0;
    background: rgba(25,20,34,.76);
    color: #fff;
    box-shadow: 0 -12px 34px rgba(8,5,12,.18), inset 0 1px 0 rgba(255,255,255,.16);
    -webkit-backdrop-filter: blur(20px) saturate(1.08);
    backdrop-filter: blur(20px) saturate(1.08);
    opacity: 1;
    transform: none;
    transition: none;
    max-height: 46dvh;
  }
  .swipe-back-content .expression-meaning,
  .swipe-back-content .expression-example,
  .culture-swipe-card .culture-info-text { color: rgba(255,255,255,.94); }
  .swipe-back-content .expression-example { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.10); }
  .swipe-back .swipe-title-copy h3,
  .swipe-back .expression-back-counterpart,
  .swipe-back .swipe-pronunciation,
  .culture-swipe-card .culture-back-title-copy h3,
  .culture-swipe-card .culture-counterpart { color: #fff !important; text-shadow: 0 2px 14px rgba(0,0,0,.38); }

  /* Final mobile back-face typography and layout. */
  .swipe-back-hero,
  .culture-swipe-card .culture-back-title-row {
    align-items: flex-end !important;
    min-height: 0;
    padding: calc(var(--mobile-top) + 22px) 22px 24px !important;
  }
  .swipe-back .swipe-title-row,
  .culture-swipe-card .culture-back-title-row {
    gap: 12px;
  }
  .swipe-back .swipe-title-copy,
  .culture-swipe-card .culture-back-title-copy {
    min-width: 0;
    text-align: left !important;
  }
  .swipe-back .swipe-title-copy h3,
  .culture-swipe-card .culture-back-title-copy h3 {
    display: block !important;
    margin: 0 !important;
    color: #fff !important;
    font-size: clamp(29px, 8vw, 42px) !important;
    font-weight: 950 !important;
    line-height: 1.05 !important;
    letter-spacing: -.035em !important;
    text-align: left !important;
    text-shadow: 0 3px 18px rgba(0,0,0,.46) !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  .swipe-back .expression-back-counterpart,
  .culture-swipe-card .culture-counterpart {
    display: block !important;
    margin: 7px 0 0 !important;
    color: rgba(255,255,255,.86) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    text-align: left !important;
    text-shadow: 0 2px 12px rgba(0,0,0,.42) !important;
  }
  .swipe-back .swipe-pronunciation {
    margin-top: 5px;
    color: rgba(255,255,255,.68) !important;
    font-size: 12px;
    text-shadow: 0 2px 10px rgba(0,0,0,.38);
  }
  .swipe-back .emoji-badge,
  .culture-swipe-card .culture-back-title-row > .culture-emoji,
  .swipe-back .expression-counterpart-emoji { display: none !important; }
  .swipe-back .sound-btn,
  .culture-swipe-card .culture-sound-btn {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid rgba(255,255,255,.68);
    border-radius: 14px;
    background: rgba(255,255,255,.92);
    color: #4b3a62;
    box-shadow: 0 6px 18px rgba(0,0,0,.20);
  }
  .swipe-back-content,
  .culture-swipe-card .culture-info-block {
    padding: 20px 22px calc(var(--mobile-bottom) + 24px) !important;
    max-height: none;
    background: #f8f7fb !important;
    color: #504a59;
    box-shadow: 0 100vh 0 100vh #f8f7fb, 0 -10px 30px rgba(24,17,34,.14);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    touch-action: none;
    overscroll-behavior: none;
  }
  .swipe-back,
  .culture-swipe-card .culture-back,
  .culture-swipe-card .culture-back-main { touch-action: none; }
  .swipe-card.flipped .swipe-back::before,
  .culture-swipe-card.flipped .culture-back::before {
    content: "" !important;
    position: absolute;
    inset: -3px;
    z-index: 0;
    background-position: center !important;
    background-size: cover !important;
    filter: blur(2.4px) saturate(.94) brightness(.93);
    transform: scale(1.02);
    pointer-events: none;
  }
  .swipe-card.flipped .swipe-back::before {
    background-image: var(--expression-scene-image, linear-gradient(135deg, #9b6cff, #62d6aa)) !important;
  }
  .culture-swipe-card.flipped .culture-back::before {
    background-image: var(--culture-back-image, linear-gradient(135deg, #9b6cff, #62d6aa)) !important;
  }
  .swipe-card.flipped .swipe-back::after,
  .culture-swipe-card.flipped .culture-back::after {
    content: "" !important;
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, rgba(14,10,19,.04) 18%, rgba(14,10,19,.18) 38%, rgba(14,10,19,.72) 62%, rgba(14,10,19,.92) 100%);
    pointer-events: none;
  }
  .swipe-back > *,
  .culture-swipe-card .culture-back > * { position: relative; z-index: 1; }
  .swipe-front::before,
  .culture-swipe-card .culture-front::before {
    content: "";
    position: absolute;
    inset: -3px;
    z-index: 0;
    background-position: center !important;
    background-size: cover !important;
    filter: blur(3.5px) saturate(.94) brightness(.93);
    transform: scale(1.025);
    pointer-events: none;
  }
  .swipe-front::before {
    background-image: var(--expression-scene-image, linear-gradient(140deg, #c6afff, #77dfbd)) !important;
  }
  .culture-swipe-card .culture-front::before {
    background-image: var(--culture-image, linear-gradient(135deg, #a98bff, #62d6aa)) !important;
  }
  .swipe-front > *,
  .culture-swipe-card .culture-front > * { position: relative; z-index: 1; }
  .culture-swipe-card .culture-info-text {
    margin: 0;
    color: #504a59 !important;
    font-size: 15px !important;
    font-weight: 650 !important;
    line-height: 1.68 !important;
    letter-spacing: 0 !important;
    text-shadow: none !important;
  }
  .swipe-back-content .expression-meaning {
    margin: 0;
    padding: 14px 15px !important;
    border: 1px solid rgba(121,91,184,.14) !important;
    border-radius: 16px;
    background: rgba(255,255,255,.92) !important;
    color: #504a59 !important;
    font-size: 14px !important;
    font-weight: 650 !important;
    line-height: 1.58 !important;
    letter-spacing: 0 !important;
    text-shadow: none !important;
    box-shadow: 0 4px 14px rgba(61,45,90,.05);
  }
  .swipe-back-content .expression-example {
    margin: 0 !important;
    padding: 14px 15px !important;
    border: 1px solid rgba(105,205,167,.30) !important;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(246,242,255,.96), rgba(237,251,246,.96)) !important;
    color: #54466f !important;
    font-size: 13.5px !important;
    font-weight: 750 !important;
    line-height: 1.5 !important;
    text-shadow: none !important;
    box-shadow: 0 4px 14px rgba(61,45,90,.05);
  }
  .swipe-back-content .example-context { color: #8b6fd0 !important; }
  .swipe-back-content .example-dialogue-line strong { color: #6e51b0 !important; }

  /* Chrome's dynamic viewport can be shorter than the captured mobile screen,
     which exposed the dark body below the card. Keep the swipe canvas full-height. */
  .app-shell,
  .swipe-stage,
  .culture-swipe-stage,
  .swipe-shell,
  .swipe-card-row,
  .swipe-card,
  .culture-swipe-card {
    height: 100vh;
    min-height: 100lvh;
  }
  .swipe-card.flipped ~ .mobile-swipe-hint,
  .culture-swipe-card.flipped ~ .mobile-swipe-hint {
    color: #81798c;
  }
  body:has(.swipe-card.flipped),
  body:has(.culture-swipe-card.flipped),
  .app-shell:has(.swipe-card.flipped),
  .app-shell:has(.culture-swipe-card.flipped),
  .main-page:has(.swipe-card.flipped),
  .main-page:has(.culture-swipe-card.flipped),
  .content-panel:has(.swipe-card.flipped),
  .content-panel:has(.culture-swipe-card.flipped),
  .swipe-stage:has(.swipe-card.flipped),
  .culture-swipe-stage:has(.culture-swipe-card.flipped),
  .swipe-shell:has(.swipe-card.flipped),
  .swipe-shell:has(.culture-swipe-card.flipped) {
    background: #f8f7fb !important;
  }

  /* Mobile keeps the desktop preview/detail segmented toggle at the top. */
  #libraryPage .section-label,
  #culturePage .section-label {
    display: block;
    position: static;
  }
  #libraryPage .view-switch,
  #culturePage .view-switch {
    position: fixed;
    top: max(11px, calc(env(safe-area-inset-top) + 2px));
    right: 66px;
    left: auto;
    z-index: 84;
    display: grid;
    grid-template-columns: repeat(2, minmax(68px, 1fr));
    gap: 0;
    padding: 3px;
    border: 1px solid rgba(255,255,255,.48);
    border-radius: 14px;
    background: rgba(239,237,242,.84);
    box-shadow: 0 7px 20px rgba(20,15,28,.18), inset 0 1px 0 rgba(255,255,255,.72);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
    backdrop-filter: blur(16px) saturate(1.1);
    width: 140px;
    transform: none;
  }
  #libraryPage .view-switch-label,
  #culturePage .view-switch-label {
    position: relative;
    z-index: 2;
    display: block;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 10px;
    color: #8f8995;
    font-size: 11px;
    font-weight: 850;
  }
  #libraryPage .view-switch-label.active,
  #culturePage .view-switch-label.active { color: #4b4650; }
  #libraryPage .view-switch-track,
  #culturePage .view-switch-track {
    position: absolute;
    top: 3px;
    left: 3px;
    z-index: 1;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 2px 7px rgba(35,29,42,.10), inset 0 1px 0 #fff;
    pointer-events: none;
    transition: transform .26s cubic-bezier(.2,.8,.2,1);
  }
  #libraryPage .view-switch-track::before,
  #culturePage .view-switch-track::before,
  #libraryPage .view-switch-thumb,
  #culturePage .view-switch-thumb { display: none; }
  #libraryPage .view-switch:has(.view-switch-label:last-child.active) .view-switch-track,
  #culturePage .view-switch:has(.view-switch-label:last-child.active) .view-switch-track {
    transform: translateX(100%);
  }

  .swipe-front .expression-front-copy { width: 100%; max-width: none; }
  .swipe-front .expression-flip-cue {
    align-self: flex-end;
    margin-top: 18px;
    margin-right: 0;
    margin-left: auto;
  }

  /* One-line mobile header: logo + tabs | view toggle | menu. */
  .top-tabs {
    right: auto;
    left: 62px;
    width: 222px;
  }

  @media (max-width: 520px) {
    .brand-logo {
      left: 8px;
      width: 40px;
      height: 40px;
      padding: 4px;
    }
    .brand-mark { width: 30px; height: 30px; }
    .top-tabs {
      left: 52px;
      width: 160px;
      padding: 2px;
    }
    .tab { min-height: 36px; padding: 2px 3px; }
    .tab-icon { display: none; }
    .tab-label-mobile { font-size: 10.5px; }
    .mobile-filter-toggle {
      right: 8px;
      width: 40px;
      height: 40px;
    }
    #libraryPage .view-switch,
    #culturePage .view-switch {
      right: 52px;
      width: 104px;
      padding: 2px;
      border-radius: 12px;
    }
    #libraryPage .view-switch-label,
    #culturePage .view-switch-label {
      min-height: 34px;
      padding: 0 5px;
      font-size: 10px;
    }
    #libraryPage .view-switch-track,
    #culturePage .view-switch-track {
      top: 2px;
      left: 2px;
      width: calc(50% - 2px);
      height: calc(100% - 4px);
      border-radius: 9px;
    }
  }

  /* Polished mobile header: one rhythm, two clear control groups. */
  .brand-logo,
  .top-tabs,
  .mobile-filter-toggle,
  #libraryPage .view-switch,
  #culturePage .view-switch {
    top: max(10px, calc(env(safe-area-inset-top) + 2px));
    height: 44px;
    border: 1px solid rgba(255,255,255,.44);
    background: rgba(30,25,36,.58);
    box-shadow: 0 8px 24px rgba(14,10,20,.16), inset 0 1px 0 rgba(255,255,255,.14);
    -webkit-backdrop-filter: blur(22px) saturate(1.18);
    backdrop-filter: blur(22px) saturate(1.18);
  }
  .brand-logo {
    left: 12px;
    width: 44px;
    padding: 5px;
  }
  .brand-mark { width: 32px; height: 32px; }
  .top-tabs {
    left: 62px;
    width: 218px;
    padding: 3px;
    gap: 2px;
    border-radius: 18px;
  }
  .tab {
    min-height: 36px;
    padding: 0 8px;
    gap: 5px;
    border-radius: 14px;
    color: rgba(255,255,255,.70);
  }
  .tab.active {
    color: #443451;
    background: rgba(255,255,255,.94);
    box-shadow: 0 3px 9px rgba(13,9,19,.15);
  }
  .tab-icon { width: 16px; height: 16px; }
  .tab-label-mobile { font-size: 11px; letter-spacing: .01em; }
  .mobile-filter-toggle {
    right: 12px;
    width: 44px;
  }
  #libraryPage .view-switch,
  #culturePage .view-switch {
    right: 62px;
    width: 136px;
    padding: 3px;
    border-radius: 18px;
    background: rgba(238,235,242,.76);
  }
  #libraryPage .view-switch-label,
  #culturePage .view-switch-label {
    min-height: 36px;
    padding: 0 9px;
    border-radius: 14px;
    color: rgba(72,65,79,.46);
    font-size: 11px;
  }
  #libraryPage .view-switch-label.active,
  #culturePage .view-switch-label.active { color: #4b4354; }
  #libraryPage .view-switch-track,
  #culturePage .view-switch-track {
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: 36px;
    border-radius: 14px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 3px 10px rgba(35,29,42,.11), inset 0 1px 0 #fff;
  }

  @media (max-width: 520px) {
    .brand-logo { left: 7px; width: 38px; height: 40px; padding: 4px; }
    .brand-mark { width: 29px; height: 29px; }
    .top-tabs { left: 49px; width: 158px; height: 40px; padding: 2px; }
    .tab { min-height: 34px; padding: 0 4px; }
    .tab-icon { display: none; }
    .mobile-filter-toggle { right: 7px; width: 38px; height: 40px; }
    #libraryPage .view-switch,
    #culturePage .view-switch { right: 49px; width: 102px; height: 40px; padding: 2px; }
    #libraryPage .view-switch-label,
    #culturePage .view-switch-label { min-height: 34px; padding: 0 4px; font-size: 10px; }
    #libraryPage .view-switch-track,
    #culturePage .view-switch-track { top: 2px; left: 2px; width: calc(50% - 2px); height: 34px; border-radius: 12px; }
  }

  /* Back-face metadata: restore emoji and give Culture tags a stable home. */
  .swipe-back .expression-counterpart-emoji {
    display: inline-block !important;
    margin-right: 6px;
    font-size: 17px;
    line-height: 1;
    vertical-align: -1px;
  }
  .culture-swipe-card .culture-back-title-row > .culture-emoji {
    display: grid !important;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid rgba(255,255,255,.48);
    border-radius: 14px;
    background: rgba(24,19,32,.48);
    font-size: 21px;
    box-shadow: 0 7px 18px rgba(10,7,15,.18), inset 0 1px 0 rgba(255,255,255,.16);
    -webkit-backdrop-filter: blur(14px) saturate(1.12);
    backdrop-filter: blur(14px) saturate(1.12);
  }
  .culture-swipe-card .culture-back-subtheme-tag {
    position: absolute;
    top: calc(var(--mobile-top) + 10px);
    right: auto;
    left: 22px;
    z-index: 3;
    display: inline-flex !important;
    align-items: center;
    width: auto;
    max-width: calc(100% - 44px);
    min-height: 28px;
    padding: 5px 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 999px;
    background: rgba(24,19,32,.46);
    color: rgba(255,255,255,.92);
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(10,7,15,.16);
    -webkit-backdrop-filter: blur(14px) saturate(1.12);
    backdrop-filter: blur(14px) saturate(1.12);
  }

  /* Culture detail card — restrained image, title and reading layers. */
  .culture-swipe-card .culture-back-main {
    display: grid;
    grid-template-rows: minmax(0, 64%) minmax(0, 36%);
    height: 100%;
    overflow: hidden;
  }
  .culture-swipe-card .culture-back-title-row {
    display: flex !important;
    align-items: flex-end !important;
    gap: 10px;
    min-height: 0;
    padding: calc(var(--mobile-top) + 44px) 24px 30px !important;
    background: linear-gradient(180deg, transparent 48%, rgba(16,11,22,.78) 100%) !important;
  }
  .culture-swipe-card .culture-back-title-row > .culture-emoji {
    display: block !important;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    margin-bottom: 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 25px;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .culture-swipe-card .culture-back-title-copy { flex: 1; min-width: 0; }
  .culture-swipe-card .culture-back-title-copy h3 {
    font-size: clamp(29px, 7vw, 38px) !important;
    line-height: 1.04 !important;
  }
  .culture-swipe-card .culture-counterpart {
    margin-top: 6px !important;
    color: rgba(255,255,255,.76) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
  }
  .culture-swipe-card .culture-sound-btn { align-self: flex-end; }
  .culture-swipe-card .culture-back-subtheme-tag {
    top: calc(var(--mobile-top) + 12px);
    left: 24px;
    min-height: 26px;
    padding: 5px 9px;
    background: rgba(20,15,27,.38);
    font-size: 9.5px;
    box-shadow: none;
  }
  .culture-swipe-card .culture-info-block {
    height: 100%;
    margin: 0;
    padding: 27px 25px calc(var(--mobile-bottom) + 32px) !important;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    background: #f8f7fb !important;
    box-shadow: none;
  }
  .culture-swipe-card .culture-info-text {
    max-width: 680px;
    margin: 0 auto;
    color: #514b59 !important;
    font-size: clamp(14px, 3.35vw, 16px) !important;
    font-weight: 650 !important;
    line-height: 1.7 !important;
  }

  /* Culture front — compact, left-aligned story label. */
  .culture-swipe-card .culture-front {
    position: absolute;
    display: block;
    padding: 0 !important;
  }
  .culture-swipe-card .culture-front-content {
    position: absolute;
    right: 24px;
    bottom: calc(var(--mobile-bottom) + 54px);
    left: 24px;
    width: auto;
    max-width: 560px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 7px 11px;
    padding: 0;
    text-align: left;
    transform: none;
  }
  .culture-swipe-card .culture-front-content > .culture-emoji {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: block !important;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 27px;
    box-shadow: none;
    transform: none !important;
  }
  .culture-swipe-card .culture-front-content h3 {
    position: static;
    grid-column: 2;
    width: auto;
    margin: 0;
    color: #fff;
    font-size: clamp(34px, 8vw, 46px);
    font-weight: 950;
    line-height: 1;
    letter-spacing: -.04em;
    text-align: left;
    text-shadow: 0 3px 20px rgba(0,0,0,.48);
    transform: none;
  }
  .culture-swipe-card .culture-front-sub {
    grid-column: 2;
    max-width: 520px;
    margin: 0;
    color: rgba(255,255,255,.78);
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 700;
    line-height: 1.42;
    text-shadow: 0 2px 12px rgba(0,0,0,.44);
  }
  .culture-swipe-card .culture-front-tag {
    position: absolute !important;
    top: calc(var(--mobile-top) + 12px) !important;
    right: auto !important;
    bottom: auto !important;
    left: 24px !important;
    z-index: 3;
    max-width: calc(100% - 48px);
    min-height: 27px;
    padding: 5px 10px;
    border-color: rgba(255,255,255,.30);
    background: rgba(21,16,28,.40);
    color: rgba(255,255,255,.88);
    font-size: 10px;
    box-shadow: none;
    transform: none !important;
  }

  /* Expression tags stay anchored below the mobile header on both faces. */
  .swipe-front .expression-front-scene,
  .swipe-back .expression-back-scene {
    position: absolute !important;
    top: calc(var(--mobile-top) + 12px) !important;
    right: auto !important;
    bottom: auto !important;
    left: 24px !important;
    z-index: 4;
    max-width: calc(100% - 48px);
    min-height: 27px;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,.30);
    border-radius: 999px;
    background: rgba(21,16,28,.40);
    color: rgba(255,255,255,.88);
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    box-shadow: none;
    transform: none !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.12);
    backdrop-filter: blur(14px) saturate(1.12);
  }

  /* Quiz uses the scene image as its full-screen canvas. */
  #quizPage { padding: 0; overflow-y: auto; background: #17131f; touch-action: none; }
  #quizPage .filter-panel { position: fixed; }
  .quiz-panel { display: block; min-height: 100dvh; border: 0; border-radius: 0; overflow: hidden; }
  .quiz-panel::before { inset: -15px; filter: blur(5.5px) saturate(.72) brightness(.72); transform: scale(1.035); }
  .quiz-panel::after { background: linear-gradient(180deg, rgba(18,14,25,.20) 8%, rgba(18,14,25,.46) 52%, rgba(18,14,25,.80) 100%); }
  .quiz-panel { touch-action: inherit; }
  .quiz-scene-card { min-height: 40dvh; padding: calc(var(--mobile-top) + 28px) 0 148px; cursor: grab; user-select: none; }
  .quiz-scene-card::before { background: radial-gradient(ellipse 118% 86% at 36% 42%, rgba(12,9,18,.58) 0%, rgba(12,9,18,.35) 44%, rgba(12,9,18,.12) 74%, transparent 100%); }
  .quiz-scene-card.is-dragging { cursor: grabbing; }
  .quiz-scene-content { width: calc(100% - 36px); padding: 0 16px; }
  .quiz-scene-content::before { margin-bottom: 8px; padding: 5px 9px; font-size: 10.5px; }
  .quiz-scene-subtitle { margin-bottom: 8px; font-size: 20px; }
  .quiz-prompt-row { gap: 6px; }
  .quiz-prompt-emoji { font-size: 14px; }
  .quiz-question { font-size: 12px; }
  .quiz-body { width: calc(100% - 36px); margin: -118px auto 12px; padding: 20px 16px 28px; border: 1px solid rgba(255,255,255,.28); border-radius: 26px; }
  .quiz-answer-heading { margin: 0 0 16px; font-size: 19px; }
  .answer-grid { gap: 16px; }
  .answer-btn { gap: 14px; min-height: 72px; padding: 13px 14px; font-size: 15px; }
  .answer-feedback-inline { padding-right: 0; padding-left: 0; }
  .answer-feedback-inline {
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid currentColor;
    border-radius: 13px;
    background: rgba(255,255,255,.58);
  }
  .answer-feedback-inline.correct { background: rgba(98,214,170,.12); }
  .answer-feedback-inline.wrong { background: rgba(239,107,118,.10); }
  .feedback-line {
    align-items: flex-start;
    overflow: visible;
    font-size: 13px !important;
    line-height: 1.55;
    white-space: normal;
  }
  .feedback-copy {
    display: block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    font-size: 13px !important;
    white-space: normal;
    overflow-wrap: anywhere;
    transform: none !important;
  }
  .quiz-nav-row { display: none; }
  #quizPage + * { display: none; }
  .foot-section { display: none; }
}

@media (max-width: 420px) {
  .brand-copy { display: none; }
  .brand-logo { padding-right: 7px; }
  .tab { gap: 5px; }
  .tab-icon { width: 18px; height: 18px; }
  .emoji-badge, .culture-emoji { width: 48px; height: 48px; font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto; animation-duration: .01ms; animation-iteration-count: 1; transition-duration: .01ms; }
}
