:root {
  --blue: #178df7;
  --blue-deep: #0b74e6;
  --ink: #17324b;
  --muted: #687f95;
  --line: #dce8f3;
  --surface: #fff;
  --success: #087443;
  --danger: #b42318;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #dff1ff; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #dff1ff 0, #edf7ff 55%, #f7fbff 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.app { width: min(100%, 430px); min-height: 100vh; margin: 0 auto; background: #f7fbff; box-shadow: 0 0 40px rgba(18, 84, 132, .12); }
.account-panel { padding: 18px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.account-panel h1 { margin: 0; font-size: 21px; }
.account-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-info > div { min-width: 0; }
.account-info strong { display: block; overflow-wrap: anywhere; font-size: 16px; }
.account-info .btn { flex: 0 0 auto; font-size: 12px; }
.account-caption { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.auth-tabs { display: flex; gap: 6px; padding: 4px; margin: 14px 0; border-radius: 13px; background: #edf5fc; }
.auth-tab { flex: 1; min-height: 42px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-weight: 700; }
.auth-tab.active { color: #0f67b2; background: #fff; box-shadow: 0 2px 6px rgba(18,84,132,.08); }
#authForm label { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 700; }
#authForm input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fbfdff; font-size: 16px; }
#authForm input:focus { outline: 2px solid #83c5ff; outline-offset: 1px; }
#authSubmit, #authRetry { width: 100%; }
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-shell { width: min(100%, 430px); }
.auth-card { padding: 28px 24px; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 16px 48px rgba(18,84,132,.1); }
.auth-shell .session-note { margin: 18px 0 0; padding-bottom: 0; }
@media (max-width: 360px) { .auth-card { padding: 24px 18px; } }
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 1536;
  overflow: hidden;
  background: #bde6ff url("../images/xiaocai-hero.png") center top / cover no-repeat;
}
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 18%; background: linear-gradient(transparent, rgba(247, 251, 255, .9)); pointer-events: none; }
.mic-hotspot { position: absolute; z-index: 3; left: 28%; top: 42%; width: 44%; height: 23%; border: 0; border-radius: 50%; background: transparent; }
.mic-hotspot:focus-visible { outline: 4px solid rgba(255,255,255,.9); outline-offset: 4px; }
.hero.recording::before, .hero.recording::after {
  content: ""; position: absolute; z-index: 2; left: 50%; top: 53.5%; width: 205px; height: 205px;
  transform: translate(-50%, -50%); border: 13px solid rgba(26, 141, 247, .2); border-radius: 50%; animation: pulse 1.05s infinite;
}
.hero.recording::after { width: 245px; height: 245px; border-width: 18px; border-color: rgba(26, 141, 247, .09); animation-delay: .14s; }
@keyframes pulse { 50% { transform: translate(-50%, -50%) scale(1.06); } }
.hero-message {
  position: absolute; z-index: 4; left: 11%; right: 11%; top: 10.5%; padding: 11px 14px; border: 1px solid rgba(220, 236, 247, .95);
  border-radius: 17px; color: #155a91; background: rgba(255,255,255,.94); box-shadow: 0 10px 24px rgba(18,84,132,.13); text-align: center; font-size: 14px; line-height: 1.55;
}
.record-state {
  position: absolute; z-index: 4; left: 50%; bottom: 21px; transform: translateX(-50%); max-width: 88%; padding: 8px 13px;
  border-radius: 999px; color: #fff; background: rgba(16,45,68,.84); font-size: 12px; white-space: nowrap;
}
.content { position: relative; z-index: 5; margin-top: -10px; padding: 0 14px 26px; }
.card { margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 10px 28px rgba(18,84,132,.07); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-title h2 { margin: 0; font-size: 17px; }
.step { display: inline-grid; width: 27px; height: 27px; margin-right: 8px; place-items: center; border-radius: 9px; color: #fff; background: linear-gradient(180deg,var(--blue),var(--blue-deep)); font-size: 13px; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.65; }
.timer { color: var(--danger); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; }
.btn { min-height: 44px; flex: 1 1 125px; padding: 11px 14px; border: 0; border-radius: 14px; font-size: 14px; font-weight: 800; }
.btn-primary { color: #fff; background: linear-gradient(180deg,var(--blue),var(--blue-deep)); box-shadow: 0 5px 12px rgba(23,141,247,.2); }
.btn-secondary { color: #0f67b2; background: #eaf5ff; }
.btn-ghost { color: #42576d; background: #f0f4f8; }
.btn-danger { color: var(--danger); background: #fff1f0; }
.audio-wrap { margin: 12px 0; }
audio { display: block; width: 100%; height: 42px; }
.file-meta { margin-top: 7px; color: var(--muted); font-size: 12px; text-align: center; }
.notice { margin: 10px 0; padding: 10px 12px; border-radius: 13px; background: #edf7ff; color: #155a91; font-size: 13px; line-height: 1.6; }
.notice.error { color: #8a261e; background: #fff1f0; }
.notice.success { color: #09613b; background: #ecfdf3; }
.hidden { display: none !important; }
textarea { width: 100%; min-height: 132px; resize: vertical; padding: 12px 13px; border: 1px solid var(--line); border-radius: 15px; outline: none; color: var(--ink); background: #fbfdff; font-size: 16px; line-height: 1.65; }
textarea:focus { border-color: #83c5ff; box-shadow: 0 0 0 3px #e3f3ff; }
.count { margin: 6px 2px 10px; color: var(--muted); font-size: 12px; text-align: right; }
.receipt { padding: 18px; text-align: center; }
.receipt-icon { display: grid; width: 60px; height: 60px; margin: 0 auto 10px; place-items: center; border-radius: 50%; color: var(--success); background: #e5f8ee; font-size: 31px; font-weight: 900; }
.receipt h2 { margin: 0 0 8px; font-size: 21px; }
.receipt-code { margin: 12px 0; color: var(--success); font-size: 19px; font-weight: 900; letter-spacing: .5px; }
.recent-list { display: grid; gap: 9px; }
.recent-item { padding: 11px 12px; border: 1px solid #e5edf4; border-radius: 14px; background: #fbfdff; }
.recent-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; color: #42617b; font-size: 12px; }
.recent-text { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 13px; line-height: 1.55; }
.session-note { padding: 4px 16px 20px; color: #718397; font-size: 11px; line-height: 1.6; text-align: center; }
@media (min-width: 700px) { body { padding: 24px 0; } .app { min-height: calc(100vh - 48px); border-radius: 26px; overflow: hidden; } }
@media (prefers-reduced-motion: reduce) { .hero.recording::before, .hero.recording::after { animation: none; } }
