:root {
  color-scheme: light;
  font-family: system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #182d27;
  background: #edf3ef;
  font-synthesis: none;
  --muted: #50675e;
  --line: #dce7e0;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, .transcript:focus-visible { outline: 3px solid #4a7867; outline-offset: -3px; }
[hidden] { display: none !important; }
.workspace {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 58rem);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: #fcfefc;
  border-inline: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.toolbar { display: flex; align-items: center; gap: .75rem; padding: max(.45rem, env(safe-area-inset-top)) 1.15rem .45rem; border-bottom: 1px solid var(--line); background: #f3f7f4; }
.brand { display: flex; align-items: center; gap: .55rem; margin-right: auto; }
h1 { font-size: 1.08rem; margin: 0; white-space: nowrap; }
.brand-icon { display: flex; align-items: center; gap: 2px; justify-content: center; width: 1.85rem; height: 1.85rem; background: #163a2f; border-radius: .48rem; }
.brand-icon i { display: block; width: 2px; height: .33rem; background: #bceac7; border-radius: 999px; }
.brand-icon i:nth-child(2), .brand-icon i:nth-child(4) { height: .57rem; }
.brand-icon i:nth-child(3) { height: .82rem; }
.status { display: inline-flex; align-items: center; gap: .38rem; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.status::before { content: ""; width: .42rem; height: .42rem; background: #99721c; border-radius: 50%; }
.status[data-tone="ready"]::before { background: #387953; }
.status[data-tone="recording"]::before, .status[data-tone="error"]::before { background: #b54a3b; }
#record { min-height: 2.55rem; min-width: 4.15rem; padding: .35rem .8rem; border: 0; border-radius: .5rem; background: #184739; color: #fff; font-weight: 700; white-space: nowrap; }
#record[data-recording="true"] { background: #963c32; }
.options { display: flex; align-items: center; justify-content: space-between; padding: 0 1.25rem; border-bottom: 1px solid var(--line); gap: .65rem; }
.caption-label { color: #426458; font-weight: 650; font-size: .88rem; }
.model-picker { display: flex; align-items: center; gap: .7rem; padding: .45rem 1.25rem; border-bottom: 1px solid var(--line); }
.model-picker label { flex: none; color: #426458; font-size: .88rem; font-weight: 650; }
.model-picker select { min-width: 0; max-width: 100%; padding: .35rem .45rem; border: 1px solid #acc5b6; border-radius: .4rem; background: #fcfefc; color: #183c30; font-size: .9rem; }
.model-picker select:focus-visible { outline: 2px solid #4a7867; outline-offset: 2px; }
.document-tools, .summary-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.document-tools { padding: .55rem 1.25rem; border-bottom: 1px solid var(--line); }
.document-tools button, .summary-nav button { min-height: 2.35rem; padding: .3rem .7rem; border: 1px solid #bccec3; border-radius: .45rem; color: #234b3d; background: #fff; font-size: .88rem; font-weight: 600; }
.document-tools button:not(:disabled):hover, .summary-nav button:hover { background: #edf5ef; }
.action-note, #summary-note { margin: 0; padding: .4rem 1.25rem; background: #edf5ef; color: #345849; font-size: .86rem; }
.summary-view { min-height: 100vh; max-width: 58rem; margin: auto; background: #f3f7f4; color: #1c3028; }
.summary-nav { padding: .65rem 1.25rem; justify-content: space-between; border-bottom: 1px solid var(--line); }
.summary-nav #summary-download { background: #184739; color: #fff; border-color: #184739; }
.summary-paper { margin: 1.5rem auto; max-width: 45rem; background: #fff; border: 1px solid var(--line); padding: clamp(1.25rem, 5vw, 3rem); border-radius: .6rem; }
.summary-paper h1 { font-size: clamp(1.55rem, 4vw, 2.15rem); line-height: 1.3; white-space: normal; overflow-wrap: anywhere; letter-spacing: .015em; }
.summary-paper h1:focus { outline: none; }
.summary-meta { color: #546b60; font-size: .9rem; margin: .8rem 0 1.6rem; }
.summary-overview, #summary-points { font-size: 1.05rem; line-height: 1.8; overflow-wrap: anywhere; }
.summary-overview { white-space: pre-line; }
.summary-paper h2 { font-size: 1.1rem; margin: 1.65rem 0 .45rem; }
#summary-points { padding-inline-start: 1.35rem; margin: 0; }
#summary-points li { padding-inline-start: .2rem; margin-bottom: .5rem; }
.actions { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .875rem; }
.source-toggle { min-height: 2.5rem; display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; white-space: nowrap; }
.source-toggle input { accent-color: #27664f; margin: 0; width: 1rem; height: 1rem; }
.subtle { border: 0; background: none; color: #345c4d; min-height: 2.5rem; padding: .25rem .4rem; white-space: nowrap; }
.error { flex: none; color: #8d3128; background: #fff3ef; padding: .45rem 1.25rem; font-size: .9rem; line-height: 1.45; }

.transcript { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 0 1.25rem 2rem; }
.empty { color: var(--muted); margin: 1rem 0; font-size: .95rem; }
#history { padding: 0; margin: 0; list-style: none; }
.caption-row { padding: .56rem 0 .59rem; border-bottom: 1px solid #edf1ee; }
.caption-row p { margin: 0; overflow-wrap: anywhere; }
.mandarin { font-size: clamp(1.13rem, 2.4vw, 1.46rem); line-height: 1.55; font-weight: 510; }
.source { font-size: .9rem; line-height: 1.5; color: var(--muted); }
.transcript:not(.show-source) .source { display: none; }
.provisional { color: #4f675d; border-bottom-color: transparent; }
#latest { position: absolute; right: 1.05rem; bottom: max(.85rem, env(safe-area-inset-bottom)); min-height: 2.5rem; padding: .35rem .75rem; border: 1px solid #acc5b6; border-radius: 2rem; color: #1f5141; background: #edf7ef; box-shadow: 0 2px 8px #153a2b20; font-size: .9rem; }
@media (max-width: 39rem) {
  .workspace { border: 0; }
  .toolbar { padding-inline: .65rem; gap: .48rem; }
  .brand { gap: .42rem; }
  .options, .transcript, .model-picker { padding-inline: .8rem; }
  .document-tools, .summary-nav { padding-inline: .65rem; gap: .3rem; }
  .document-tools button { padding-inline: .43rem; font-size: .83rem; }
  .summary-paper { margin: .65rem; }
}

