.topbar-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; margin-right: 16px; }
.topbar-link { min-height: 36px; display: inline-flex; align-items: center; padding: 0 11px; color: var(--muted); border-radius: 9px; font-size: 12px; font-weight: 800; text-decoration: none; }
.topbar-link:hover, .topbar-link.active { color: var(--forest); background: var(--mint); }

.pinyin-body { background: #eef3f0; }
.pinyin-shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 84px; }
.pinyin-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 34px; }
.pinyin-hero > div { max-width: 700px; }
.pinyin-hero h1 { max-width: 100%; font-size: clamp(38px, 5vw, 62px); letter-spacing: -0.04em; }
.pinyin-hero p:not(.eyebrow) { margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; }

.pinyin-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr); gap: 18px; align-items: center; }
.pinyin-card { min-width: 0; min-height: 520px; padding: 26px; background: var(--surface); border: 1px solid rgba(211, 221, 216, 0.94); border-radius: 20px; box-shadow: var(--shadow); }
.pinyin-card-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.pinyin-card-heading h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.pinyin-card-heading .eyebrow { margin-bottom: 5px; }
.pinyin-step { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: var(--forest); background: var(--lime); border-radius: 11px; font-size: 12px; font-weight: 900; }
.pinyin-label { display: block; margin-bottom: 8px; color: #40504a; font-size: 13px; font-weight: 800; }
.pinyin-card textarea { display: block; width: 100%; min-height: 300px; resize: vertical; padding: 16px; color: var(--ink); border: 1px solid var(--line); border-radius: 13px; outline: 0; background: #fbfcfb; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 16px; line-height: 1.8; transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease; }
.pinyin-card textarea:focus { border-color: var(--forest-2); background: white; box-shadow: 0 0 0 3px rgba(37, 94, 79, 0.12); }
.pinyin-card textarea[readonly] { color: #244e42; background: #f1f8f4; }
.pinyin-card textarea::placeholder { color: #a0aaa5; }
.pinyin-card-footer { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; color: #7c8984; font-size: 11px; }
.text-button { padding: 6px 0; color: var(--forest-2); border: 0; background: transparent; font-size: 12px; font-weight: 800; }
.text-button:hover { color: var(--forest); }
.pinyin-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 24px; color: #84908b; font-size: 11px; }
.pinyin-examples button { min-height: 32px; padding: 0 10px; color: var(--forest-2); border: 1px solid #cfe0d6; border-radius: 999px; background: #f2f8f4; font-size: 11px; }
.pinyin-examples button:hover { border-color: #9cbeab; background: var(--mint); }
.pinyin-transfer { display: grid; place-items: center; }
.pinyin-transfer span { width: 42px; height: 42px; display: grid; place-items: center; color: var(--forest-2); background: var(--mint); border: 1px solid #c5ddd0; border-radius: 50%; font-size: 22px; font-weight: 700; }
.result-heading-pinyin { justify-content: space-between; }
.tone-options { min-height: 50px; display: flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: #f7faf8; }
.spacing-options { margin-top: -6px; }
.tone-options legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tone-options label { position: relative; flex: 1; min-width: 0; cursor: pointer; }
.tone-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tone-options span { min-height: 38px; display: grid; place-items: center; padding: 0 10px; color: var(--muted); border-radius: 8px; font-size: 12px; font-weight: 800; transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease; }
.tone-options input:checked + span { color: var(--forest); background: white; box-shadow: 0 2px 8px rgba(23, 63, 53, .1); }
.tone-options input:focus-visible + span { outline: 2px solid var(--forest-2); outline-offset: 2px; }
.output-footer { color: #6e8178; }
.local-note { display: inline-flex; align-items: center; gap: 6px; color: var(--forest-2); font-weight: 750; }
.local-note i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #4f8d76; box-shadow: 0 0 0 3px rgba(79, 141, 118, .12); }
.pinyin-note { display: flex; align-items: flex-start; gap: 14px; margin-top: 18px; padding: 18px 20px; color: #466157; border: 1px solid #cfdfd6; border-radius: 16px; background: rgba(255,255,255,.72); }
.pinyin-note-mark { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: var(--forest); background: var(--lime); border-radius: 10px; font-weight: 900; }
.pinyin-note strong { display: block; color: var(--ink); font-size: 13px; }
.pinyin-note p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

@media (max-width: 820px) {
  .pinyin-shell { width: min(680px, calc(100% - 30px)); padding-top: 44px; }
  .pinyin-hero { align-items: flex-start; flex-direction: column; gap: 20px; }
  .pinyin-workspace { grid-template-columns: 1fr; gap: 12px; }
  .pinyin-card { min-height: 0; }
  .pinyin-transfer { transform: rotate(90deg); }
}

@media (max-width: 620px) {
  .topbar-nav { gap: 2px; margin-right: 7px; }
  .topbar-link { min-height: 32px; padding: 0 7px; font-size: 10px; }
  .pinyin-shell { width: calc(100% - 22px); padding: 30px 0 58px; }
  .pinyin-hero { margin-bottom: 22px; }
  .pinyin-hero h1 { font-size: 40px; }
  .pinyin-hero p:not(.eyebrow) { font-size: 14px; }
  .pinyin-card { padding: 19px; border-radius: 17px; }
  .pinyin-card-heading { margin-bottom: 20px; }
  .pinyin-card textarea { min-height: 240px; padding: 13px; font-size: 14px; }
  .pinyin-note { padding: 15px; }
}

@media (max-width: 370px) {
  .topbar-nav .topbar-link:last-child { display: none; }
  .privacy-pill { display: none; }
  .pinyin-card textarea { min-height: 210px; }
}
