:root {
  color-scheme: light;
  --ink: #263044;
  --yellow-1: #fff6ad;
  --yellow-2: #ffd95a;
  --yellow-3: #e9b638;
  --screen: #111826;
  --line: rgba(38, 48, 68, 0.12);
  --green: #6fd39d;
  font-family: "Nunito", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
button { font: inherit; }
button:focus-visible { outline: 3px solid rgba(117, 167, 255, .75); outline-offset: 3px; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 230, 106, .35), transparent 30%),
    radial-gradient(circle at 86% 22%, rgba(117, 167, 255, .25), transparent 28%),
    linear-gradient(180deg, #fffaf0 0%, #edf7ff 58%, #fff3ef 100%);
}

.demo-shell {
  width: min(1160px, calc(100% - 34px));
  margin: 0 auto;
  padding: 38px 0 46px;
}
.intro { max-width: 760px; margin-bottom: 28px; }
.eyebrow {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #b95a00;
  background: #fff0c6;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .04em;
}
h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -.04em;
}
.intro p:last-child {
  max-width: 690px;
  margin: 16px 0 0;
  color: #5f6f86;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 750;
}

.simulator-area {
  display: grid;
  grid-template-columns: minmax(320px, 560px) minmax(280px, 1fr);
  gap: 34px;
  align-items: center;
}
.device-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 540px;
  padding-top: 38px;
}
.lanyard {
  position: absolute;
  top: 8px;
  width: 78px;
  height: 78px;
  border: 19px solid #f9dc72;
  border-bottom: 0;
  border-radius: 54px 54px 0 0;
  box-shadow: inset 0 5px 7px rgba(255,255,255,.5), 0 7px 14px rgba(128, 93, 8, .1);
}
.device-body {
  position: relative;
  width: 430px;
  height: 430px;
  max-width: 92vw;
  max-height: 92vw;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 22%, rgba(255,255,255,.74), transparent 18%),
    radial-gradient(circle at 50% 52%, var(--yellow-1) 0%, var(--yellow-2) 55%, var(--yellow-3) 100%);
  box-shadow:
    inset -20px -26px 50px rgba(133, 92, 0, .18),
    inset 18px 18px 38px rgba(255,255,255,.42),
    0 28px 60px rgba(56, 66, 88, .18);
}
.camera {
  position: absolute;
  top: 48px;
  left: 50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, #4c586a 0 12%, #101218 42%, #030305 100%);
  transform: translateX(-50%);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.06), 0 3px 12px rgba(0,0,0,.25);
}
.camera i {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff, #7d8da9 18%, #192033 60%);
  opacity: .72;
}
.hardware-key {
  position: absolute;
  right: -17px;
  width: 40px;
  min-height: 66px;
  border: 0;
  border-radius: 20px;
  color: rgba(94, 71, 4, .72);
  background: linear-gradient(90deg, #e9bd3d, #ffe77e);
  box-shadow: 7px 8px 16px rgba(97, 72, 9, .16), inset 4px 3px 8px rgba(255,255,255,.35);
  cursor: pointer;
}
.power-key { top: 126px; font-size: 17px; }
.record-key { top: 216px; font-size: 19px; color: #d7463d; }
.record-key.recording { background: linear-gradient(90deg, #ff766f, #ffc0a1); color: white; animation: record-key-pulse .8s ease-in-out infinite alternate; }
@keyframes record-key-pulse { to { transform: scale(1.06); box-shadow: 7px 8px 18px rgba(255, 76, 76, .42), 0 0 0 6px rgba(255, 108, 99, .18); } }

.screen-bezel {
  position: absolute;
  inset: 95px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #07090d;
  box-shadow: inset 0 0 0 8px #151a22, 0 12px 30px rgba(25, 17, 0, .34);
}
.device-screen {
  position: relative;
  width: 240px;
  height: 240px;
  overflow: hidden;
  border-radius: 50%;
  color: #f7fbff;
  background:
    radial-gradient(circle at 50% 18%, rgba(97, 143, 226, .6), transparent 30%),
    radial-gradient(circle at 50% 110%, rgba(111, 211, 157, .32), transparent 36%),
    var(--screen);
  box-shadow: inset 0 0 32px rgba(0,0,0,.42);
  text-align: center;
  touch-action: manipulation;
}
.speaker-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}
.speaker-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(106, 78, 6, .38);
}
.external-nav {
  position: static;
  display: flex;
  justify-content: center;
  gap: 9px;
  min-height: 34px;
  margin-top: 14px;
}
.external-nav:empty { display: none; }
.external-nav button {
  min-width: 66px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(130, 93, 3, .22);
  border-radius: 14px;
  color: #6a4b03;
  background: linear-gradient(145deg, #fff4a9, #ffd762);
  box-shadow: 0 5px 10px rgba(100, 75, 5, .14), inset 0 1px 0 rgba(255,255,255,.7);
  font-size: 11px;
  font-weight: 1000;
  cursor: pointer;
}
.external-nav button:disabled { opacity: .38; cursor: default; }

.word-stack {
  width: 174px;
  display: grid;
  gap: 6px;
  margin: 2px auto 0;
}
.word-row {
  min-height: 34px;
  display: grid;
  grid-template-columns: 1fr 64px;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.09);
  text-align: left;
}
.word-row b { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.word-row span { color: #c9d7ec; font-size: 11px; text-align: right; }

.screen-page {
  width: 100%;
  height: 100%;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 22px 20px 20px;
}
.screen-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #9fd6ff;
  font-size: 10px;
  font-weight: 1000;
}
.screen-title {
  margin: 0 auto;
  max-width: 184px;
  font-size: 19px;
  line-height: 1.12;
  font-weight: 1000;
}
.screen-subtitle {
  max-width: 176px;
  margin: 0 auto;
  color: #cad8ed;
  font-size: 10px;
  line-height: 1.32;
  font-weight: 800;
}
.boot-logo, .avatar {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin: 0 auto 2px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #ff8c74, #ff5e58);
  font-size: 20px;
  font-weight: 1000;
  transform: rotate(-5deg);
  box-shadow: 0 9px 20px rgba(255, 113, 95, .25);
}
.status-pill {
  display: inline-flex;
  justify-self: center;
  max-width: 184px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #142135;
  background: #fff1a8;
  font-size: 9px;
  font-weight: 1000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  width: 174px;
  margin: 4px auto 0;
}
.screen-btn {
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 15px;
  color: #f8fbff;
  background: rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09);
  font-size: 12px;
  font-weight: 1000;
  cursor: pointer;
}
.screen-btn.primary { background: linear-gradient(145deg, #ff7b67, #ff5e58); border: 0; }
.screen-btn.green { background: linear-gradient(145deg, #78d9b4, #39b983); border: 0; }
.screen-btn.blue { background: linear-gradient(145deg, #8bb4ff, #5d88ff); border: 0; }
.screen-btn.yellow { color: #392b08; background: linear-gradient(145deg, #fff1a6, #ffd75f); border: 0; }
.screen-btn:disabled { opacity: .45; cursor: default; }

.list-stack {
  width: 176px;
  margin: 0 auto;
  display: grid;
  gap: 6px;
}
.list-btn {
  min-height: 32px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  color: #f8fbff;
  background: rgba(255,255,255,.09);
  text-align: left;
  cursor: pointer;
}
.list-btn b {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.list-btn span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-left: 4px;
  border-radius: 9px;
  color: #142135;
  background: #fff1a8;
  font-size: 10px;
  font-weight: 1000;
}
.pager, .tiny-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 1px;
}
.pager .screen-btn, .tiny-actions .screen-btn {
  min-height: 30px;
  min-width: 50px;
  padding: 0 9px;
  border-radius: 13px;
  font-size: 10px;
}

.sentence-card {
  width: 184px;
  height: 88px;
  display: grid;
  align-content: start;
  gap: 5px;
  margin: 0 auto;
  padding: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(159, 214, 255, .72) transparent;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 21px;
  background: rgba(255,255,255,.1);
}
.sentence-card::-webkit-scrollbar,
.scored-sentence::-webkit-scrollbar { width: 3px; }
.sentence-card::-webkit-scrollbar-track,
.scored-sentence::-webkit-scrollbar-track { background: transparent; }
.sentence-card::-webkit-scrollbar-thumb,
.scored-sentence::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(159, 214, 255, .72);
}
.sentence-card .en {
  display: block;
  overflow: visible;
  color: #fff;
  font-size: 17px;
  line-height: 1.08;
  font-weight: 1000;
}
.sentence-card .zh {
  display: block;
  overflow: visible;
  color: #c9d7ec;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 800;
}
.recording-card {
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 6px 9px;
  overflow: hidden;
  border-color: rgba(255, 118, 111, .55);
  background: radial-gradient(circle at 50% 45%, rgba(255, 94, 88, .18), rgba(255,255,255,.08));
  box-shadow: inset 0 0 20px rgba(255, 94, 88, .12);
}
.recording-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff4f2;
  background: rgba(255, 91, 86, .25);
  font-size: 9px;
  font-weight: 1000;
}
.recording-badge > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff6f67;
  box-shadow: 0 0 0 0 rgba(255, 111, 103, .5);
  animation: recording-dot 1s ease-out infinite;
}
@keyframes recording-dot { 70% { box-shadow: 0 0 0 7px rgba(255, 111, 103, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 111, 103, 0); } }
.recording-en {
  width: 164px;
  min-height: 0;
  max-height: 30px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(159, 214, 255, .72) transparent;
  color: #fff;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 1000;
  white-space: normal;
  overflow-wrap: anywhere;
}
.recording-en::-webkit-scrollbar { width: 3px; }
.recording-en::-webkit-scrollbar-track { background: transparent; }
.recording-en::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(159, 214, 255, .72); }
.recording-meter { height: 9px; display: flex; align-items: center; justify-content: center; gap: 3px; }
.recording-meter i { width: 3px; border-radius: 4px; background: #7ff0b8; animation: recording-meter .55s ease-in-out infinite alternate; }
.recording-meter i:nth-child(1) { height: 5px; animation-delay: -.3s; }
.recording-meter i:nth-child(2) { height: 9px; animation-delay: -.15s; }
.recording-meter i:nth-child(3) { height: 7px; animation-delay: -.45s; }
.recording-meter i:nth-child(4) { height: 9px; animation-delay: -.05s; }
.recording-meter i:nth-child(5) { height: 6px; animation-delay: -.25s; }
@keyframes recording-meter { to { transform: scaleY(.38); opacity: .55; } }
.sentence-card.evaluated {
  height: 88px;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) 42px;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  column-gap: 6px;
  row-gap: 3px;
  padding: 7px 8px;
}
.scored-sentence {
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(159, 214, 255, .72) transparent;
  line-height: 1.65;
  text-align: left;
}
.scored-word {
  display: inline;
  padding: 2px 3px;
  border-radius: 6px;
  color: #f5f8ff;
  font-size: 13px;
  font-weight: 1000;
}
.scored-word.great { color: #7ff0b8; background: rgba(61, 196, 135, .16); }
.scored-word.practice { color: #ffd273; background: rgba(255, 184, 64, .16); }
.scored-word.focus { color: #ff8f8b; background: rgba(255, 91, 91, .17); }
.scored-word.unknown { color: #c9d7ec; }
.score-summary {
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 14px;
  color: #eff7ff;
  background: rgba(0, 0, 0, .18);
}
.score-summary b { color: #7ff0b8; font-size: 19px; line-height: 1; }
.score-summary span, .score-summary i { font-size: 8px; font-style: normal; }
.score-summary i { color: #9eb1cd; }
.metric-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 5px;
  color: #b9c8de;
  font-size: 8px;
  font-weight: 900;
}
.role-result-overview {
  width: 184px;
  display: grid;
  grid-template-columns: 38px 34px 1fr;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
  padding: 5px 8px;
  border-radius: 12px;
  color: #d8e5f6;
  background: rgba(255,255,255,.09);
}
.role-result-overview b { color: #7ff0b8; font-size: 20px; line-height: 1; }
.role-result-overview span { font-size: 8px; font-weight: 900; }
.role-result-overview em { color: #c9d7ec; font-size: 8px; line-height: 1.2; font-style: normal; font-weight: 800; }
.role-result-list {
  width: 184px;
  max-height: 68px;
  display: grid;
  gap: 4px;
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(159, 214, 255, .72) transparent;
}
.role-result-row {
  min-height: 31px;
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 10px;
  text-align: left;
  background: rgba(255,255,255,.08);
}
.role-result-row > span { color: #142135; background: #fff1a8; border-radius: 7px; text-align: center; font-size: 9px; font-weight: 1000; }
.role-result-row div { min-width: 0; }
.role-result-row b, .role-result-row small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.role-result-row b { color: #f7fbff; font-size: 9px; }
.role-result-row small { color: #aebfd8; font-size: 8px; }
.evaluation-loading { min-height: 82px; }
.reward-burst {
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  border-radius: 50%;
  pointer-events: none;
}
.reward-burst strong {
  position: absolute;
  left: 50%;
  top: 39%;
  z-index: 2;
  padding: 5px 11px;
  border-radius: 999px;
  color: #493400;
  background: linear-gradient(145deg, #fff7bd, #ffd45f);
  box-shadow: 0 5px 18px rgba(255, 203, 67, .38);
  font-size: 12px;
  font-weight: 1000;
  transform: translate(-50%, -50%) scale(.4);
  animation: reward-label 1.2s ease-out forwards;
}
.reward-burst i {
  --x: 0px; --y: 0px; --r: 0deg; --c: #ffd45f;
  position: absolute;
  left: 50%;
  top: 46%;
  width: 7px;
  height: 11px;
  border-radius: 3px;
  background: var(--c);
  opacity: 0;
  animation: confetti-pop 1.1s cubic-bezier(.12,.72,.2,1) forwards;
}
@keyframes reward-label { 20% { transform: translate(-50%, -50%) scale(1.08); } 70% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -60%) scale(.9); opacity: 0; } }
@keyframes confetti-pop { 0% { transform: translate(0,0) rotate(0); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }
.wave {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 3px;
  height: 18px;
}
.wave i {
  width: 4px;
  border-radius: 4px;
  background: var(--green);
  animation: pulse .72s ease-in-out infinite alternate;
}
.wave i:nth-child(1) { height: 7px; }
.wave i:nth-child(2) { height: 16px; animation-delay: -.2s; }
.wave i:nth-child(3) { height: 10px; animation-delay: -.4s; }
.wave i:nth-child(4) { height: 18px; animation-delay: -.1s; }
@keyframes pulse { to { transform: scaleY(.46); opacity: .55; } }

.demo-notes {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, .74);
  box-shadow: 0 20px 50px rgba(56, 66, 88, .08);
}
.demo-notes h2 { margin: 0 0 12px; font-size: 24px; }
.demo-notes p, .demo-notes li {
  color: #637187;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 750;
}
.demo-notes ul { padding-left: 20px; margin: 12px 0; }
.connection-card {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #435069;
  background: #f3f7ff;
  font-size: 13px;
  font-weight: 900;
}
.code-log-button {
  width: 100%; margin-top: 10px; padding: 11px 14px; border: 0; border-radius: 14px;
  color: #fff; background: #182238; font-weight: 900; cursor: pointer;
}
.code-log-panel {
  position: fixed; z-index: 30; right: 18px; bottom: 18px; width: min(620px, calc(100vw - 36px));
  max-height: min(620px, calc(100vh - 36px)); border: 1px solid #33415f; border-radius: 18px;
  color: #dce9ff; background: rgba(12, 18, 31, .98); box-shadow: 0 24px 70px rgba(0,0,0,.38); overflow: hidden;
}
.code-log-panel[hidden] { display: none; }
.code-log-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #2c3852; }
.code-log-panel header div { display: flex; align-items: center; gap: 9px; }
.code-log-panel header span { color: #8fa5ca; font-size: 11px; }
.code-log-panel button { padding: 7px 10px; border: 0; border-radius: 9px; color: #e9f1ff; background: #2b3853; cursor: pointer; }
.code-log-panel pre { max-height: 520px; margin: 0; padding: 14px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.55 Consolas, "SFMono-Regular", monospace; }
.rtc-stage {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

@media (max-width: 940px) {
  .simulator-area { grid-template-columns: 1fr; }
  .device-wrap { min-height: 560px; }
  .demo-notes { max-width: 560px; margin: 0 auto; }
}

@media (max-width: 560px) {
  .demo-shell { width: min(100% - 18px, 520px); padding-top: 24px; }
  .device-body { width: 390px; height: 390px; }
  .screen-bezel { inset: 75px; }
  .camera { top: 40px; }
  .power-key { top: 112px; }
  .record-key { top: 194px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
