/* The homepage's workspace geometry, scoped to the owned TTS entry document.
   React keeps ownership of #root; CSS never moves/recreates player or form DOM. */
body.zh-tts-workspace { margin: 0; background: #f7f8f5; color: #263a32; --tts-rail: 222px; }
.zh-tts-workspace .zh-tts-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--tts-rail); min-height: 0;
  display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 32px 18px 20px;
  border: 0; border-right: 1px solid #e1e6dc; background: #f0f2ec; overflow-y: auto;
}
.zh-tts-sidebar .zh-tool-brand { gap: 10px; padding: 0 6px; margin-bottom: 45px; }
.zh-tts-brand-copy { display: flex; flex-direction: column; gap: 4px; }
.zh-tts-brand-copy strong { font-size: 14px; letter-spacing: .03em; }
.zh-tts-brand-copy small { color: #5e6a59; font: 9px/1.4 ui-monospace, monospace; letter-spacing: .08em; }
.zh-tts-nav-label { display: block; padding: 0 13px; margin-bottom: 10px; color: #5e6a59; font-size: 11px; letter-spacing: .06em; }
.zh-tts-sidebar .zh-tool-links { display: grid; grid-template-columns: 1fr; gap: 6px; }
.zh-tts-sidebar .zh-tool-links a { display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 10px 13px; border-radius: 8px; font-size: 14px; }
.zh-tts-sidebar .zh-tool-links a[aria-current] { background: #dee8d6; color: #234e38; }
.zh-tts-sidebar .zh-tool-links svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.zh-tts-sidebar .zh-tool-links i { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: #537549; }
.zh-tts-sidebar-note { padding-top: 42px; }
.zh-tts-sidebar-note > p { margin: 24px 12px 15px; color: #5f725a; font: 23px/1.65 "Songti SC", STSong, Georgia, serif; }
.zh-tts-sidebar-sign { display: block; margin: 0 12px 24px; color: #5e6a59; font: 8px/1.6 ui-monospace, monospace; letter-spacing: .12em; }
.zh-tts-sidebar-note > a { display: inline-block; padding: 10px 13px; color: #5e6a59; font-size: 12px; text-decoration: none; }
.zh-tts-owner { display: flex; align-items: center; gap: 11px; margin: auto 12px 0; padding-top: 18px; border-top: 1px solid #dce1d6; }
.zh-tts-owner > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #e0e5d7; border: 1px solid #d2dac9; font-size: 10px; color: #50613f; }
.zh-tts-owner strong, .zh-tts-owner small { display: block; }
.zh-tts-owner strong { font-size: 12px; font-weight: 600; }
.zh-tts-owner small { margin-top: 3px; color: #5e6a59; font-size: 10px; }
.zh-tts-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 74px; margin-left: var(--tts-rail); padding: 0 40px; border-bottom: 1px solid #e1e6dc; font-size: 12px; }
.zh-tts-topbar > div { display: flex; align-items: center; gap: 14px; }
.zh-tts-topbar > div > span { color: #5e6a59; }
.zh-tts-topbar strong { font-weight: 550; }
.zh-tts-edition { color: #5e6a59; font: 9px/1.5 ui-monospace, monospace; letter-spacing: .08em; }
.zh-tts-edition > span { margin-left: 8px; padding: 4px 6px; border: 1px solid #dce3d5; border-radius: 4px; }
.zh-tts-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.zh-tts-noscript { margin-left: var(--tts-rail); padding: 24px 40px; }
body.zh-tts-workspace #root { margin-left: var(--tts-rail); min-width: 0; }
body.zh-tts-workspace #root > div { min-height: calc(100dvh - 74px); }
body.zh-tts-workspace #root > div > header { border-color: #e1e6dc; box-shadow: none; background: #f7f8f5f5; }
body.zh-tts-workspace #root > div > header > div:first-child { max-width: 1200px; min-height: 76px; padding: 14px 40px; gap: 16px; }
body.zh-tts-workspace #root > div > header > div:first-child > div:first-child > div:first-child { width: 34px; height: 34px; border-radius: 9px; box-shadow: none; }
body.zh-tts-workspace #root > div > header > div:first-child > div:first-child > div:last-child > div > span:first-child { font-size: 17px; font-weight: 600; letter-spacing: -.03em; }
body.zh-tts-workspace #root > div > header nav { gap: 4px; }
body.zh-tts-workspace #root > div > header nav button { margin: 0; padding: 9px 12px; border-radius: 7px; font-size: 13px; font-weight: 550; box-shadow: none; }
body.zh-tts-workspace #root main > div { width: 100%; max-width: 1200px; padding: 32px 40px 48px; }
body.zh-tts-workspace #root main h1 { font-size: clamp(24px, 2.3vw, 32px); line-height: 1.4; letter-spacing: -.035em; font-weight: 600; }
body.zh-tts-workspace #root main :is(.rounded-3xl, .rounded-2xl) { border-radius: 14px; }
body.zh-tts-workspace #root main > div > div.rounded-3xl { padding: 24px 28px; background-image: none; background-color: #edf2e4; border-color: #dce3d5; }
body.zh-tts-workspace #root main > div > div:has(> audio) { padding: 22px; box-shadow: none; backdrop-filter: none; }
body.zh-tts-workspace #root main > div > div:has(> audio) > div.pointer-events-none { display: none; }
body.zh-tts-workspace #root main > div > div:has(> audio) h3 { font-size: 15px; line-height: 1.65; font-weight: 600; -webkit-line-clamp: 3; }
body.zh-tts-workspace #root main > div > div:has(> audio) h3 + p { color: #5e6a59; line-height: 1.8; }
body.zh-tts-workspace #root main > div > div:has(> audio) button { min-height: 32px; }
body.zh-tts-workspace #root main > div > div:has(> audio) button.rounded-full { box-shadow: none; }
body.zh-tts-workspace #root main > div > div.border-b > button { min-height: 44px; }
body.zh-tts-workspace #root > div > footer { border-color: #e1e6dc; background: #f7f8f5; }

/* On a wide desktop the passage and compact persistent player share a desk.
   The :has condition limits this to a lesson with an actual audio component. */
@media (min-width: 1280px) {
  body.zh-tts-workspace #root main > div:has(> div > audio) { display: grid; grid-template-columns: minmax(0, 1fr) 304px; gap: 24px; align-items: start; }
  body.zh-tts-workspace #root main > div:has(> div > audio) > * { min-width: 0; margin: 0; }
  body.zh-tts-workspace #root main > div:has(> div > audio) > div:first-child { grid-column: 1 / -1; }
  body.zh-tts-workspace #root main > div > div:has(> audio) { grid-column: 2; grid-row: 2 / span 2; position: sticky; top: 100px; }
  body.zh-tts-workspace #root main > div > div:has(> audio) > audio + div { flex-direction: column; align-items: stretch; }
  body.zh-tts-workspace #root main > div > div:has(> audio) > audio + div > div:last-child { align-self: flex-start; }
  body.zh-tts-workspace #root main > div > div:has(> audio) > div:last-child { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 16px 10px; }
  body.zh-tts-workspace #root main > div > div:has(> audio) > div:last-child > div { display: contents; }
  body.zh-tts-workspace #root main > div > div:has(> audio) > div:last-child > div > button { justify-self: center; }
  body.zh-tts-workspace #root main > div > div:has(> audio) > div:last-child > div:last-child > div { grid-column: 1 / -1; justify-self: center; margin-left: 0; }
  body.zh-tts-workspace #root main > div:has(> div > audio) > div.border-b { grid-column: 1; grid-row: 2; gap: 18px; font-size: 12px; }
  body.zh-tts-workspace #root main > div:has(> div > audio) > div.border-b > * { margin-left: 0; }
  body.zh-tts-workspace #root main > div:has(> div > audio) > div:last-child { grid-column: 1; grid-row: 3; }
}
@media (min-width: 1001px) and (max-width: 1279px) {
  body.zh-tts-workspace #root > div > header > div:first-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; height: auto; }
  body.zh-tts-workspace #root > div > header > div:first-child > nav { grid-column: 1 / -1; grid-row: 2; display: flex; }
  body.zh-tts-workspace #root > div > header > div:first-child > div:last-child { grid-column: 2; grid-row: 1; }
}
@media (max-width: 1000px) {
  .zh-tts-workspace .zh-tts-sidebar { position: sticky; inset: 0 0 auto; width: 100%; padding: 12px 18px 8px; border-right: 0; border-bottom: 1px solid #e1e6dc; }
  .zh-tts-sidebar .zh-tool-brand { margin-bottom: 10px; padding: 0; }
  .zh-tts-sidebar .zh-tool-mark { width: 32px; height: 32px; font-size: 22px; }
  .zh-tts-brand-copy strong { font-size: 12px; }
  .zh-tts-brand-copy small, .zh-tts-nav-label, .zh-tts-sidebar-note, .zh-tts-owner { display: none; }
  .zh-tts-sidebar .zh-tool-links { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .zh-tts-sidebar .zh-tool-links a { justify-content: center; gap: 7px; min-height: 40px; padding: 7px 3px; font-size: 12px; }
  .zh-tts-sidebar .zh-tool-links svg { width: 17px; height: 17px; }
  .zh-tts-sidebar .zh-tool-links i { display: none; }
  .zh-tts-topbar { height: 52px; margin-left: 0; padding: 0 22px; }
  .zh-tts-edition { display: none; }
  .zh-tts-noscript { margin-left: 0; padding: 20px; }
  body.zh-tts-workspace #root { margin-left: 0; }
  body.zh-tts-workspace #root > div > header { position: relative; z-index: 20; }
  body.zh-tts-workspace #root > div > header > div:first-child { padding: 14px 22px; }
  body.zh-tts-workspace #root main > div { padding: 24px 22px 36px; }
}
@media (max-width: 600px) {
  .zh-tts-workspace .zh-tts-sidebar { padding-right: 12px; padding-left: 12px; }
  .zh-tts-sidebar .zh-tool-links { gap: 2px; }
  .zh-tts-sidebar .zh-tool-links a { padding: 7px 0; }
  .zh-tts-sidebar .zh-tool-links svg { display: none; }
  .zh-tts-topbar { padding: 0 16px; }
  body.zh-tts-workspace #root > div > header > div:first-child { padding: 12px 12px 10px; gap: 10px 8px; }
  body.zh-tts-workspace #root > div > header nav button { padding: 9px 4px; }
  body.zh-tts-workspace #root main > div { padding: 20px 12px 32px; }
  body.zh-tts-workspace #root main > div > div.rounded-3xl { padding: 20px; }
  body.zh-tts-workspace #root main > div > div:has(> audio) { padding: 20px; }
  body.zh-tts-workspace #root main h1 { font-size: 24px; line-height: 1.4; }
}
