:root {
  color-scheme: light;
  font-family: Georgia, "Times New Roman", serif;
  color: #25251f;
  background: #f3f0e9;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button, input { font: inherit; }

.shell {
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
  padding: 24px 0 56px;
}

.hero {
  overflow: hidden;
  margin-bottom: 24px;
  border-radius: 7px;
  background: #e8dfcc;
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
}

.signin {
  display: grid;
  gap: 10px;
  width: min(100%, 360px);
  margin: 12vh auto 0;
}

.signin[hidden], #library[hidden] { display: none; }

.signin label { margin-top: 8px; }

.signin input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #aaa79e;
  border-radius: 5px;
  background: #fffefa;
}

button {
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  border-radius: 5px;
  color: #fffefa;
  background: #394c43;
  cursor: pointer;
}

button:disabled { opacity: .6; cursor: wait; }

.error {
  min-height: 1.4em;
  margin: 2px 0;
  color: #9a3028;
  font: 14px/1.4 system-ui, sans-serif;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  margin-bottom: 24px;
  color: #68675f;
  font: 13px system-ui, sans-serif;
}

.quiet {
  min-height: 36px;
  padding: 6px 10px;
  color: #394c43;
  background: transparent;
  border: 1px solid #b9b6ad;
}

.stories {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.story {
  overflow: hidden;
  border: 1px solid #d4d0c6;
  border-radius: 7px;
  background: #fffefa;
}

.story-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 17px 18px 14px;
}

.story h2 {
  margin: 0;
  font-size: clamp(19px, 4vw, 24px);
  font-weight: 400;
}

.reader {
  flex: 0 0 auto;
  color: #77746c;
  font: 12px/1.4 system-ui, sans-serif;
  text-align: right;
}

.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #24251f;
}

.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.story-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
}

.story-actions a {
  color: #394c43;
  font: 13px system-ui, sans-serif;
  text-underline-offset: 3px;
}

.parallel {
  padding: 4px 18px 18px;
  border-top: 1px solid #e7e3da;
}

.parallel[hidden] { display: none; }

.parallel-paragraph + .parallel-paragraph { margin-top: 20px; }

.parallel-pair {
  padding: 10px 0;
  border-bottom: 1px solid #efede7;
}

.parallel-en, .parallel-zh {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.parallel-zh {
  margin-top: 5px;
  color: #625e54;
  font-family: system-ui, sans-serif;
}

@media (max-width: 480px) {
  .shell { width: min(100% - 20px, 1040px); padding-top: 12px; }
  .story-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .reader { text-align: left; }
}
