[hidden] {
  display: none !important;
}
:root {
  --bg: #f7f8f4;
  --panel: #fff;
  --ink: #263c35;
  --muted: #7b8780;
  --line: #e6eae3;
  --accent: #d76943;
  --green: #355e4c;
  --soft: #edf1e9;
  --shadow: 0 10px 35px #263c3508;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.6 "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}
body.dark {
  --bg: #1d2824;
  --panel: #26352e;
  --ink: #e4eadd;
  --muted: #a0b0a5;
  --line: #425148;
  --soft: #33473b;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 36px 22px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 25px;
  font-weight: 650;
  letter-spacing: 2px;
}
.brand-icon {
  width: 43px;
  height: 46px;
  border-radius: 13px 4px 13px 4px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: serif;
  font-size: 26px;
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 1.7px;
  font-weight: 500;
  color: var(--muted);
}
.nav-label {
  color: var(--muted);
  font-size: 11px;
  margin: 52px 15px 14px;
  letter-spacing: 2px;
}
nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  text-decoration: none;
  margin: 6px 0;
  padding: 13px 16px;
  border-radius: 8px;
  font-size: 18px;
}
nav a span {
  font-size: 14px;
}
nav a.active {
  color: var(--green);
  background: var(--soft);
  font-weight: 600;
}
nav b {
  margin-left: auto;
  font-size: 10px;
  background: #dce5d7;
  border-radius: 5px;
  padding: 1px 6px;
}
.sidebar-bottom {
  margin-top: auto;
}
.local-status {
  font-size: 11px;
  color: var(--muted);
  padding: 15px;
}
i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 100%;
  background: #749b71;
  margin-right: 6px;
}
.settings-link {
  display: flex;
  gap: 15px;
  padding: 15px;
  color: var(--muted);
  text-decoration: none;
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 15px;
  font-size: 12px;
}
.profile > span {
  border: 1px solid #dfdfce;
  background: #f0eede;
  color: #7d806a;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
}
.profile small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
main {
  margin-left: 238px;
  padding: 43px 54px;
  max-width: 1680px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--muted);
  margin: 0 0 8px;
}
h1 {
  font-size: 29px;
  letter-spacing: 1px;
  font-weight: 600;
  margin: 0 0 6px;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
h3 {
  font-weight: 600;
}
p {
  margin: 8px 0;
}
.muted {
  color: var(--muted);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.topbar p {
  font-size: 12px;
  color: var(--muted);
}
button,
.button {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover,
.button:hover {
  background: var(--soft);
  transform: translateY(-1px);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary,
.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
button.orange {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.hero {
  background: #e9eee5;
  border: 1px solid #e0e6d9;
  border-radius: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 216px;
  padding: 30px 38px;
  position: relative;
  overflow: hidden;
  color: #2c4538;
}
.hero .eyebrow {
  color: #71846c;
}
.hero h2 {
  font-family: Georgia, "SimSun", serif;
  font-size: 29px;
  letter-spacing: 1px;
  margin: 10px 0;
}
.hero p {
  color: #74806d;
  font-size: 12px;
  margin-bottom: 22px;
}
.hero-art {
  position: relative;
  width: 200px;
  height: 150px;
  flex-shrink: 0;
}
.hero-art:before,
.hero-art:after {
  content: "";
  position: absolute;
  width: 77px;
  height: 112px;
  border: 1px solid #8d9d7c;
  border-radius: 3px 13px 5px 3px;
  bottom: 13px;
  left: 40px;
  transform: rotate(-17deg);
  background: repeating-linear-gradient(
    0deg,
    #e9eee5 0 12px,
    #bac6ae 13px,
    #e9eee5 14px
  );
  box-shadow: 7px 7px 0 #d2dcc7;
}
.hero-art:after {
  left: 112px;
  transform: rotate(17deg);
  border-radius: 13px 3px 3px 5px;
}
.leaf {
  position: absolute;
  right: 8px;
  top: 5px;
  color: #758b63;
  font-size: 46px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
  margin: 23px 0 34px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--soft);
  display: grid;
  place-items: center;
  font-size: 21px;
  color: #7e9477;
}
.stat:nth-child(2) .stat-icon {
  background: #faf0e7;
  color: #c98956;
}
.stat:nth-child(3) .stat-icon {
  background: #edf0f7;
  color: #8e98b5;
}
.stat strong {
  display: block;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.15;
}
.stat small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0 19px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pill {
  padding: 2px 8px;
  background: var(--soft);
  color: var(--muted);
  border-radius: 5px;
  font-size: 11px;
}
.search {
  position: relative;
}
.search input {
  max-width: 230px;
  padding: 9px 13px;
  background: transparent;
}
input,
select,
textarea {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 6px;
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #91a78e;
  box-shadow: 0 0 0 2px #91a78e22;
}
input[type="checkbox"] {
  accent-color: var(--green);
}
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 21px;
}
.book {
  padding: 17px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  position: relative;
}
.cover {
  width: 100%;
  height: 212px;
  background: #dfe5d9;
  border-radius: 4px 7px 7px 4px;
  box-shadow:
    inset 5px 0 0 #00000010,
    3px 5px 10px #0000000b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
  color: #354d41;
  cursor: pointer;
}
.cover:before {
  content: "";
  position: absolute;
  inset: 15px;
  border: 1px solid currentColor;
  opacity: 0.22;
}
.cover:after {
  content: "✳";
  font-size: 70px;
  line-height: 1;
  margin-top: 20px;
  opacity: 0.35;
}
.cover[data-color="1"] {
  background: #ebe0cb;
  color: #725d3b;
}
.cover[data-color="2"] {
  background: #d8e1e7;
  color: #435f71;
}
.cover[data-color="3"] {
  background: #e7dcd4;
  color: #855e50;
}
.cover .format {
  font-size: 8px;
  letter-spacing: 3px;
  opacity: 0.7;
}
.cover strong {
  font-family: Georgia, "SimSun", serif;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  margin: 13px 0;
}
.cover small {
  font-size: 10px;
}
.book h3 {
  font-size: 13px;
  margin: 15px 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book .muted {
  font-size: 11px;
}
.progress {
  height: 3px;
  background: var(--line);
  border-radius: 3px;
  margin: 15px 0 7px;
}
.progress > span {
  display: block;
  height: 100%;
  background: #8b9b79;
}
.book-footer {
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}
.book-remove {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 1;
  padding: 2px 7px;
  opacity: 0;
}
.book:hover .book-remove,
.book-remove:focus {
  opacity: 1;
}
.import-tile {
  border: 1px dashed #cdd6c7;
  border-radius: 10px;
  min-height: 329px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}
.import-tile > span {
  font-size: 30px;
  font-weight: 200;
}
.import-tile small {
  font-size: 10px;
  color: #a3aba0;
}
.footer-note {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 45px;
  font-size: 11px;
  color: #9da79b;
}
.notice {
  background: var(--soft);
  padding: 13px 17px;
  border-radius: 7px;
  font-size: 12px;
  margin: 16px 0;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.table-wrap {
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th,
td {
  padding: 13px 17px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  font-weight: 500;
  color: var(--muted);
  background: var(--soft);
}
td .word {
  font-family: Georgia, serif;
  font-size: 18px;
}
td button {
  padding: 4px 8px;
  font-size: 11px;
}
.badge {
  display: inline-block;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--soft);
}
.badge.new,
.badge.learning {
  background: #fbefda;
  color: #9b7433;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 25px;
}
.panel h2 {
  margin-bottom: 20px;
}
.field {
  display: block;
  margin: 16px 0;
  font-size: 12px;
}
.field > input:not([type="checkbox"]),
.field > select,
.field > textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
}
.field small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.full {
  grid-column: 1/-1;
}
.path {
  word-break: break-all;
  font-family: monospace;
  font-size: 12px;
}
.danger {
  color: #b85046;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(900px, 90vw);
  max-height: 85vh;
  padding: 28px;
  background: var(--panel);
  color: var(--ink);
}
dialog::backdrop {
  background: #17251d66;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.modal-body {
  max-height: 50vh;
  overflow: auto;
}
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: calc(50% + 90px);
  transform: translateX(-50%);
  padding: 12px 22px;
  border-radius: 8px;
  background: #2e493c;
  color: white;
  z-index: 100;
  display: none;
  max-width: 80vw;
}
.reader-head {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 14px 0;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.reader-head h2 {
  font-size: 13px;
}
.reader-tools {
  padding: 13px 0;
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.reader-tools button,
.reader-tools select {
  padding: 5px 10px;
  font-size: 12px;
}
.reading {
  margin: auto;
  max-width: 760px;
  padding: 38px 12px 100px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--reading-size, 21px);
  line-height: var(--reading-line, 1.9);
  color: var(--ink);
}
.reading h1,
.reading h2 {
  font-family: Georgia, serif;
  text-align: center;
  margin: 25px 0 35px;
}
.reading p {
  margin: 0 0 1.2em;
}
.reading img {
  max-width: 100%;
  height: auto;
}
.token {
  cursor: pointer;
  border-radius: 2px;
  box-decoration-break: clone;
}
.token:hover {
  background: #d4ddca !important;
}
.token.unknown {
  background: rgba(222, 185, 110, var(--highlight-alpha, 0.23));
  border-bottom: 1px solid #c9ae7044;
}
.token.learning {
  border-bottom: 2px dotted #be985b;
  background: #e6cc8a18;
}
.token.selected {
  outline: 1px solid #ad9455;
}
.search-hit {
  background: #e7b85d;
  color: #222;
}
.reader-bottom {
  position: fixed;
  bottom: 0;
  left: 238px;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 26px;
  background: var(--panel);
  padding: 12px;
  border-top: 1px solid var(--line);
  z-index: 4;
  font-size: 12px;
}
.lookup {
  position: fixed;
  right: 27px;
  top: 130px;
  width: 330px;
  max-height: calc(100vh - 165px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 23px;
  box-shadow: 0 15px 70px #1b33232a;
  z-index: 12;
}
.lookup h2 {
  font-family: Georgia, serif;
  font-size: 30px;
}
.lookup .context {
  font-family: Georgia, serif;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.lookup .explanation {
  white-space: pre-wrap;
  font-size: 13px;
}
.lookup .close {
  float: right;
  padding: 2px 8px;
}
.lookup .toolbar {
  margin-top: 15px;
}
.lookup button {
  font-size: 11px;
  padding: 6px 10px;
}
.lookup input {
  width: 100%;
  margin-top: 15px;
}
.review-wrap {
  max-width: 780px;
  margin: 35px auto;
  text-align: center;
}
.review-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 50px;
  min-height: 370px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.review-card h2 {
  font:
    48px Georgia,
    serif;
  margin: 15px;
}
.review-card blockquote {
  font:
    18px/1.8 Georgia,
    serif;
  color: var(--muted);
}
.review-answer {
  white-space: pre-wrap;
  text-align: left;
  font-size: 14px;
  margin: 20px 0;
}
.ratings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.ratings button {
  display: block;
  padding: 16px;
}
.ratings small {
  display: block;
  font-size: 10px;
  opacity: 0.65;
}
.empty {
  text-align: center;
  padding: 65px 20px;
  color: var(--muted);
}
.pdf-page {
  position: relative;
  margin: auto;
  box-shadow: 0 2px 18px #0002;
  background: white;
}
.pdf-page canvas {
  display: block;
}
.pdf-words {
  position: absolute;
  inset: 0;
}
.pdf-word {
  position: absolute;
  color: transparent;
  cursor: pointer;
  line-height: 1;
  white-space: pre;
  transform-origin: left top;
}
.pdf-word.unknown {
  background: #e3c36e44;
}
.pdf-word.learning {
  border-bottom: 2px dotted #ba9448;
}
.pdf-word:hover {
  background: #b9d0aa66;
}
.pdf-container {
  overflow: auto;
  padding: 22px 0 90px;
}
.loading {
  padding: 50px;
  text-align: center;
  color: var(--muted);
}
:focus-visible {
  outline: 2px solid #a9b892;
  outline-offset: 3px;
}
@media (min-width: 1500px) {
  main {
    padding-left: 72px;
    padding-right: 72px;
  }
  .cover {
    height: 245px;
  }
}
@media (max-width: 1000px) {
  main {
    padding: 30px;
  }
  .sidebar {
    width: 205px;
  }
  main {
    margin-left: 205px;
  }
  .reader-bottom {
    left: 205px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 15px;
  }
  .hero-art {
    width: 150px;
  }
  .hero {
    padding: 25px;
  }
  .lookup {
    right: 15px;
  }
}
@media (max-width: 700px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 18px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .brand {
    font-size: 20px;
  }
  .brand small,
  .nav-label,
  .sidebar-bottom {
    display: none;
  }
  nav {
    display: flex;
  }
  nav a {
    padding: 9px;
    font-size: 14px;
  }
  nav a span {
    font-size: 11px;
  }
  nav b {
    display: none;
  }
  main {
    margin-left: 0;
    padding: 24px 18px;
  }
  .hero-art {
    display: none;
  }
  .hero h2 {
    font-size: 24px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stat {
    padding: 13px;
  }
  .stat strong {
    font-size: 22px;
  }
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .cover {
    height: 200px;
    padding: 12px;
  }
  .section-top {
    flex-wrap: wrap;
  }
  .reader-bottom {
    left: 0;
  }
  .reader-head {
    flex-wrap: wrap;
  }
  .lookup {
    top: auto;
    bottom: 65px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: 65vh;
  }
  .review-card {
    padding: 25px;
  }
  .ratings {
    gap: 5px;
  }
  .ratings button {
    padding: 12px 3px;
  }
  .topbar {
    align-items: flex-start;
    gap: 10px;
  }
  h1 {
    font-size: 25px;
  }
  #toast {
    left: 50%;
  }
  .reading {
    padding-top: 15px;
  }
}
