@font-face {
  font-family: "Geist";
  src: url("Geist-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: block;
}

:root {
  --paper: #F4EFF0;
  --card: #FFFFFF;
  --ink: #18161B;
  --ink-2: #5F5C66;
  --ink-3: #9A97A1;
  --ink-4: #C9C7CE;
  --hair: rgba(24, 22, 27, .12);
  --rose: #D9325F;
  --rose-deep: #B8244C;
  --rose-wash: rgba(217, 50, 95, .09);
  --on-rose: #FFF5F7;
  --on-rose-2: rgba(255, 245, 247, .72);
  --on-rose-3: rgba(255, 245, 247, .42);
  --canvas: #E7E1E4;

  --you: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --its: "Songti SC", "STSong", "Noto Serif SC", serif;
  --ui: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --num: "Geist", "PingFang SC", sans-serif;

  --g: 24px;
  --out: cubic-bezier(.2, .8, .2, 1);
  --in: cubic-bezier(.55, 0, .75, .25);
  /* 滑入：刚度 260 / 阻尼 24 积分出的弹簧 */
  --spring: linear(0, .06 2%, .22 5%, .5 10.5%, .74 17%, .89 24%, .97 32%, 1.006 41%, 1.012 50%, 1.004 66%, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-break: strict;
  text-spacing-trim: trim-start;
  text-autospace: normal;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: rgba(217, 50, 95, .2); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.nb { white-space: nowrap; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- stage (desktop canvas) ---------- */
.stage {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 56px;
  padding: 28px 0;
}
.screen {
  grid-column: 2;
  position: relative;
  width: 390px;
  height: 844px;
  overflow: hidden;
  background: var(--paper);
  border-radius: 48px;
  isolation: isolate;
  box-shadow:
    0 0 0 .5px rgba(24, 22, 27, .08),
    0 2px 4px rgba(42, 30, 52, .06),
    0 30px 70px -30px rgba(42, 30, 52, .32);
}
body.embed { background: var(--paper); }
body.embed .stage { display: block; padding: 0; }
body.embed .screen { border-radius: 0; box-shadow: none; }
body.embed .switcher { display: none; }
@media (max-width: 560px) {
  body { background: var(--paper); }
  .stage { display: block; padding: 0; }
  .screen { width: 100vw; height: 100dvh; min-height: 700px; border-radius: 0; box-shadow: none; }
  .switcher { display: none; }
}

/* ---------- flood: the whole screen is the recording light ---------- */
.flood {
  position: absolute; inset: 0; z-index: 0;
  background: var(--rose);
  clip-path: circle(0px at var(--fx, 195px) var(--fy, 762px));
  transition: clip-path 560ms var(--out);
  pointer-events: none;
}
[data-state="listen"] .flood { clip-path: circle(var(--fr, 1000px) at var(--fx, 195px) var(--fy, 762px)); }
.flood.leaving { transition: clip-path 440ms cubic-bezier(.5, 0, .7, .4); }

/* ---------- top row ---------- */
.top {
  position: absolute; z-index: 3; left: 0; right: 0; top: 52px;
  height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 0 var(--g);
}
.status { position: relative; height: 22px; flex: 1; }
.status > span {
  position: absolute; left: 0; top: 0; height: 22px;
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; letter-spacing: 0;
  opacity: 0; transform: translateY(4px);
  transition: opacity 220ms var(--out), transform 220ms var(--out);
}
[data-state="idle"] .status .s-idle,
[data-state="listen"] .status .s-listen,
[data-state="think"] .status .s-think,
[data-state="answer"] .status .s-answer { opacity: 1; transform: none; transition-delay: 120ms; }
.status .meta { font-weight: 400; color: var(--ink-3); }
.s-listen { color: var(--on-rose); }
.s-listen .meta { color: var(--on-rose-2); }
.brand-mark { width: 22px; height: 22px; color: var(--rose); }
.rec-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--on-rose);
  animation: rec 1.6s ease-in-out infinite;
}
@keyframes rec { 50% { opacity: .35; } }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background-color 160ms, color 160ms, transform 120ms;
}
.icon-btn:hover { background: rgba(24, 22, 27, .06); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 22px; height: 22px; }
[data-state="listen"] .top .icon-btn { color: var(--on-rose-2); }
[data-state="listen"] .top .icon-btn:hover { background: rgba(255, 245, 247, .12); color: var(--on-rose); }

/* ---------- dock ---------- */
.dock {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 34px;
  height: 108px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 calc(var(--g) - 10px);
}
.dock .side { display: flex; align-items: center; }
.dock .side.r { justify-content: flex-end; }
.dock .side .icon-btn { width: 48px; height: 48px; }
.dock .side .txt-btn {
  height: 44px; padding: 0 10px; border-radius: 22px;
  font-size: 15px; color: var(--on-rose-2);
  transition: color 160ms, background-color 160ms;
}
.dock .side .txt-btn:hover { color: var(--on-rose); background: rgba(255, 245, 247, .12); }
.main-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.main-btn {
  position: relative;
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--rose); color: var(--on-rose);
  box-shadow: 0 1px 1px rgba(120, 18, 48, .18), 0 10px 24px -10px rgba(185, 36, 76, .55);
  transition: background-color 280ms var(--out), box-shadow 280ms var(--out), transform 140ms var(--out), width 320ms var(--out), height 320ms var(--out);
}
[data-state="idle"] .main-btn:hover, [data-state="answer"] .main-btn:hover { background: var(--rose-deep); }
[data-state="listen"] .main-btn:hover { background: #FFE6EC; }
[data-state="think"] .main-btn:hover { background: #2E2A33; }
.main-btn:active { transform: scale(.96); }
.main-btn svg { width: 26px; height: 26px; }
.main-btn .g { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: scale(.7); transition: opacity 180ms, transform 240ms var(--out); }
[data-state="idle"] .main-btn .g-mic,
[data-state="answer"] .main-btn .g-mic,
[data-state="listen"] .main-btn .g-stop,
[data-state="think"] .main-btn .g-stop { opacity: 1; transform: none; }
.g-stop i { width: 22px; height: 22px; border-radius: 6px; background: var(--rose); display: block; transition: background-color 280ms var(--out), width 280ms var(--out), height 280ms var(--out); }
[data-state="think"] .g-stop i { background: var(--on-rose); width: 18px; height: 18px; border-radius: 5px; }
[data-state="listen"] .main-btn { background: var(--on-rose); box-shadow: 0 10px 28px -12px rgba(90, 8, 34, .45); }
[data-state="think"] .main-btn { background: var(--ink); box-shadow: 0 10px 24px -12px rgba(24, 22, 27, .5); }
[data-state="answer"] .main-btn { width: 60px; height: 60px; }
@keyframes spin { to { transform: rotate(360deg); } }
.main-label {
  position: relative; height: 18px; width: 120px; text-align: center;
  font-size: 13px; color: var(--ink-2);
}
.main-label span { position: absolute; inset: 0; opacity: 0; transition: opacity 200ms; }
[data-state="idle"] .main-label .l-idle,
[data-state="listen"] .main-label .l-listen,
[data-state="think"] .main-label .l-think,
[data-state="answer"] .main-label .l-answer { opacity: 1; }
[data-state="listen"] .main-label { color: var(--on-rose-2); }

/* ---------- layers ---------- */
.layer {
  position: absolute; z-index: 2; left: 0; right: 0;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 260ms var(--out), visibility 0s 260ms;
}
[data-state="idle"] .layer[data-on~="idle"],
[data-state="listen"] .layer[data-on~="listen"],
[data-state="think"] .layer[data-on~="think"],
[data-state="answer"] .layer[data-on~="answer"] {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 320ms var(--out) 80ms, visibility 0s;
}

/* idle: greeting + still line + suggestions */
.score.its.big { top: 118px; }
.its.big .row { height: 72px; }
.its.big .lane { height: 26px; }
.its.big .words { padding-top: 26px; font-size: 32px; line-height: 46px; letter-spacing: -.01em; }
.its.big .row + .row .words { color: var(--ink-3); }
.its.big .row + .row .ink-line { stroke: var(--ink-3); }
.still { top: 288px; height: 40px; }
.still svg { width: 100%; height: 40px; overflow: visible; }
.still .base { stroke: var(--rose); stroke-opacity: .55; stroke-width: 1.25; fill: none; stroke-linecap: round; }
.still .rule { stroke: var(--ink); stroke-opacity: .12; stroke-width: 1; fill: none; }
.still .pen { fill: var(--rose); }
.still .pen-ring { fill: none; stroke: var(--rose); stroke-width: 1; transform-box: fill-box; transform-origin: center; animation: ring 2.4s var(--out) infinite; }
@keyframes ring { 0% { transform: scale(.6); opacity: .7; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
.suggest { top: auto; bottom: 196px; padding: 0 var(--g); }
.suggest h2 { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-bottom: 6px; }
.suggest ul { list-style: none; }
.suggest li + li { border-top: .5px solid var(--hair); }
.suggest button {
  width: 100%; min-height: 56px; padding: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  text-align: left; font-family: var(--you); font-size: 17px; font-weight: 400; color: var(--ink);
  transition: color 160ms;
}
.suggest button:hover { color: var(--rose-deep); }
.suggest button .k { font-family: var(--ui); font-size: 13px; color: var(--ink-3); white-space: nowrap; }

/* ---------- the score: words with a pitch lane above ---------- */
.score { padding: 0 var(--g); }
.row { position: relative; }
.lane { position: absolute; left: calc(var(--g) * -1); top: 0; width: calc(100% + var(--g) * 2); overflow: visible; }
.words { position: relative; white-space: nowrap; }
.ch { transition: opacity 240ms var(--out), color 360ms var(--out); }
.ch.pend { opacity: 0; }
.ch.prov { opacity: .5; }

.score.you { top: 136px; }
.you .row { height: 76px; }
.you .lane { height: 32px; }
.you .words {
  padding-top: 32px; font-family: var(--you); font-weight: 300;
  font-size: min(28px, calc((100vw - 48px) / 12.1)); line-height: 44px; letter-spacing: .01em; color: var(--ink);
}
[data-state="listen"] .you .words { color: var(--on-rose); }
.you .ribbon { fill: var(--on-rose); transition: opacity 300ms var(--out), fill 300ms var(--out); }
.you .pen-dot { fill: var(--on-rose); }
.you .pen-ring { fill: none; stroke: var(--on-rose); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; animation: ring 1.4s var(--out) infinite; }
[data-state="think"] .you .ribbon { fill: var(--rose); }
.you .bracket { fill: none; stroke: var(--rose); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.you .tag {
  position: absolute; top: 0; height: 18px;
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; line-height: 18px; font-weight: 500; color: var(--rose-deep); white-space: nowrap;
  opacity: 0; transform: translateY(3px);
  transition: opacity 260ms var(--out), transform 260ms var(--out);
}
.you .tag .from { font-weight: 400; color: var(--ink-3); }
.you .tag.on { opacity: 1; transform: none; }
.you .ch.dim { color: var(--ink-3); }

.hint {
  top: 616px; padding: 0 var(--g); text-align: center;
  font-size: 13px; color: var(--on-rose-2);
}

/* ---------- think: what it is doing ---------- */
.steps { top: 462px; padding: 0 var(--g); }
.step { display: grid; grid-template-columns: 26px 1fr; align-items: start; padding: 9px 0; }
.step .ic { width: 18px; height: 22px; display: grid; place-items: center; color: var(--ink-3); }
.step .ic svg { width: 16px; height: 16px; }
.step p { font-size: 15px; line-height: 22px; color: var(--ink-2); }
.step p b { font-weight: 500; color: var(--ink); }
.step.now p { color: var(--ink); }
.step.todo p { color: var(--ink-3); }
.step .spin { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink-4); border-top-color: var(--ink); animation: spin .9s linear infinite; }
.step .ring { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink-4); }
.step { opacity: 0; transform: translateY(6px); transition: opacity 260ms var(--out), transform 260ms var(--out); }
.step.on { opacity: 1; transform: none; }

.avail { grid-column: 2; margin-top: 10px; }
.avail .who { display: grid; grid-template-columns: 48px 1fr; align-items: center; height: 18px; }
.avail .who + .who { margin-top: 5px; }
.avail .who span { font-size: 12px; color: var(--ink-3); }
.avail .bar { position: relative; height: 8px; border-radius: 2px; background: rgba(24, 22, 27, .05); overflow: hidden; }
.avail .busy { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--ink-4); }
.avail { position: relative; }
.avail .slot {
  position: absolute; top: -6px; bottom: 16px;
  left: calc(48px + (100% - 48px) * var(--l) - 3px); width: calc((100% - 48px) * var(--w) + 6px);
  border-radius: 5px; border: 1.5px solid var(--ink);
  transform-origin: center; transform: scaleY(.7); opacity: 0;
  transition: opacity 240ms var(--out), transform 420ms var(--spring);
}
.avail.found .slot { opacity: 1; transform: none; }
.avail .axis { position: relative; height: 16px; margin: 6px 0 0 48px; }
.avail .axis span { position: absolute; top: 0; transform: translateX(-50%); font-family: var(--num); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- answer: its words + result ---------- */
.quote {
  top: 112px; padding: 0 var(--g);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; line-height: 20px; color: var(--ink-3);
}
.quote svg { flex: none; width: 22px; height: 12px; }
.quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score.its { top: 150px; }
.its .row { height: 56px; }
.its .lane { height: 22px; }
.its .words { padding-top: 22px; font-family: var(--its); font-size: 23px; line-height: 34px; color: var(--ink); }
.its .ch.later { color: var(--ink-4); }
.its .ink-line { fill: none; stroke: var(--ink); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.its .ink-line.later { stroke: var(--ink-4); stroke-dasharray: 0.5 4; stroke-width: 1.5; }
.its .pen-dot { fill: var(--ink); }

/* result card */
.result { top: auto; bottom: 156px; padding: 0 12px; }
.card {
  background: var(--card); border-radius: 28px; padding: 20px 20px 16px;
  box-shadow: 0 0 0 .5px rgba(24, 22, 27, .06), 0 1px 2px rgba(42, 30, 52, .05), 0 18px 40px -22px rgba(42, 30, 52, .28);
  transform: translateY(48px); opacity: 0;
  transition: transform 520ms var(--spring), opacity 260ms var(--out);
}
.result.up .card { transform: none; opacity: 1; }
.card .done { display: flex; align-items: center; gap: 7px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.card .done svg { width: 16px; height: 16px; color: var(--ink); }
.card h3 { margin-top: 12px; font-size: 19px; line-height: 26px; font-weight: 500; }
.card .when { margin-top: 12px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.card .time { margin-top: 2px; font-family: var(--num); font-size: 40px; line-height: 48px; font-weight: 380; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.card .time .dash { color: var(--ink-3); font-weight: 300; padding: 0 .08em; }
.card .where { margin-top: 12px; padding-top: 12px; border-top: .5px solid var(--hair); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card .room { font-size: 14px; line-height: 20px; color: var(--ink-2); }
.card .room b { font-weight: 500; color: var(--ink); }
.faces { display: flex; }
.faces i {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-size: 12px; font-weight: 500; color: var(--ink);
  background: #EFE9EC; box-shadow: 0 0 0 2px var(--card);
}
.faces i + i { margin-left: -6px; }
.faces i.me { background: var(--ink); color: var(--card); }
.card .acts { margin-top: 16px; display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; }
.card .acts button {
  height: 46px; border-radius: 23px; padding: 0 18px;
  font-size: 15px; font-weight: 500;
  transition: background-color 160ms, transform 120ms, color 160ms;
}
.card .acts button:active { transform: scale(.97); }
.card .acts .undo { color: var(--ink-2); padding: 0 12px; margin-left: -12px; }
.card .acts .undo:hover { color: var(--ink); background: rgba(24, 22, 27, .05); }
.card .acts .edit { background: #F3EEF0; color: var(--ink); }
.card .acts .edit:hover { background: #EAE4E7; }
.card .acts .ok { background: var(--ink); color: var(--card); }
.card .acts .ok:hover { background: #2C2931; }
.mark { box-shadow: inset 0 -2px 0 transparent; transition: box-shadow 600ms var(--out); }
.echo .mark { box-shadow: inset 0 -2px 0 var(--rose); transition-duration: 200ms; }
.faces i { transition: background-color 600ms var(--out), color 600ms var(--out); }
.echo .faces i:not(.me) { background: #F9D9E2; color: var(--rose-deep); transition-duration: 200ms; }

/* toast */
.toast {
  position: absolute; z-index: 5; left: 50%; bottom: 158px;
  transform: translate(-50%, 8px); opacity: 0;
  padding: 10px 16px; border-radius: 20px; background: var(--ink); color: var(--card);
  font-size: 14px; white-space: nowrap;
  transition: opacity 200ms var(--out), transform 200ms var(--out);
  pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- desktop switcher ---------- */
.switcher { grid-column: 1; justify-self: end; width: 168px; }
.switcher .name { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.switcher ol { list-style: none; }
.switcher li button {
  width: 100%; height: 40px; display: flex; align-items: center; gap: 12px;
  font-size: 15px; color: var(--ink-3); text-align: left;
  transition: color 160ms;
}
.switcher li button:hover { color: var(--ink-2); }
.switcher li button .n { font-family: var(--num); font-size: 12px; width: 18px; font-variant-numeric: tabular-nums; }
.switcher li button[aria-current="true"] { color: var(--ink); }
.switcher li button[aria-current="true"] .n { color: var(--rose); }
.switcher .play {
  margin-top: 18px; height: 40px; padding: 0 16px 0 12px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(24, 22, 27, .16);
  transition: background-color 160ms;
}
.switcher .play:hover { background: rgba(24, 22, 27, .05); }
.switcher .play svg { width: 16px; height: 16px; }

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