:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #263e36;
  background: #f6f7f2;
  font-synthesis: none;
  font-size: 14px;
  --green: #254d3f;
  --muted: #78847a;
  --line: #e2e7dd;
  --red: #ce5b4b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
button {
  border: 1px solid #dce2d7;
  background: #fff;
  color: #304d40;
  padding: 10px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s;
}
button:hover {
  background: #edf2e9;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #9abc9b;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: #edf0e7;
  border-right: 1px solid var(--line);
  padding: 34px 22px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: 1px;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.5px;
  margin-top: 5px;
  color: #798879;
}
.brand-icon {
  background: var(--green);
  color: #eaf0d9;
  border-radius: 10px;
  font-size: 33px;
  width: 43px;
  height: 43px;
  text-align: center;
  line-height: 43px;
}
.side-label {
  font-size: 11px;
  color: #879180;
  margin: 48px 12px 14px;
}
nav {
  display: grid;
  gap: 7px;
}
nav button {
  display: flex;
  align-items: center;
  gap: 13px;
  border: none;
  background: none;
  padding: 13px 14px;
  text-align: left;
  font-size: 17px;
  color: #708071;
}
nav button span {
  font-size: 14px;
}
nav button.selected {
  background: var(--green);
  color: #fff;
}
nav b {
  margin-left: auto;
  font-size: 11px;
  background: #e0e9d1;
  color: #36503b;
  border-radius: 5px;
  padding: 2px 5px;
}
.sidebar-note {
  margin-top: auto;
  padding: 28px 10px;
  color: #74816e;
}
.sidebar-note strong {
  font-size: 12px;
  font-weight: 500;
}
.sidebar-note p {
  font-size: 11px;
  line-height: 1.7;
}
.mini-grid {
  line-height: 24px;
  letter-spacing: 10px;
  color: #8a9c80;
  margin-bottom: 18px;
}
.local-status {
  font-size: 10px;
  color: #879180;
}
main {
  margin-left: 238px;
  padding: 0 44px;
  max-width: 1700px;
}
header {
  height: 88px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
header > div {
  display: flex;
  gap: 22px;
  align-items: center;
}
#date {
  font-size: 12px;
  color: #8b9388;
}
.eyebrow {
  font-size: 11px;
  color: #788570;
  letter-spacing: 1px;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  margin: 10px 0 12px;
  font-weight: 650;
}
h2 {
  font-size: 18px;
  margin: 0 0 18px;
  font-weight: 600;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.85;
  color: #778271;
  margin: 10px 0 18px;
}
.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 35px 0 24px;
}
.page-title p {
  margin: 0;
  font-size: 13px;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.primary:hover {
  background: #356149;
}
.quiet {
  background: transparent;
}
.text-button {
  border: none;
  background: none;
  padding: 6px;
  color: #41664c;
  font-size: 12px;
}
.danger {
  color: #ab5a50;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.hero {
  background: #e7eddb;
  border: 1px solid #dce5cd;
  border-radius: 16px;
  padding: 34px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  overflow: hidden;
  min-height: 310px;
}
.pill {
  background: #d6e1c7;
  color: #5c7350;
  padding: 5px 10px;
  font-size: 10px;
  border-radius: 5px;
}
.hero h2 {
  font-family: Georgia, "Microsoft YaHei", serif;
  font-size: 31px;
  line-height: 1.5;
  margin: 17px 0 12px;
  font-weight: 500;
}
.hero p {
  font-size: 12px;
  color: #7a886b;
  line-height: 1.9;
}
.hero .primary {
  min-width: 170px;
  display: flex;
  justify-content: space-between;
}
.hero-visual {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 20px;
}
.sample-tiles {
  display: flex;
  gap: 12px;
  transform: rotate(-5deg);
}
.sample-tiles > div {
  display: grid;
  place-items: center;
  width: 81px;
  height: 81px;
  padding: 12px;
  border: 1px solid #bccbae;
  border-radius: 10px;
  background: #f9fbf0;
  box-shadow: 0 7px 0 #d5dfc6;
}
.sample-tiles b {
  font-family: Georgia, serif;
  font-size: 29px;
  font-weight: 500;
}
.visual-route {
  font-size: 11px;
  word-spacing: 13px;
  color: #718466;
}
.visual-route span {
  color: #a9b49a;
}
.visual-grid {
  display: grid;
  grid-template-columns: repeat(3, 33px);
  gap: 5px;
  font-size: 16px;
  line-height: 28px;
  color: #3c5d3c;
}
.visual-grid span {
  color: #a7b698;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.stats article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 21px 24px;
  background: #fff;
}
.stats article > span {
  font-size: 12px;
  color: #85907c;
}
.stats strong {
  display: block;
  font-size: 31px;
  font-weight: 500;
  margin-top: 12px;
}
.stats small {
  font-size: 11px;
  color: #8e9788;
  margin-left: 8px;
}
.two-col {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 22px;
}
.panel {
  padding: 27px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.section-head h2 {
  margin: 0;
}
.book-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 15px;
  border: none;
  border-bottom: 1px solid #edf0e7;
  border-radius: 0;
  text-align: left;
  padding: 15px 0;
}
.book-row > span:last-child {
  margin-left: auto;
}
.book-row strong {
  font-size: 13px;
  font-weight: 550;
}
.book-row small {
  display: block;
  color: #919988;
  font-size: 11px;
  margin-top: 7px;
}
.book-symbol {
  background: #edf0e3;
  padding: 10px;
  border-radius: 8px;
  font-size: 22px;
  color: #71885f;
}
.guide h2 {
  margin: 15px 0;
}
.guide p {
  font-size: 12px;
  max-width: 330px;
}
.step-line {
  font-size: 11px;
  color: #a5af9a;
  display: flex;
  justify-content: space-between;
  margin: 27px 0;
}
.step-line span {
  color: #5c7451;
}
.spaced {
  margin-top: 22px;
}
footer {
  margin: 35px 0 18px;
  display: flex;
  gap: 8px;
  color: #87907e;
  font-size: 10px;
  align-items: center;
}
footer > span:last-child {
  margin-left: auto;
}
.version {
  background: #3b5040;
  color: white;
  border-radius: 4px;
  padding: 3px 6px;
}
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 17px;
}
.toolbar input {
  flex: 1;
  min-width: 150px;
}
input,
select,
textarea {
  border: 1px solid #dce2d5;
  border-radius: 7px;
  padding: 11px;
  background: #fbfcf8;
  color: #344b3b;
  max-width: 100%;
}
textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.7;
}
label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 18px;
  font-size: 12px;
  color: #6a7962;
}
.check-label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.check-label input {
  accent-color: var(--green);
}
.table-meta {
  font-size: 11px;
  color: #889581;
  padding: 9px 0;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
th {
  font-weight: 500;
  color: #889581;
  background: #f5f7ef;
  padding: 12px;
}
td {
  padding: 16px 12px;
  border-bottom: 1px solid #edf0e7;
}
td small {
  display: block;
  color: #8a9683;
  margin-top: 5px;
}
.word-name {
  font-size: 17px;
  font-weight: 600;
}
.chunk-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.chunk-tags span {
  padding: 4px 7px;
  background: #f0f3e9;
  border: 1px solid #e2e8d8;
  border-radius: 4px;
}
.tag {
  font-size: 10px;
  color: #738368;
  padding: 5px 8px;
  border-radius: 4px;
  background: #f0f3e9;
  white-space: nowrap;
}
.tag.due {
  color: #a3613c;
  background: #faf0e4;
}
.row-actions {
  white-space: nowrap;
}
.fine {
  font-size: 11px;
  line-height: 1.8;
  color: #87917f;
}
.centered {
  text-align: center;
}
.empty {
  text-align: center;
  padding: 50px 20px;
  color: #8d9787;
}
.book-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.book-cover {
  min-height: 185px;
  border-radius: 8px;
  background: #e0e9d4;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-left: 6px solid #bdcdb0;
}
.book-cover span {
  font-size: 10px;
  color: #7f936f;
}
.book-cover strong {
  font-family: Georgia, "Microsoft YaHei", serif;
  font-size: 23px;
  margin: 28px 0;
  overflow-wrap: anywhere;
}
.book-cover small {
  font-size: 9px;
  letter-spacing: 2px;
  color: #8a9c7c;
}
.cover-1 {
  background: #e9e4d6;
  border-color: #d2c7ad;
}
.cover-2 {
  background: #dce8e5;
  border-color: #b7ccc5;
}
.book-card {
  padding: 20px;
}
.book-card > p {
  font-size: 11px;
}
.practice-intro {
  max-width: 650px;
  padding: 40px;
}
.practice-intro select {
  max-width: 340px;
}
.practice-panel {
  padding: 26px 40px;
}
.practice-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tiles {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 32px 10px 24px;
  justify-content: safe center;
  scrollbar-width: thin;
}
.tile {
  flex: 0 0 var(--tile-width, 91px);
  height: 91px;
  position: relative;
  border: 1px solid #d9e2d1;
  border-radius: 10px;
  background: #fbfcf7;
  display: grid;
  place-items: center;
}
.tile.current {
  border: 2px solid #527d52;
  background: #f1f7e7;
  box-shadow: 0 0 0 4px #eff4e7;
}
.unit {
  font-size: var(--unit-font, 25px);
  font-weight: 600;
  z-index: 1;
  position: relative;
}
.tile > .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  position: absolute;
  left: calc(50% + var(--dx) - 4.5px);
  top: calc(50% + var(--dy) - 4.5px);
  box-shadow: 0 0 0 3px #fff8;
  z-index: 2;
}
.dot-mode .dot {
  opacity: 1;
}
.tiles.dot .tile[style*="--dx:0px;--dy:0px"] .dot {
  width: 32px;
  height: 32px;
  left: calc(50% - 16px);
  top: calc(50% - 16px);
  opacity: 0.23;
  z-index: 0;
}
.position .unit {
  transform: translate(var(--dx), var(--dy));
}
.position .dot {
  display: none;
}
.tile.done {
  background: #eaf1df;
  border-color: #ccdabb;
}
.tile.done .unit {
  transform: translate(0, 0);
}
.tile.done .dot {
  display: none;
}
.tile-check {
  display: none;
  position: absolute;
  right: 6px;
  bottom: 4px;
  color: #719659;
  font-size: 10px;
}
.tile.done .tile-check {
  display: block;
}
.practice-message {
  text-align: center;
  color: #6f8163;
  font-size: 12px;
  min-height: 30px;
  margin: 0 0 15px;
}
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 79px);
  gap: 10px;
  justify-content: center;
}
.numpad button {
  height: 70px;
  padding: 7px;
  background: #fff;
  border: 1px solid #dbe3d2;
  box-shadow: 0 3px 0 #e7ebdf;
}
.numpad button:active {
  transform: translateY(2px);
}
.numpad span {
  display: block;
  font-size: 22px;
}
.numpad small {
  display: block;
  font-size: 9px;
  margin-top: 4px;
  color: #98a28c;
}
.rating {
  text-align: center;
  border-top: 1px solid #e6ecdf;
  margin-top: 20px;
  padding-top: 12px;
}
.rating .actions {
  justify-content: center;
}
.rating p {
  font-size: 12px;
}
.audio-note {
  font-size: 10px;
  text-align: center;
  color: #8a9582;
  margin-top: 24px;
}
.big-number {
  font-size: 55px;
  margin: 20px 0;
}
.big-number small {
  display: block;
  font-size: 12px;
  color: #88947e;
  margin-top: 8px;
}
.review-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid #edf0e7;
  font-size: 12px;
}
.review-row strong {
  min-width: 100px;
}
.review-row > span:nth-child(2) {
  flex: 1;
  color: #8a9682;
}
.review-row > span:nth-child(3) {
  color: #889780;
}
.settings {
  max-width: 850px;
}
.settings h2:not(:first-child) {
  margin-top: 30px;
}
.settings > label {
  max-width: 380px;
}
.mode-options {
  display: flex;
  gap: 20px;
}
.mode-card {
  position: relative;
  border: 1px solid #dce4d3;
  padding: 20px;
  border-radius: 10px;
  flex: 1;
  cursor: pointer;
}
.mode-card:has(input:checked) {
  background: #f1f5e9;
  border-color: #8da57c;
}
.mode-card input {
  position: absolute;
  top: 15px;
  right: 15px;
  accent-color: var(--green);
}
.mode-card small {
  font-size: 11px;
  line-height: 1.8;
  color: #8b9581;
}
.mode-demo {
  width: 85px;
  height: 85px;
  border: 1px solid #cbd8bf;
  border-radius: 8px;
  display: grid;
  place-items: center;
  position: relative;
  margin-bottom: 12px;
  background: #fff;
}
.mode-demo b {
  font-size: 23px;
}
.mode-demo i {
  position: absolute;
  left: 10px;
  top: 10px;
  background: var(--red);
  border-radius: 50%;
  height: 9px;
  width: 9px;
}
.position-demo b {
  position: absolute;
  left: 7px;
  top: 6px;
}
.mapping {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.mapping > div {
  border: 1px solid #e2e8d9;
  padding: 15px;
  border-radius: 8px;
}
.mapping p {
  font-size: 11px;
}
.reminder {
  margin-top: 20px;
  padding: 12px 18px;
  background: #e6edda;
  border: 1px solid #d8e3c8;
  border-radius: 9px;
  font-size: 12px;
}
.reminder[hidden],
[hidden] {
  display: none !important;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 15px;
  width: 600px;
  max-width: calc(100vw - 30px);
  max-height: 90vh;
  padding: 27px;
  color: #314731;
  background: #fff;
}
dialog::backdrop {
  background: #20392d66;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 21px;
}
dialog p {
  font-size: 12px;
}
dialog fieldset {
  border: 1px solid #e1e6d9;
  border-radius: 8px;
  margin: 10px 0 18px;
  padding: 14px;
}
dialog legend {
  font-size: 11px;
  color: #819074;
}
dialog details {
  margin-bottom: 20px;
}
summary {
  cursor: pointer;
  font-size: 13px;
  color: #68835a;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 22px;
  max-width: 90vw;
  background: #294535;
  color: white;
  box-shadow: 0 5px 20px #203e3722;
  border-radius: 8px;
  z-index: 10;
  font-size: 12px;
}
.error {
  color: #b44f41 !important;
}
svg {
  max-width: 100%;
}
@media (min-width: 1500px) {
  main {
    padding: 0 65px;
  }
  .hero {
    padding: 42px 55px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 205px;
    padding: 25px 15px;
  }
  main {
    margin-left: 205px;
    padding: 0 25px;
  }
  .brand {
    font-size: 18px;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .book-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .hero {
    padding: 28px;
  }
  .sample-tiles > div {
    width: 65px;
    height: 65px;
  }
  .hero h2 {
    font-size: 26px;
  }
  .stats article {
    padding: 17px;
  }
  .stats {
    gap: 10px;
  }
  header > div {
    gap: 10px;
  }
  #date {
    display: none;
  }
}
@media (max-width: 700px) {
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    height: auto;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 17px;
  }
  .brand-icon {
    height: 30px;
    width: 30px;
    line-height: 30px;
    font-size: 25px;
  }
  .brand small {
    display: none;
  }
  .side-label,
  .sidebar-note,
  .local-status {
    display: none;
  }
  nav {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    margin-top: 12px;
  }
  nav button {
    font-size: 0;
    gap: 0;
    padding: 9px 12px;
    flex-shrink: 0;
  }
  nav button span {
    font-size: 11px;
  }
  nav b {
    font-size: 9px;
    margin-left: 5px;
  }
  main {
    margin-left: 0;
    padding: 0 18px;
  }
  header {
    height: 65px;
  }
  .page-title {
    margin-top: 25px;
  }
  h1 {
    font-size: 25px;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 27px;
    gap: 28px;
  }
  .hero h2 {
    font-size: 27px;
  }
  .hero-visual {
    gap: 18px;
  }
  .visual-grid {
    display: none;
  }
  .sample-tiles > div {
    width: 70px;
    height: 70px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .panel {
    padding: 20px;
  }
  .book-cards {
    grid-template-columns: 1fr;
  }
  .practice-panel {
    padding: 18px 12px;
  }
  .tiles {
    gap: 9px;
    justify-content: flex-start;
  }
  .tile {
    flex-basis: var(--tile-width, 82px);
    height: 86px;
  }
  .numpad {
    grid-template-columns: repeat(3, 75px);
  }
  .mode-options {
    gap: 10px;
  }
  .mode-card {
    padding: 14px 10px;
  }
  .review-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .review-row strong {
    min-width: 70px;
  }
  .mapping {
    gap: 6px;
  }
  .mapping > div {
    padding: 9px;
  }
  .mapping p {
    overflow-wrap: anywhere;
  }
  .toolbar > * {
    flex: 1;
    min-width: 120px;
  }
  .row-actions button {
    padding: 6px 4px;
  }
  footer > span:last-child {
    font-size: 9px;
  }
  .step-line {
    font-size: 10px;
  }
  .actions button {
    font-size: 12px;
  }
  dialog {
    padding: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.pwa-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: #62735d;
  font-size: 11px;
}
.pwa-bar > span {
  margin-right: auto;
}
.pwa-bar button {
  min-height: 44px;
  font-size: 12px;
}
@media (max-width: 700px) {
  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
  .sidebar {
    padding-top: calc(12px + env(safe-area-inset-top));
    position: relative;
  }
  nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 0;
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: #edf0e7;
    border-top: 1px solid #dce2d7;
    z-index: 20;
    overflow: visible;
  }
  nav button {
    font-size: 19px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 6px 1px;
    min-height: 58px;
    position: relative;
    border-radius: 7px;
  }
  nav button span {
    font-size: 10px;
    white-space: nowrap;
  }
  nav b {
    position: absolute;
    top: 0;
    right: 3px;
    font-size: 9px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  button {
    min-height: 44px;
  }
  main {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  #toast {
    bottom: calc(90px + env(safe-area-inset-bottom));
  }
  dialog {
    max-height: calc(100dvh - 40px);
    overscroll-behavior: contain;
  }
  body[data-view="practice"] main > header,
  body[data-view="practice"] .pwa-bar {
    display: none;
  }
  body[data-view="practice"] .page-title {
    margin: 16px 0;
    gap: 10px;
  }
  body[data-view="practice"] .page-title h1 {
    margin: 6px 0;
  }
  body[data-view="practice"] .page-title > .quiet {
    align-self: flex-end;
  }
  body[data-view="practice"] .tiles {
    padding-top: 22px;
    padding-bottom: 18px;
  }
  .row-actions {
    white-space: normal;
  }
  .row-actions button {
    min-width: 44px;
  }
}
