:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #26392f;
  background: #f7f5ef;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.page { max-width: 1480px; min-height: 100vh; margin: auto; padding: 0 5%; }
.history-backdrop { position: fixed; inset: 0; z-index: 20; background: #1c302899; }
.history-panel { position: fixed; inset: 0 auto 0 0; z-index: 21; width: min(350px, 86vw); padding: 27px 27px 32px; overflow-y: auto; background: #fbfaf6; box-shadow: 8px 0 30px #14251b25; transform: translateX(-110%); transition: transform .2s ease; visibility: hidden; }
.history-panel.open { transform: translateX(0); visibility: visible; }
.history-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid #d9ddd4; }
.history-header h2 { margin: 0; color: #254c3c; font-size: 21px; }
.history-header button { border: 0; background: transparent; color: #254c3c; font-size: 30px; line-height: 1; }
.history-word { display: block; padding: 15px 3px; border-bottom: 1px solid #e5e9df; color: #315f4e; font: 24px Georgia, serif; text-decoration: none; }
.history-word:hover { color: #a85e3a; }
.history-empty { color: #718076; font-size: 14px; line-height: 1.6; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 40px; min-height: 105px; border-bottom: 1px solid #d9ddd4; }
.intro { display: flex; align-items: baseline; gap: 30px; min-width: 0; }
.menu-button { display: flex; flex: none; flex-direction: column; justify-content: center; gap: 6px; width: 34px; height: 34px; padding: 3px; border: 0; background: transparent; }
.menu-button span { display: block; width: 25px; height: 2px; background: #315f4e; }
.menu-button:hover span { background: #a85e3a; }
.brand { flex: none; color: #315f4e; font: 700 22px Georgia, serif; letter-spacing: -.045em; text-decoration: none; }
.brand span { color: #a85e3a; }
.slogan { margin: 0; font-size: clamp(19px, 2vw, 29px); font-weight: 600; letter-spacing: -.035em; white-space: nowrap; }
.search { display: flex; align-items: center; width: min(100%, 460px); min-width: 260px; height: 50px; padding: 5px; border: 1px solid #bfcfc1; border-radius: 9px; background: #fffefa; }
.search:focus-within { border-color: #35745d; outline: 3px solid #35745d22; }
.search input { flex: 1; min-width: 0; padding: 0 12px; border: 0; outline: 0; background: transparent; color: #26392f; font-size: 14px; }
.search input::placeholder { color: #9aa69c; }
.search button { align-self: stretch; min-width: 74px; padding: 0 14px; border: 0; border-radius: 5px; background: #315f4e; color: white; font-size: 13px; font-weight: 600; white-space: nowrap; }
.search button:hover { background: #244b3d; }
.search button span { margin-left: 4px; }
.search-message { display: none; margin: 24px 0 0; color: #a45036; font-size: 14px; }
.search-message.visible { display: block; }
.search-message.info { color: #557e63; }

.entry { padding: 34px 0 40px; }
.word-heading { display: flex; align-items: end; justify-content: space-between; gap: 36px; }
.overline { margin: 0 0 10px; color: #a27451; font-size: 10px; font-weight: 700; letter-spacing: .19em; }
h1 { margin: 0; color: #254c3c; font: 400 clamp(62px, 6vw, 90px)/1 Georgia, serif; letter-spacing: -.065em; }
.pronunciation { margin: 17px 0 0; color: #718076; font-size: 14px; }
.entry-quality { margin: 6px 0 0; color: #8a968b; font-size: 11px; }
.line-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 39px; padding-bottom: 16px; border-bottom: 1px solid #d9ddd4; }
.line-heading h2 { margin: 0; color: #385844; font-size: 14px; font-weight: 650; }
.line-heading > span { color: #8b9b8e; font-size: 12px; white-space: nowrap; }

.timeline-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-color: #bfcfc1 transparent; scrollbar-width: thin; }
.timeline-scroll:focus-visible { outline: 2px solid #7ea58d; outline-offset: -2px; }
.timeline { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-width: 920px; min-height: 218px; margin: 0; padding: 22px 0 23px; list-style: none; }
.timeline::before { content: ""; position: absolute; top: 65px; left: 10px; right: 10px; height: 1px; background: #aebfb0; }
.timeline-step { position: relative; min-width: 0; padding: 0 18px 0 10px; }
.timeline-step::before { content: ""; position: absolute; top: 37px; left: 10px; width: 11px; height: 11px; border: 2px solid #6e9877; border-radius: 50%; background: #f7f5ef; }
.timeline-step:last-child::before { border-color: #315f4e; background: #315f4e; }
.step-number { display: block; height: 68px; color: #95a398; font-size: 11px; font-weight: 700; letter-spacing: .09em; }
.step-language { display: block; min-height: 23px; color: #8a9689; font-size: 11px; font-weight: 600; }
.step-form { display: block; margin: 5px 0 6px; color: #284a3a; font: 400 clamp(22px, 2vw, 28px)/1.2 Georgia, serif; overflow-wrap: anywhere; }
.step-ipa { display: block; min-height: 21px; color: #557e63; font: 13px Georgia, serif; }
.step-ipa.unrecorded { color: #929b92; font: 11px -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
.step-meaning { display: block; color: #3a7051; font-size: 12px; font-weight: 600; }
.step-note { max-width: 215px; margin: 8px 0 0; color: #8a968b; font-size: 11px; line-height: 1.6; }

.relative-row { display: flex; align-items: baseline; gap: 25px; padding: 17px 0; border-top: 1px solid #d9ddd4; border-bottom: 1px solid #d9ddd4; }
.row-label { flex: none; color: #728a75; font-size: 12px; font-weight: 700; white-space: nowrap; }
.relative-row ul { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; }
.relative-row li { color: #758278; font-size: 12px; }
.relative-row strong { color: #365d47; font-weight: 600; }
.cognate-ipa { color: #8a968b; }
.source-row { display: flex; justify-content: space-between; gap: 20px; margin-top: 23px; padding-top: 13px; border-top: 1px solid #e2e5dc; color: #9aa69b; font-size: 11px; }
.source-links { display: flex; gap: 20px; white-space: nowrap; }
.source-links a { color: #557e63; text-decoration: none; }
.source-links a:hover { text-decoration: underline; }

@media (max-width: 850px) {
  .topbar { align-items: stretch; flex-direction: column; justify-content: center; gap: 19px; padding: 23px 0; }
  .intro { gap: 15px; }
  .search { width: 100%; min-width: 0; }
  .entry { padding-top: 30px; }
  .word-heading { align-items: start; flex-direction: column; gap: 20px; }
  .line-heading { margin-top: 35px; }
}

@media (max-width: 520px) {
  .page { padding: 0 20px; }
  .intro { align-items: center; flex-wrap: wrap; gap: 8px 12px; }
  .slogan { flex-basis: 100%; margin-left: 46px; }
  .brand { font-size: 19px; }
  .slogan { font-size: 22px; }
  .entry { padding-top: 30px; }
  h1 { font-size: 69px; }
  .line-heading { margin-top: 36px; }
  .timeline { grid-template-columns: repeat(5, 190px); min-width: 950px; }
  .relative-row { align-items: start; flex-direction: column; gap: 10px; }
  .source-row { flex-direction: column; gap: 10px; }
}
