:root {
  color-scheme: light;
  --ink: #191d2b;
  --muted: #676b7e;
  --purple: #6d4aff;
  --purple-dark: #4d2ed4;
  --red: #e52332;
  --surface: rgba(255, 255, 255, 0.88);
  --shadow: 0 18px 55px rgba(57, 42, 130, 0.14);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 206, 95, 0.24), transparent 29rem),
    radial-gradient(circle at 91% 31%, rgba(125, 94, 255, 0.21), transparent 32rem),
    #f8f7ff;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
html[lang="zh-CN"] body { font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.background-orb { position: fixed; z-index: -1; border-radius: 50%; opacity: .55; }
.orb-one { width: 220px; height: 220px; top: 18%; left: -100px; background: #ffd46b; }
.orb-two { width: 320px; height: 320px; right: -180px; bottom: 5%; background: #b7a8ff; }

.study-shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 24px; }
.hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin-bottom: 25px; }
.brand-mark {
  display: flex; width: 76px; height: 76px; align-items: center; justify-content: center; border-radius: 23px;
  background: linear-gradient(145deg, #7658ff, #5d39ec); box-shadow: 0 14px 28px rgba(87, 57, 224, .28);
  color: #fff; font-size: 25px; font-weight: 900; letter-spacing: -2px; transform: rotate(-3deg);
}
.brand-mark span { color: #ffd862; }
.eyebrow, .card-kicker { margin: 0 0 5px; color: var(--purple); font-size: 11px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 54px); line-height: 1; letter-spacing: -.045em; }
.subtitle { max-width: 650px; margin: 9px 0 0; color: var(--muted); font-size: 16px; }

.language-switcher { display: flex; gap: 5px; padding: 5px; border: 1px solid rgba(109,74,255,.12); border-radius: 14px; background: rgba(255,255,255,.86); box-shadow: 0 9px 24px rgba(48,41,93,.1); }
.language-button { display: grid; width: 38px; height: 34px; padding: 0; place-items: center; border: 0; border-radius: 10px; background: transparent; cursor: pointer; filter: grayscale(.55); opacity: .64; transition: 150ms ease; }
.language-button:hover { transform: translateY(-1px); background: #f1eeff; filter: grayscale(0); opacity: 1; }
.language-button[aria-pressed="true"] { background: #ebe7ff; box-shadow: inset 0 0 0 2px rgba(109,74,255,.2); filter: grayscale(0); opacity: 1; }
.language-button:focus-visible, button:focus-visible { outline: 3px solid #f3b725; outline-offset: 3px; }
.flag-icon { position: relative; display: grid; width: 26px; height: 18px; overflow: hidden; place-items: start; border-radius: 3px; box-shadow: 0 0 0 1px rgba(20,20,40,.14); font-size: 9px; line-height: 12px; color: #ffde00; }
.flag-ru { background: linear-gradient(to bottom, #fff 0 33.333%, #2450a4 33.333% 66.666%, #d52b1e 66.666%); }
.flag-gb { background: linear-gradient(33deg, transparent 43%, #fff 43% 52%, transparent 52%), linear-gradient(-33deg, transparent 43%, #fff 43% 52%, transparent 52%), linear-gradient(to right, transparent 39%, #fff 39% 61%, transparent 61%), linear-gradient(to bottom, transparent 34%, #fff 34% 66%, transparent 66%), linear-gradient(to right, transparent 45%, #c8102e 45% 55%, transparent 55%), linear-gradient(to bottom, transparent 42%, #c8102e 42% 58%, transparent 58%), #012169; }
.flag-cn { padding-left: 3px; background: #de2910; }

.study-card { display: grid; grid-template-columns: 1.12fr .88fr; min-height: 440px; overflow: hidden; border: 2px solid #fff; border-radius: 30px; background: var(--surface); box-shadow: var(--shadow); }
.picture-panel { position: relative; display: grid; min-height: 430px; place-items: center; overflow: hidden; background: #fff; }
.picture-panel img { width: 100%; height: 100%; max-height: 470px; object-fit: contain; }
.letter-badge { position: absolute; z-index: 1; top: 20px; left: 20px; display: grid; width: 56px; height: 56px; place-items: center; border-radius: 18px; background: var(--red); box-shadow: 0 10px 22px rgba(229,35,50,.25); color: #fff; font-size: 29px; font-weight: 900; transform: rotate(-4deg); }
.word-panel { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(28px, 5vw, 58px); background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(240,236,255,.92)); }
.focus-word { margin: 4px 0 0; font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif; font-size: clamp(58px, 8vw, 96px); line-height: 1; letter-spacing: -.065em; }
.initial { color: var(--red); }
.phonetic { margin: 16px 0 0; color: #7d738e; font-family: Georgia, serif; font-size: 22px; }
.translation { min-height: 36px; margin: 14px 0 25px; color: #4d5264; font-size: 24px; font-weight: 700; }
.speak-button, .play-all-button, .nav-button, .mini-speak { border: 0; cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease; }
.speak-button { display: inline-flex; align-items: center; gap: 10px; padding: 15px 22px; border-radius: 16px; background: linear-gradient(135deg, var(--purple), var(--purple-dark)); box-shadow: 0 13px 25px rgba(86,54,214,.25); color: #fff; font-weight: 800; }
.speaker { font-size: 22px; }
.speak-button:hover, .play-all-button:hover, .nav-button:hover:not(:disabled) { transform: translateY(-2px); }
.speech-status { min-height: 20px; margin: 12px 0 -32px; color: var(--purple-dark); font-size: 13px; font-weight: 700; }

.study-controls { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin: 18px 0 40px; }
.nav-button { padding: 12px 19px; border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(48,41,93,.11); color: var(--purple-dark); font-weight: 800; }
.nav-button.primary { background: var(--purple); color: #fff; }
.nav-button:disabled { cursor: default; opacity: .42; }
.progress-wrap { display: flex; align-items: center; gap: 12px; color: #555a6e; font-size: 13px; font-weight: 800; }
.progress-track { flex: 1; height: 7px; overflow: hidden; border-radius: 99px; background: #e5e1f5; }
.progress-track span { display: block; width: 25%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), #ae52ff); transition: width 350ms ease; }

.vocabulary-section { padding: 28px; border: 1px solid rgba(109,74,255,.1); border-radius: 25px; background: rgba(255,255,255,.74); box-shadow: 0 12px 35px rgba(57,42,130,.08); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.section-heading h2 { margin: 0; font-size: 31px; letter-spacing: -.035em; }
.play-all-button { padding: 12px 17px; border-radius: 14px; background: #eeeaff; color: var(--purple-dark); font-weight: 800; }
.play-all-button.is-playing { background: #ffe8ea; color: #bb1c29; }
.word-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.vocabulary-card { position: relative; overflow: hidden; border: 2px solid transparent; border-radius: 19px; background: #fff; box-shadow: 0 10px 28px rgba(57,42,130,.1); transition: transform 180ms ease, border-color 180ms ease; }
.vocabulary-card:hover { transform: translateY(-3px); }
.vocabulary-card.is-current { border-color: var(--purple); }
.vocabulary-card.is-speaking { box-shadow: 0 0 0 5px rgba(109,74,255,.13), 0 10px 28px rgba(57,42,130,.1); }
.card-select { display: block; width: 100%; padding: 0 0 14px; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.card-select img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-bottom: 1px solid #f0edf8; }
.mini-word, .mini-translation { display: block; padding: 0 14px; }
.mini-word { margin-top: 10px; font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif; font-size: 25px; font-weight: 900; letter-spacing: -.045em; }
.mini-translation { overflow: hidden; margin-top: 3px; padding-right: 48px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.mini-speak { position: absolute; right: 9px; bottom: 10px; display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: #eeeaff; }
.mini-speak:hover { transform: scale(1.07); }
.tip { margin: 19px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
footer { padding: 4px 20px 32px; text-align: center; }
footer a { color: var(--purple-dark); font-size: 13px; font-weight: 750; text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .study-shell { position: relative; width: min(620px, calc(100% - 22px)); padding-top: 70px; }
  .hero { grid-template-columns: auto 1fr; gap: 13px; }
  .brand-mark { width: 60px; height: 60px; border-radius: 18px; font-size: 20px; }
  .subtitle { font-size: 14px; }
  .language-switcher { position: absolute; top: 15px; right: 0; }
  .study-card { grid-template-columns: 1fr; min-height: 0; }
  .picture-panel { min-height: 280px; }
  .picture-panel img { max-height: 330px; }
  .word-panel { align-items: center; padding: 28px 20px 34px; text-align: center; }
  .focus-word { font-size: clamp(58px, 20vw, 84px); }
  .speech-status { margin-bottom: -18px; }
  .study-controls { gap: 9px; }
  .nav-button { padding: 11px 13px; }
  .progress-wrap { gap: 7px; }
  .vocabulary-section { padding: 20px 14px; }
  .word-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .section-heading { align-items: center; }
  .section-heading h2 { font-size: 26px; }
  .play-all-button { padding: 11px 13px; font-size: 13px; }
}

@media (max-width: 390px) {
  .study-controls { grid-template-columns: 1fr 1fr; }
  .progress-wrap { grid-column: 1 / -1; grid-row: 1; }
  .nav-button { width: 100%; }
  .letter-badge { width: 48px; height: 48px; border-radius: 15px; font-size: 25px; }
}

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