:root {
  --paper: #f7f3e8;
  --paper-2: #efe8d8;
  --ink: #17150f;
  --ink-soft: #5f5a4e;
  --line: #d9d0bd;
  --red: #b23a2e;
  --red-soft: #f1ded9;
  --green: #3f6b4f;
  --shadow: 0 18px 50px rgba(45, 38, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 255, 255, 0.7), transparent 42%),
    radial-gradient(circle at 85% 92%, rgba(178, 58, 46, 0.06), transparent 38%),
    repeating-linear-gradient(0deg, rgba(23, 21, 15, 0.018) 0 1px, transparent 1px 4px),
    var(--paper);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--red);
  font-weight: 600;
}

h1 {
  margin: 6px 0 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9a227;
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.12);
}

.dot.online {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(63, 107, 79, 0.13);
}

.dot.offline {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(178, 58, 46, 0.13);
}

.stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 50% 16%, rgba(255, 255, 255, 0.85), transparent 52%),
    linear-gradient(180deg, #efe7d5 0%, #e4d9c2 100%);
  box-shadow: var(--shadow);
  padding: 22px 18px 14px;
}

.avatar {
  position: relative;
  width: 190px;
  height: 205px;
  margin: 0 auto;
}

.avatar-head {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 132px;
  height: 150px;
  transform: translateX(-50%);
}

.hair {
  position: absolute;
  inset: -4px 10px 44px;
  border-radius: 70px 70px 34px 34px;
  background: #2c2923;
}

.face {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 18px;
  bottom: 0;
  border-radius: 52% 52% 46% 46%;
  background: linear-gradient(160deg, #e8c6a8 0%, #d9b08c 100%);
  box-shadow: inset 0 -10px 20px rgba(122, 81, 50, 0.12);
}

.brow {
  position: absolute;
  top: 38px;
  width: 26px;
  height: 4px;
  border-radius: 4px;
  background: #4a3a2c;
  opacity: 0.7;
}

.brow.left {
  left: 20px;
  transform: rotate(-4deg);
}

.brow.right {
  right: 20px;
  transform: rotate(4deg);
}

.eyes {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 26px;
}

.eyes span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2c2923;
  animation: blink 4.8s infinite;
}

.mouth {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: 30px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 0 0 12px 12px;
  background: #8c4a3c;
  transition: height 0.12s ease;
}

.avatar.speaking .mouth {
  animation: talk 0.28s infinite alternate ease-in-out;
}

.avatar.thinking .mouth {
  height: 4px;
  width: 22px;
}

.shoulders {
  position: absolute;
  left: 50%;
  bottom: -26px;
  width: 178px;
  height: 96px;
  transform: translateX(-50%);
  border-radius: 50% 50% 12px 12px;
  background: linear-gradient(180deg, #3f4a44 0%, #2c3531 100%);
}

.mock-badge {
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(23, 21, 15, 0.18);
  border-radius: 999px;
  background: rgba(247, 243, 232, 0.78);
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(4px);
}

.baidu-avatar {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
  border-radius: 16px;
  background: #14120f;
}

.baidu-avatar[hidden],
.avatar[hidden] {
  display: none;
}

.stage-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 34px;
  color: var(--ink-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.stage.has-baidu .stage-meta {
  margin-top: 14px;
}

.question-card {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 4px 14px 14px 4px;
  background: rgba(255, 253, 247, 0.78);
}

.label {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--red);
  margin-bottom: 6px;
}

.question-card p {
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
}

.transcript {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  max-height: 260px;
  overflow-y: auto;
  padding: 18px 2px 8px;
  scroll-behavior: smooth;
}

.bubble {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  animation: rise 0.18s ease-out;
}

.bubble.interviewer {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
  background: #fffdf7;
}

.bubble.student {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  background: var(--ink);
  color: var(--paper);
}

.bubble.system {
  align-self: center;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
}

.composer {
  display: flex;
  gap: 9px;
  margin-top: 8px;
}

.composer input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf7;
  color: var(--ink);
  font-size: 15px;
  outline: none;
}

.composer input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(178, 58, 46, 0.1);
}

button {
  height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary {
  background: var(--red);
  color: #fff8ef;
}

.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}

.danger {
  background: transparent;
  border-color: rgba(178, 58, 46, 0.35);
  color: var(--red);
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.hint {
  margin: 18px 2px 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.summary {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 21, 15, 0.42);
  backdrop-filter: blur(4px);
  z-index: 20;
}

.summary[hidden] {
  display: none;
}

.summary-card {
  width: min(100%, 380px);
  padding: 26px 24px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(23, 21, 15, 0.28);
  animation: rise 0.22s ease-out;
}

.score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 8px 0 14px;
  font-family: "Songti SC", "STSong", serif;
  font-variant-numeric: tabular-nums;
}

.score span {
  font-size: 58px;
  line-height: 1;
  color: var(--red);
}

.score small {
  color: var(--ink-soft);
  font-size: 13px;
}

.summary-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

.cost {
  margin: 14px 0 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.summary-card .primary {
  width: 100%;
}

@keyframes talk {
  from {
    height: 5px;
    width: 26px;
  }
  to {
    height: 15px;
    width: 34px;
  }
}

@keyframes blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  95% {
    transform: scaleY(0.1);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 620px) {
  .app {
    padding-top: 44px;
  }

  .stage {
    padding-top: 28px;
  }

  .avatar {
    transform: scale(1.08);
    transform-origin: bottom center;
  }
}

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

/* ------------------------------------------------------------------ call UI */
.is-hidden {
  display: none !important;
}

.call-body {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(63, 107, 79, 0.2), transparent 55%),
    #0d100d;
  color: #f5efe2;
  overflow: hidden;
}

.call-app {
  width: min(100%, 560px);
  height: 100dvh;
  margin: 0 auto;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
}

.call-topbar {
  margin-bottom: 10px;
  align-items: center;
}

.caller h1 {
  font-size: 26px;
  color: #f5efe2;
}

.caller .eyebrow {
  color: #c9a86a;
}

.call-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: rgba(245, 239, 226, 0.62);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.call-sub .sep {
  opacity: 0.45;
}

.call-progress {
  color: rgba(245, 239, 226, 0.62);
  font-size: 12px;
  white-space: nowrap;
}

.call-stage {
  flex: 1;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-color: rgba(255, 255, 255, 0.09);
  background:
    radial-gradient(ellipse at 50% 28%, rgba(255, 255, 255, 0.08), transparent 58%),
    linear-gradient(180deg, #1a211a 0%, #101510 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.call-stage .avatar {
  transform: scale(1.34);
  transform-origin: center bottom;
  margin-top: 10px;
}

.call-stage .baidu-avatar {
  width: min(100%, 340px, 34.5vh);
  height: auto;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: 20px;
  background: #070907;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

.voice-stage {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-bottom: 38px;
}

.voice-stage[hidden] {
  display: none !important;
}

.voice-orb {
  position: relative;
  width: 186px;
  height: 186px;
  display: grid;
  place-items: center;
}

.voice-avatar {
  position: relative;
  z-index: 2;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.16), transparent 50%),
    linear-gradient(160deg, #405247, #222b25);
  color: #f7f2e7;
  font-family: "Songti SC", "STSong", serif;
  font-size: 46px;
  box-shadow:
    0 0 0 10px rgba(63, 107, 79, 0.12),
    0 18px 50px rgba(0, 0, 0, 0.35);
}

.voice-ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(201, 168, 106, 0.3);
  opacity: 0;
  transform: scale(0.82);
}

.voice-stage.listening .ring-1 {
  opacity: 0.5;
  animation: voiceRing 3.2s ease-out infinite;
}

.voice-stage.speaking .voice-ring {
  border-color: rgba(201, 168, 106, 0.5);
  animation: voiceRing 1.5s ease-out infinite;
}

.voice-stage.speaking .ring-2 {
  animation-delay: 0.5s;
}

.voice-stage.speaking .ring-3 {
  animation-delay: 1s;
}

.voice-name {
  color: #f7f2e7;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.voice-hint {
  color: rgba(245, 239, 226, 0.5);
  font-size: 11px;
}

.voice-bars {
  height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.55;
}

.voice-bars i {
  width: 3px;
  height: 5px;
  border-radius: 3px;
  background: #c9a86a;
  transition: height 0.2s ease;
}

.voice-stage.speaking .voice-bars i {
  animation: voiceBar 0.62s ease-in-out infinite alternate;
}

.voice-stage.speaking .voice-bars i:nth-child(2) { animation-delay: 0.1s; }
.voice-stage.speaking .voice-bars i:nth-child(3) { animation-delay: 0.2s; }
.voice-stage.speaking .voice-bars i:nth-child(4) { animation-delay: 0.05s; }
.voice-stage.speaking .voice-bars i:nth-child(5) { animation-delay: 0.24s; }
.voice-stage.speaking .voice-bars i:nth-child(6) { animation-delay: 0.14s; }
.voice-stage.speaking .voice-bars i:nth-child(7) { animation-delay: 0.3s; }

@keyframes voiceRing {
  0% { opacity: 0.45; transform: scale(0.82); }
  70% { opacity: 0.12; }
  100% { opacity: 0; transform: scale(1.22); }
}

@keyframes voiceBar {
  from { height: 4px; }
  to { height: 20px; }
}

.caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 46px;
  min-height: 24px;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(8, 10, 8, 0.58);
  color: #f7f2e7;
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.subcaption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 14px;
  min-height: 16px;
  color: rgba(245, 239, 226, 0.55);
  font-size: 11px;
  text-align: center;
  pointer-events: none;
}

.call-controls {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0 4px;
}

.control {
  width: 62px;
  height: 62px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1d241d;
  color: #f5efe2;
  font-size: 10px;
  font-weight: 500;
}

.control .ico {
  font-size: 20px;
  line-height: 1;
}

.control.ghost {
  background: transparent;
  color: rgba(245, 239, 226, 0.7);
}

.control.hangup {
  background: var(--red);
  border-color: transparent;
  color: #fff8ef;
}

.control.on {
  background: #3f6b4f;
  border-color: transparent;
}

.control:disabled {
  opacity: 0.4;
}

.call-app .composer {
  margin-top: 8px;
}

.call-app .composer input {
  height: 42px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f5efe2;
}

.call-app .composer input::placeholder {
  color: rgba(245, 239, 226, 0.4);
}

.call-app .composer .primary {
  height: 42px;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(63, 107, 79, 0.28), transparent 55%),
    rgba(8, 10, 8, 0.92);
  backdrop-filter: blur(6px);
}

.gate[hidden] {
  display: none;
}

.gate-card {
  width: min(100%, 360px);
  text-align: center;
}

.gate-card h1 {
  color: #f7f2e7;
  font-size: 32px;
  margin: 10px 0 8px;
}

.gate-sub {
  margin: 0 0 26px;
  color: rgba(245, 239, 226, 0.62);
  font-size: 13px;
}

.gate-avatar {
  width: 112px;
  height: 112px;
  margin: 0 auto 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(160deg, #3f4a44, #232c27);
  color: #f7f2e7;
  font-family: "Songti SC", "STSong", serif;
  font-size: 44px;
  box-shadow: 0 0 0 10px rgba(63, 107, 79, 0.1);
}

.gate-start {
  width: 100%;
  height: 52px;
  font-size: 16px;
}

.gate-note {
  margin: 14px 0 0;
  color: rgba(245, 239, 226, 0.4);
  font-size: 11px;
}

@media (max-width: 420px) {
  .call-app {
    padding: 14px 12px 10px;
  }

  .call-stage .baidu-avatar {
    width: min(100%, 300px, 32vh);
  }

  .call-controls {
    gap: 12px;
  }

  .control {
    width: 56px;
    height: 56px;
  }

  .control .ico {
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  .call-controls {
    gap: 8px;
  }

  .control {
    width: 50px;
    height: 50px;
  }

  .control .ico {
    font-size: 17px;
  }

  .control small {
    font-size: 9px;
  }
}
