:root {
  --ink: #272e2b;
  --muted: #666d65;
  --green: #284d40;
  --line: #dcdcd1;
  --paper: #faf9f5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    15px/1.6 system-ui,
    sans-serif;
}
header {
  border-bottom: 1px solid var(--line);
  background: #fbfaf6;
}
.bar,
main {
  width: min(1100px, 92%);
  margin: auto;
}
.bar {
  height: 74px;
  display: flex;
  align-items: center;
  gap: 50px;
}
.brand {
  font:
    700 25px Georgia,
    serif;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand i {
  font-size: 34px;
}
.brand small,
.eyebrow {
  font: 600 11px/1.5 system-ui;
  letter-spacing: 0.16em;
}
.brand small {
  align-self: center;
  margin-left: 4px;
}
a {
  color: inherit;
  text-decoration: none;
}
nav {
  display: flex;
  gap: 26px;
  height: 100%;
  align-items: stretch;
}
nav a {
  display: grid;
  align-items: center;
  border-bottom: 2px solid transparent;
}
nav a.active {
  border-color: var(--green);
  color: var(--green);
  font-weight: 650;
}
.account {
  margin-left: auto;
}
main {
  padding: 44px 0 70px;
}
button,
.btn,
input,
select {
  font: inherit;
}
button,
.btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffef9;
  color: var(--green);
}
button:hover,
.btn:hover {
  border-color: #6e8776;
}
button.primary,
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: Georgia, "Songti SC", "Noto Serif CJK SC", serif;
}
h1 {
  font-size: clamp(29px, 4vw, 44px);
  line-height: 1.2;
}
h2 {
  font-size: 25px;
}
h3 {
  font-size: 20px;
}
.muted,
small {
  color: var(--muted);
}
.top,
.row,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.top {
  margin-bottom: 25px;
}
.actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.hero {
  display: grid;
  grid-template-columns: 38% 1fr;
  border: 1px solid #cdd4c7;
  border-radius: 14px;
  overflow: hidden;
  background: #edf1e8;
  margin-bottom: 36px;
}
.stage {
  display: grid;
  place-items: center;
  min-height: 270px;
  background:
    repeating-linear-gradient(115deg, transparent 0 12px, #fff2 13px 14px),
    #d7ded0;
}
.cover {
  position: relative;
  width: 148px;
  height: 211px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  padding: 16px 10px;
  color: #edd297;
  background: #143e38;
  border: 4px double #ccae70;
  box-shadow:
    6px 7px 0 #b9b59e,
    11px 15px 20px #23433128;
  transform: rotate(-5deg);
  font:
    16px/1 Georgia,
    serif;
}
.cover b {
  font:
    26px/1 Georgia,
    serif;
  letter-spacing: 0.03em;
}
.cover i {
  font-size: 38px;
  color: #e1bf78;
}
.cover small {
  color: inherit;
  font-size: 8px;
  letter-spacing: 0.13em;
}
.hero article {
  align-self: center;
  padding: 30px 8%;
}
.hero h2 {
  font-size: clamp(26px, 4vw, 38px);
  margin: 6px 0;
}
.hero p {
  margin: 6px 0 18px;
}
.eyebrow {
  color: #5c7461;
}
.shelf,
.panel,
.entry {
  background: #fffefb;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.shelf {
  margin: 12px 0;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  gap: 17px;
}
.spine {
  width: 41px;
  height: 53px;
  display: grid;
  place-items: center;
  background: #31564a;
  color: #e0ca90;
  border-left: 4px double #c8b98e;
  font: 23px Georgia;
}
.shelf .end {
  margin-left: auto;
}
.panel,
.entry {
  padding: 20px;
  margin: 12px 0;
}
.entry a,
.link {
  color: var(--green);
  text-decoration: underline;
}
.list {
  display: grid;
  gap: 9px;
  margin: 16px 0;
}
.list button {
  justify-content: space-between;
  text-align: left;
}
.reader {
  max-width: 760px;
  margin: auto;
}
.reader article {
  font:
    21px/1.92 Georgia,
    serif;
}
.reader article p {
  margin: 1.2em 0;
}
.word {
  cursor: pointer;
}
.word:hover,
.word:focus {
  background: #e6eadc;
}
.marked .l1 {
  border-bottom: 2px dotted #b16c37;
}
.marked .l2 {
  border-bottom: 2px dashed #507fa0;
}
.marked .l3 {
  border-bottom: 1px solid #678368;
}
.highlight {
  background: #faf2d8;
}
dialog {
  max-width: min(480px, 94vw);
  width: 450px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
  max-height: 85vh;
}
dialog::backdrop {
  background: #182e2544;
}
dialog p,
dialog form,
dialog .actions,
dialog label {
  margin: 12px 0;
}
input,
select {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 9px;
  max-width: 100%;
}
form input {
  width: 100%;
}
label {
  display: block;
}
#toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: white;
  border-radius: 7px;
  padding: 9px 15px;
  z-index: 10;
}
#toast:empty {
  display: none;
}
blockquote {
  border-left: 3px solid #b2c1a9;
  margin: 14px 0;
  padding-left: 12px;
  font:
    17px/1.6 Georgia,
    serif;
}
.back {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
}
@media (max-width: 650px) {
  .bar {
    height: 62px;
    gap: 14px;
  }
  .brand {
    font-size: 19px;
  }
  .brand small {
    display: none;
  }
  nav {
    gap: 12px;
    font-size: 14px;
  }
  .account {
    font-size: 12px;
    padding: 6px;
  }
  .hero {
    grid-template-columns: 34% 1fr;
  }
  .stage {
    min-height: 220px;
  }
  .cover {
    width: 83px;
    height: 133px;
    padding: 9px 4px;
  }
  .cover b {
    font-size: 16px;
  }
  .cover i {
    font-size: 21px;
  }
  .cover small {
    font-size: 5px;
  }
  .hero article {
    padding: 20px 12px;
  }
  .hero .btn {
    font-size: 13px;
    padding: 6px 9px;
  }
  .hero p {
    font-size: 13px;
  }
  .top {
    align-items: flex-end;
  }
  .shelf {
    padding: 12px;
    gap: 9px;
  }
  main {
    padding-top: 27px;
  }
  dialog.wordcard {
    margin: auto auto 0;
    width: 100%;
    max-width: 100%;
    border-radius: 15px 15px 0 0;
  }
  .reader article {
    font-size: 19px;
  }
}
.cover.original {
  display: block;
  object-fit: cover;
  border: 0;
  padding: 0;
  width: auto;
  aspect-ratio: 2/3;
}

@media (prefers-reduced-motion: no-preference) {
  button, .btn, .shelf, .word {
    transition: background-color 140ms ease, border-color 140ms ease, transform 120ms ease;
  }
  button:active, .btn:active { transform: scale(.97); }
  a.shelf:active { transform: translateY(1px); }
  dialog {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 150ms ease, transform 180ms ease-out,
      overlay 180ms allow-discrete, display 180ms allow-discrete;
  }
  dialog[open] { opacity: 1; transform: translateY(0); }
  dialog::backdrop {
    opacity: 0;
    transition: opacity 150ms ease, overlay 180ms allow-discrete, display 180ms allow-discrete;
  }
  dialog[open]::backdrop { opacity: 1; }
  @starting-style {
    dialog[open] { opacity: 0; transform: translateY(8px); }
    dialog[open]::backdrop { opacity: 0; }
  }
  @media (max-width: 650px) {
    dialog.wordcard { transform: translateY(18px); }
    dialog.wordcard[open] { transform: translateY(0); }
    @starting-style { dialog.wordcard[open] { transform: translateY(18px); } }
  }
}
