/* SpeakPal 儿童护眼主题：暖色低蓝光、柔和对比、偏大字号 */
:root {
  --bg: #f3efe6;
  --bg-elevated: #faf8f4;
  --bg-soft: #f7f3ea;
  --border: rgba(90, 80, 60, 0.12);
  --text: #3a3630;
  --text-secondary: #5a544c;
  --muted: #7a7468;
  --primary: #5a9a8a;
  --primary-dark: #4a8578;
  --primary-soft: #e8f2ef;
  --primary-glow: rgba(90, 154, 138, 0.22);
  --accent-warm: #c4a574;
  --accent-sage: #8fb89e;
  --accent-cream: #ebe4d4;
  --user-bg: #e8eef2;
  --user-border: rgba(106, 130, 150, 0.22);
  --user-text: #3d4a52;
  --tutor-bg: #e8f0ea;
  --tutor-border: rgba(90, 130, 100, 0.22);
  --tutor-text: #3d4a42;
  --correction-bg: #f5f0e0;
  --correction-border: rgba(160, 140, 90, 0.28);
  --correction-text: #5c4a30;
  --danger: #c97a6a;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bg-art-lift: calc(148px + var(--safe-bottom));
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-soft: 0 4px 16px rgba(58, 54, 48, 0.06);
  --shadow-card: 0 2px 10px rgba(58, 54, 48, 0.05);
  --font-base: 1rem;
  --font-chat: 1.06rem;
  --line-body: 1.7;
  --line-tight: 1.55;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--font-base);
  line-height: var(--line-body);
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  display: flex;
  flex-direction: column;
}

.site-beian {
  flex-shrink: 0;
  margin: 0;
  text-align: center;
  padding: 4px 12px calc(4px + env(safe-area-inset-bottom, 0px));
  font-size: 0.72rem;
  color: #a8a098;
  background: #f0ede6;
  border-top: 1px solid var(--border);
}

.site-beian a {
  color: inherit;
  text-decoration: none;
}

.app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  background:
    linear-gradient(180deg, rgba(243, 239, 230, 0.88) 0%, rgba(247, 244, 237, 0.82) 50%, rgba(240, 237, 230, 0.9) 100%),
    url("/static/images/english/strip-1x6.png") center calc(100% - var(--bg-art-lift)) / min(100%, 420px) auto no-repeat;
  background-color: #f3efe6;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 10px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--border);
  background: rgba(250, 248, 244, 0.95);
  z-index: 2;
  box-shadow: var(--shadow-soft);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.home-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text);
  padding: 4px 8px 4px 4px;
  border-radius: 14px;
  transition: background 0.15s ease;
}

.home-logo:hover {
  background: rgba(90, 154, 138, 0.1);
}

.home-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.82rem;
  background: #7a9e94;
  color: #faf8f4;
  flex-shrink: 0;
  box-shadow: none;
}

.home-logo-text {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 7.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 800;
  color: #4a6b62;
  background: var(--accent-cream);
  border: 1px solid rgba(160, 140, 90, 0.2);
  flex-shrink: 0;
}

.brand h1 {
  font-size: 1.1rem;
  line-height: 1.25;
  color: #4a6b62;
  font-weight: 700;
}

.brand-sub {
  margin-top: 2px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: #7a6a52;
}

@media (max-width: 420px) {
  .home-logo-text {
    display: none;
  }

  .brand-sub {
    font-size: 0.82rem;
  }

  .brand {
    padding-left: 10px;
  }
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c5bfb4;
  flex-shrink: 0;
}

.status-dot.ready { background: #7aad8e; }
.status-dot.busy { background: #c4a574; }
.status-dot.error { background: var(--danger); }

.chat {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px 28px;
}

/* ---- Welcome ---- */
.welcome {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.welcome-hero {
  text-align: center;
  margin-bottom: 18px;
}

.welcome-hero-art {
  display: block;
  margin: 0 auto 14px;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(90, 154, 138, 0.12);
  background: var(--bg-soft);
}

.welcome-hero-art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(52vw, 220px);
  object-fit: cover;
  object-position: center bottom;
}

@media (max-width: 767px) {
  .welcome-hero-art img {
    max-height: min(72vw, 280px);
    object-position: center 72%;
  }
}

.welcome-title {
  font-size: 1.32rem;
  font-weight: 700;
  color: #4a5c54;
  margin-bottom: 10px;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.welcome-tagline {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: var(--line-body);
  max-width: 28em;
  margin: 0 auto;
}

.eye-care-tip {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef5f0;
  border: 1px solid rgba(90, 154, 138, 0.18);
  font-size: 0.92rem;
  color: #5a6b62;
  line-height: var(--line-tight);
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.feature-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 6px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  text-align: center;
}

.feature-chip-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.feature-chip-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.2;
}

.welcome-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #eef5f0;
  border: 1px solid rgba(90, 154, 138, 0.2);
  font-size: 0.86rem;
  line-height: 1.55;
  color: #5a6b62;
  text-align: left;
}

.welcome-tip-icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.welcome-tip strong {
  color: #4a6b62;
}

.welcome-cta {
  text-align: center;
  padding: 16px 12px 10px;
  border-radius: 14px;
  background: #f0ebe0;
  border: 1px dashed rgba(160, 140, 90, 0.28);
}

.welcome-cta-mic {
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
  line-height: 1;
}

.welcome-cta p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: var(--line-body);
  font-weight: 600;
}

.welcome-highlights {
  margin-bottom: 16px;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.parent-notes {
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  overflow: hidden;
}

.parent-notes-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.parent-notes-toggle::-webkit-details-marker {
  display: none;
}

.parent-notes-toggle::after {
  content: "▾";
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.parent-notes[open] .parent-notes-toggle::after {
  transform: rotate(180deg);
}

.parent-notes-body {
  padding: 0 10px 12px;
  border-top: 1px solid var(--border);
}

.welcome-highlights-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #6a5a42;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}

.highlight-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.highlight-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.highlight-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  border-radius: 10px;
  background: var(--primary-soft);
}

.highlight-list li div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.highlight-list li strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.highlight-list li span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 380px) {
  .feature-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- Chat messages ---- */
.msg {
  display: flex;
  margin-bottom: 14px;
  animation: fadeUp 0.2s ease;
}

.msg.user { justify-content: flex-end; }
.msg.tutor { justify-content: flex-start; }
.msg.correction { justify-content: flex-start; }

.msg-bubble {
  max-width: 90%;
  padding: 14px 16px;
  border-radius: 18px;
  line-height: var(--line-body);
  font-size: var(--font-chat);
  word-break: break-word;
  letter-spacing: 0.01em;
}

.msg.user .msg-bubble {
  background: var(--user-bg);
  border: 1px solid var(--user-border);
  border-bottom-right-radius: 6px;
  color: var(--user-text);
}

.msg.tutor .msg-bubble {
  background: var(--tutor-bg);
  border: 1px solid var(--tutor-border);
  border-bottom-left-radius: 6px;
  color: var(--tutor-text);
}

/* 口语优先：导师/用户字幕弱化，播放时隐藏文字 */
.msg-text-oral {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
  opacity: 0.82;
}

.msg.tutor-speaking .msg-text-oral,
.msg-bubble.tutor-audio-live .msg-text-oral,
.msg-text-oral.msg-text-held {
  display: none;
}

.msg-text-oral.msg-text-revealed {
  display: block;
  animation: fadeUp 0.25s ease;
}

.tutor-text-placeholder {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.tutor-text-placeholder.hidden {
  display: none;
}

.msg-bubble:has(.tutor-text-placeholder:not(.hidden)) {
  border-color: rgba(90, 154, 138, 0.28);
  padding: 14px 16px;
  min-width: 148px;
}

.tutor-audio-panel {
  display: none;
  align-items: center;
  gap: 12px;
}

.msg-bubble.tutor-audio-live .tutor-audio-panel {
  display: flex;
}

.tutor-listen-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #4a6b62;
  letter-spacing: 0.02em;
}

.msg-speaker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #5a8a72;
  background: rgba(90, 154, 138, 0.12);
  flex-shrink: 0;
  opacity: 0.5;
}

.msg-speaker.active {
  width: 56px;
  height: 56px;
  opacity: 1;
  color: #4a7a62;
  background: rgba(90, 154, 138, 0.22);
  box-shadow: 0 0 0 4px rgba(90, 154, 138, 0.1);
  animation: speakerPulse 1.4s ease-in-out infinite;
}

.msg-speaker-icon {
  width: 16px;
  height: 16px;
}

.msg-speaker.active .msg-speaker-icon {
  width: 30px;
  height: 30px;
}

.msg-speaker-wave {
  opacity: 0.35;
}

.msg-speaker.active .msg-speaker-wave {
  animation: speakerWave 1.1s ease-in-out infinite;
}

.msg-speaker.active .wave-2 {
  animation-delay: 0.18s;
}

.msg.tutor-speaking .msg-bubble,
.msg-bubble.tutor-audio-live {
  border-color: rgba(90, 154, 138, 0.4);
  padding: 16px 18px;
  min-width: 168px;
}

.msg.user .msg-tag {
  font-size: 0.72rem;
}

.msg.partial .msg-bubble {
  opacity: 0.9;
}

@keyframes speakerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.msg.correction .msg-bubble {
  background: var(--correction-bg);
  border: 1px solid var(--correction-border);
  border-bottom-left-radius: 6px;
  font-size: 0.98rem;
  color: var(--correction-text);
}

.msg-tag {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.msg.photo .msg-bubble {
  padding: 10px;
  background: var(--user-bg);
  border: 1px solid var(--user-border);
  border-bottom-right-radius: 6px;
  max-width: 72%;
}

.msg.photo {
  justify-content: flex-end;
}

.msg.photo img {
  display: block;
  width: 100%;
  max-width: 220px;
  border-radius: 12px;
}

/* ---- Dock ---- */
.interrupt-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 420px);
  margin: 0 auto 10px;
  padding: 11px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff8e8 0%, #eef8f2 100%);
  border: 1px solid rgba(196, 165, 116, 0.35);
  box-shadow: var(--shadow-card);
  animation: interruptPop 0.35s ease;
}

.interrupt-banner.hidden {
  display: none;
}

.interrupt-banner-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: rgba(90, 154, 138, 0.16);
  animation: interruptWave 1.6s ease-in-out infinite;
}

.interrupt-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.interrupt-banner-text strong {
  color: #5a7a62;
  font-size: 0.92rem;
}

@keyframes interruptPop {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes interruptWave {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.btn-talk.speaking:not(:disabled) {
  background: #c4a574;
  box-shadow: 0 0 0 4px rgba(196, 165, 116, 0.22);
}

.dock-oral-hint {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
  margin: 0 auto;
  width: min(100%, 420px);
}

.dock {
  position: relative;
  padding: 12px 16px calc(16px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: rgba(250, 248, 244, 0.96);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  box-shadow: 0 -2px 12px rgba(58, 54, 48, 0.04);
}

.dock-actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: min(100%, 420px);
  margin: 0 auto;
}

.btn-photo {
  flex: 0 0 80px;
  border: 1px solid rgba(90, 154, 138, 0.28);
  border-radius: 18px;
  background: var(--primary-soft);
  color: #4a6b62;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.88rem;
  font-weight: 700;
  min-height: 72px;
}

.btn-photo-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.btn-photo:disabled {
  opacity: 0.5;
}

.btn-photo:not(:disabled):active {
  background: #dceae4;
}

.photo-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--primary-soft);
  border: 1px solid rgba(90, 154, 138, 0.22);
}

.photo-bar.hidden {
  display: none;
}

.photo-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--accent-cream);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.photo-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.photo-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #4a6b62;
}

.photo-hint {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: var(--line-tight);
}

.btn-photo-clear {
  border: none;
  background: transparent;
  color: #5a8a72;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 10px;
  white-space: nowrap;
}

.btn-talk {
  flex: 1;
  min-height: 72px;
  border: none;
  border-radius: 999px;
  background: #6a9e8e;
  color: #faf8f4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.12s ease, opacity 0.12s ease;
  user-select: none;
  touch-action: none;
}

.btn-talk:disabled {
  opacity: 0.5;
}

.btn-talk:not(:disabled):active,
.btn-talk.recording {
  transform: scale(0.98);
  background: #5a8e7e;
}

.btn-talk.speaking:not(:disabled):active {
  background: #b08858;
}

.btn-talk-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.btn-talk-label {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-talk-hint {
  font-size: 0.82rem;
  opacity: 0.92;
}

.btn-stop {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  background: #f5ebe8;
  color: #8a5a50;
  border: 1px solid rgba(160, 100, 90, 0.22);
  font-size: 0.92rem;
  font-weight: 600;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(243, 239, 230, 0.85);
  display: grid;
  place-items: center;
  z-index: 20;
}

.overlay.hidden,
.btn-stop.hidden,
.toast.hidden,
.btn-account.hidden,
.login-overlay.hidden,
.phone-login-form.hidden,
.wechat-login-tip.hidden,
.login-input-group.hidden,
.login-btn.hidden,
.login-error.hidden {
  display: none;
}

.overlay-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  text-align: center;
  max-width: 80vw;
  color: var(--text);
  font-size: 1.02rem;
  line-height: var(--line-body);
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  border: 3px solid rgba(90, 154, 138, 0.15);
  border-top-color: #6a9e8e;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(120px + var(--safe-bottom));
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: var(--line-tight);
  z-index: 30;
  box-shadow: var(--shadow-soft);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes speakerWave {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.85; }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-account {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: #5a7a72;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.btn-account:active {
  background: var(--primary-soft);
}

/* ---- 登录弹窗 ---- */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(243, 239, 230, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px 22px 24px;
  box-shadow: var(--shadow-soft);
  animation: fadeUp 0.25s ease;
}

.login-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.login-close:hover {
  color: #5a7a72;
  background: var(--primary-soft);
}

.login-logo {
  text-align: center;
  margin-bottom: 22px;
}

.login-logo-mark {
  width: 120px;
  height: 68px;
  margin: 0 auto 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(90, 154, 138, 0.15);
  box-shadow: var(--shadow-card);
}

.login-logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
}

.login-logo-text {
  font-size: 1.28rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #4a5c54;
}

.login-slogan {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: var(--line-body);
}

.wechat-login-tip {
  text-align: center;
  padding: 8px 0 4px;
}

.wechat-loading {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.wechat-spin {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(90, 154, 138, 0.15);
  border-top-color: #6a9e8e;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.wechat-tip-text {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
  line-height: var(--line-tight);
}

.wechat-tip-sub {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: var(--line-body);
}

.login-warn {
  color: #9a5a50;
}

.login-form-title {
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  color: #4a5c54;
}

.login-input-group {
  margin-bottom: 16px;
}

.login-label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.login-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.login-input-wrap:focus-within {
  border-color: rgba(90, 154, 138, 0.4);
  background: var(--bg-elevated);
}

.login-input-prefix {
  padding: 0 12px;
  font-size: 0.95rem;
  color: var(--muted);
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.login-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 14px 12px;
  font-size: 1.02rem;
  color: var(--text);
}

.login-input::placeholder {
  color: #a8a098;
}

.resend-btn {
  padding: 0 12px;
  font-size: 0.88rem;
  color: #5a8a72;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.resend-btn:disabled {
  color: #a8a098;
  cursor: default;
}

.login-error {
  font-size: 0.88rem;
  color: #8a5a50;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #f5ebe8;
  border-radius: 12px;
  border: 1px solid rgba(160, 100, 90, 0.18);
  line-height: var(--line-tight);
}

.login-btn {
  width: 100%;
  padding: 15px;
  background: #6a9e8e;
  color: #faf8f4;
  border: none;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
}

.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-btn:not(:disabled):active {
  transform: scale(0.98);
  background: #5a8e7e;
}

.login-agreement {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: var(--line-body);
}

@media (min-width: 768px) {
  .app {
    --bg-art-lift: calc(128px + var(--safe-bottom));
    background:
      linear-gradient(180deg, rgba(243, 239, 230, 0.9) 0%, rgba(247, 244, 237, 0.84) 50%, rgba(240, 237, 230, 0.92) 100%),
      url("/static/images/english/hero-16x9.png") center calc(100% - var(--bg-art-lift)) / min(92%, 640px) auto no-repeat;
    background-color: #f3efe6;
  }

  .welcome-hero-art img {
    max-height: 240px;
  }

  html, body {
    font-size: 1.02rem;
  }

  .btn-talk {
    min-height: 68px;
  }

  .dock {
    padding-bottom: 20px;
  }

  .welcome {
    padding: 24px 22px 20px;
  }

  .feature-strip {
    gap: 12px;
  }

  .msg-bubble {
    font-size: 1.08rem;
  }

  .msg-speaker.active {
    width: 60px;
    height: 60px;
  }

  .msg-speaker.active .msg-speaker-icon {
    width: 32px;
    height: 32px;
  }
}

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