:root {
  --background: #f6f1e7;
  --foreground: #17201b;
  --ink-soft: #5d675f;
  --paper: #fffdf8;
  --line: #ddd4c4;
  --green: #1ba66d;
  --summer: #e9f6df;
  --summer-line: #c9ddbd;
  --red: #e84d35;
  --blue: #326fdc;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(125deg, rgba(232, 77, 53, 0.12), transparent 36%),
    linear-gradient(320deg, rgba(50, 111, 220, 0.13), transparent 34%),
    var(--background);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 34px;
  min-height: 100vh;
  padding: 34px;
}

.control-panel,
.phone-stage {
  min-width: 0;
}

.control-panel {
  align-self: center;
  padding: 36px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(23, 32, 27, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.74);
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  max-width: 700px;
  margin: 22px 0 14px;
  font-size: clamp(34px, 5.2vw, 66px);
  line-height: 1.02;
  letter-spacing: 0;
}

.lede {
  max-width: 640px;
  margin: 0 0 26px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.68;
}

.uploader,
.share-card {
  border: 1px solid rgba(23, 32, 27, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 22px 70px rgba(68, 53, 32, 0.1);
}

.uploader {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
  padding: 18px;
}

.uploader label {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ddf3d5, #fff7e5);
  color: #246444;
  border: 1px solid rgba(79, 145, 96, 0.28);
  font-weight: 800;
}

.secondary-action {
  min-height: 46px;
  border: 1px solid rgba(27, 166, 109, 0.26);
  border-radius: 8px;
  background: rgba(27, 166, 109, 0.1);
  color: var(--green);
  padding: 0 10px;
  font-weight: 900;
}

.uploader-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wide-action {
  grid-column: 1 / -1;
}

.uploader input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.uploader span {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

.admin-books {
  margin: 0 0 20px;
  border: 1px solid rgba(23, 32, 27, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
  padding: 16px;
}

.admin-books-head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.admin-books-head strong {
  font-size: 17px;
}

.admin-books-head span {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.admin-book-list {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
}

.admin-book-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--foreground);
  padding: 9px 11px;
  text-align: left;
}

.admin-book-main {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.admin-book-item.active {
  border-color: rgba(27, 166, 109, 0.5);
  background: rgba(27, 166, 109, 0.08);
}

.admin-book-item strong,
.admin-book-item span {
  display: block;
}

.admin-book-item strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.32;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-book-item span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
}

.admin-book-item em {
  color: var(--red);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.admin-book-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.admin-book-actions button {
  min-height: 34px;
  border: 1px solid rgba(27, 166, 109, 0.22);
  border-radius: 8px;
  background: rgba(27, 166, 109, 0.08);
  color: var(--green);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 900;
}

.admin-book-actions .danger-action {
  border-color: rgba(232, 77, 53, 0.25);
  background: rgba(232, 77, 53, 0.08);
  color: var(--red);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(23, 32, 27, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--foreground);
  padding: 0 14px;
  outline: none;
}

.form-grid input:focus,
.form-grid select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(27, 166, 109, 0.12);
}

.share-card {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 18px;
  max-width: 560px;
  margin-top: 22px;
  padding: 18px;
}

.share-card strong,
.share-card span {
  display: block;
}

.share-card strong {
  overflow: hidden;
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-card span {
  color: #7b7f78;
  font-size: 16px;
}

.share-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 6px;
  color: white;
  font-weight: 900;
  box-shadow: inset 0 -18px 32px rgba(0, 0, 0, 0.16);
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.feature-list span {
  border: 1px solid rgba(23, 32, 27, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  padding: 9px 12px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.phone-stage {
  display: grid;
  place-items: center;
}

.phone {
  width: min(430px, 100%);
  min-height: 780px;
  overflow: hidden;
  border: 10px solid #d9e8cb;
  border-radius: 44px;
  background: #fffaf0;
  box-shadow:
    0 28px 90px rgba(102, 91, 58, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.mini-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: 58px;
  border-bottom: 1px solid #e6ded0;
  background: rgba(248, 246, 240, 0.92);
  padding: 0 12px;
}

.mini-nav button {
  border: 0;
  background: transparent;
  color: #202821;
  font-size: 30px;
  line-height: 1;
}

.mini-nav strong {
  text-align: center;
  font-size: 17px;
}

.hidden {
  display: none !important;
}

.shelf-screen {
  height: 680px;
  overflow-y: auto;
  padding: 14px 12px 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(250, 243, 230, 0.72)),
    #fff8ed;
}

.shelf-search {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 10px;
  padding: 8px 0 14px;
  background: linear-gradient(180deg, #fff8ed 72%, rgba(255, 248, 237, 0));
}

.shelf-search input {
  height: 42px;
  border: 1px solid rgba(168, 142, 109, 0.24);
  border-radius: 999px;
  background: #fffef9;
  color: #5b4535;
  padding: 0 18px;
  outline: none;
  box-shadow: inset 0 1px 5px rgba(92, 69, 44, 0.08);
}

.shelf-search button {
  border: 0;
  border-radius: 999px;
  background: #fffef9;
  color: #8a6a4b;
  font-size: 23px;
  box-shadow: 0 8px 20px rgba(92, 69, 44, 0.1);
}

.book-shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
  row-gap: 14px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.54), transparent 12%, transparent 88%, rgba(214, 184, 136, 0.16)),
    #fff5e7;
  padding: 18px 14px 28px;
  box-shadow:
    inset 0 0 0 1px rgba(168, 142, 109, 0.12),
    0 18px 40px rgba(110, 78, 42, 0.13);
}

.shelf-book {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  min-height: 202px;
  border: 0;
  background: transparent;
  color: #4b3328;
  padding: 0 2px 8px;
  text-align: center;
}

.shelf-book.active .book-cover {
  outline: 3px solid rgba(27, 166, 109, 0.2);
}

.book-cover {
  --cover: var(--green);
  position: relative;
  display: grid;
  place-items: center;
  width: 106px;
  height: 138px;
  overflow: hidden;
  border-radius: 4px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), transparent 38%),
    var(--cover);
  color: white;
  box-shadow:
    0 18px 24px rgba(87, 58, 32, 0.2),
    inset 10px 0 0 rgba(0, 0, 0, 0.12),
    inset -1px 0 0 rgba(255, 255, 255, 0.2);
}

.book-cover::after {
  content: none;
}

.book-cover b {
  position: relative;
  z-index: 2;
  max-width: 74px;
  color: #fff;
  font-size: 24px;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}

.shelf-book strong {
  display: -webkit-box;
  min-height: 45px;
  overflow: hidden;
  color: #4a2f25;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.shelf-book em {
  display: block;
  margin-top: 2px;
  color: var(--red);
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}

.shelf-plank {
  grid-column: 1 / -1;
  height: 13px;
  margin: -2px 0 20px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #fffef6, #e7d8bd 76%, #cdb58b);
  box-shadow:
    0 8px 18px rgba(95, 66, 31, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.reader-screen {
  min-height: 680px;
}

.product-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 18px 18px 10px;
}

.product-head span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.product-head h2 {
  margin: 6px 0 6px;
  font-size: 21px;
  line-height: 1.28;
  letter-spacing: 0;
}

.product-head p {
  margin: 0;
  color: #777a72;
  font-size: 14px;
}

.price-tag {
  align-self: start;
  min-width: 74px;
  border-radius: 999px;
  background: var(--red);
  color: white;
  padding: 9px 13px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(232, 77, 53, 0.24);
}

.book-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: 520px;
  margin: 8px 18px 14px;
  perspective: 1500px;
  touch-action: pan-y;
  user-select: none;
  overflow: hidden;
  contain: layout paint;
}

.book-shadow {
  position: absolute;
  bottom: 35px;
  width: 76%;
  height: 34px;
  border-radius: 50%;
  background: rgba(48, 38, 22, 0.26);
  filter: blur(18px);
}

.flip-book {
  width: 334px;
  height: 472px;
  flex: 0 0 auto;
  transform: translateZ(0);
  will-change: contents;
}

.flip-page {
  width: 334px;
  height: 472px;
  overflow: hidden;
  border: 1px solid rgba(84, 72, 54, 0.15);
  border-radius: 8px 12px 12px 8px;
  background: var(--paper);
  box-shadow:
    inset 10px 0 16px rgba(44, 34, 19, 0.05),
    inset -1px 0 2px rgba(44, 34, 19, 0.04);
}

.flip-page img,
.pdf-page-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}

.stf__parent {
  filter: drop-shadow(0 24px 34px rgba(44, 34, 19, 0.2));
  width: 334px !important;
  height: 472px !important;
  min-width: 334px !important;
  min-height: 472px !important;
  max-width: 334px !important;
  max-height: 472px !important;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.stf__block {
  border-radius: 8px 12px 12px 8px;
  width: 334px !important;
  height: 472px !important;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.page-card {
  position: relative;
  width: min(334px, 90%);
  aspect-ratio: 0.72;
  overflow: hidden;
  border: 1px solid rgba(84, 72, 54, 0.18);
  border-radius: 8px 12px 12px 8px;
  background: var(--paper);
  box-shadow:
    0 26px 52px rgba(44, 34, 19, 0.22),
    inset 12px 0 20px rgba(44, 34, 19, 0.07);
  transform-origin: left center;
  animation: settle-page 420ms ease-out;
}

.book-stage.prev .page-card {
  transform-origin: right center;
}

.page-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}

.page-fold {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 3;
  width: 28px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.12), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.designed-page {
  --accent: var(--green);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 34px 30px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.07), transparent 12%),
    radial-gradient(circle at 78% 18%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 32%),
    #fffdf8;
}

.designed-page > span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.designed-page h3 {
  margin: 22px 0 12px;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
}

.designed-page p {
  margin: 0;
  color: #626a62;
  font-size: 17px;
  line-height: 1.65;
}

.page-visual {
  position: relative;
  flex: 1;
  min-height: 170px;
  margin-top: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 11%, white);
}

.page-visual i,
.page-visual b,
.page-visual em {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: var(--accent);
}

.page-visual i {
  width: 70px;
  height: 70px;
  left: 28px;
  top: 32px;
}

.page-visual b {
  width: 120px;
  height: 18px;
  right: 26px;
  top: 44px;
}

.page-visual em {
  width: 160px;
  height: 18px;
  right: 26px;
  top: 80px;
  opacity: 0.48;
}

.lock-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 30px;
  background: rgba(255, 253, 248, 0.78);
  text-align: center;
  backdrop-filter: blur(9px);
}

.lock-layer strong {
  font-size: 22px;
}

.lock-layer span {
  color: var(--ink-soft);
  line-height: 1.5;
}

.reader-tools {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 14px;
  padding: 0 22px 16px;
}

.reader-tools button {
  height: 44px;
  border: 0;
  border-radius: 999px;
  border: 1px solid rgba(93, 136, 92, 0.22);
  background: linear-gradient(135deg, #edf8e5, #fff7e6);
  color: #2c6f48;
  font-size: 28px;
  line-height: 1;
}

.reader-tools button:disabled {
  cursor: default;
  opacity: 0.28;
}

.reader-tools div {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.reader-tools meter {
  width: 100%;
  height: 8px;
}

.action-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-top: 1px solid #e3dccf;
  background: #fffdf8;
  padding: 13px 14px 18px;
}

.action-bar button {
  min-height: 46px;
  border: 1px solid #ddd4c4;
  border-radius: 8px;
  background: white;
  color: #202821;
  font-weight: 900;
}

.audio-upload-label {
  margin-top: 12px;
}

.audio-status {
  display: block;
  margin-top: 8px;
  color: #58635c;
  font-size: 14px;
  font-weight: 700;
}

.study-companion-panel {
  display: grid;
  gap: 12px;
  margin: 14px 14px 16px;
  border: 1px solid #e3dccf;
  border-radius: 8px;
  background: #fffdf8;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(76, 55, 30, 0.08);
}

.study-companion-panel > div:first-child {
  display: grid;
  gap: 4px;
}

.study-companion-panel strong {
  color: #17231c;
  font-size: 16px;
}

.study-companion-panel span,
.study-companion-panel p {
  margin: 0;
  color: #6d756d;
  font-size: 13px;
  line-height: 1.55;
}

.study-companion-panel audio {
  width: 100%;
}

.study-companion-panel audio[hidden] {
  display: none;
}

.audio-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}

.audio-list::-webkit-scrollbar {
  display: none;
}

.audio-list button {
  flex: 0 0 auto;
  border: 1px solid #d9cebd;
  border-radius: 999px;
  background: #fffaf1;
  color: #6d5638;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.audio-list button.active {
  border-color: #21b36b;
  background: #e9f8ef;
  color: #16834d;
}

.study-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.study-actions button {
  min-height: 42px;
  border: 1px solid #cddfd3;
  border-radius: 8px;
  background: #f5fbf6;
  color: var(--green);
  font-weight: 900;
}

.study-actions button:disabled {
  opacity: 0.42;
}

.admin-preview-panel {
  margin-top: 10px;
}

.vocab-admin-field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: #17231c;
  font-weight: 900;
}

.vocab-admin-field textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid #ddd6ca;
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
  background: #fffdf8;
  color: #17231c;
  line-height: 1.6;
}

.vocab-admin-field span {
  color: #66736a;
  font-size: 13px;
  line-height: 1.55;
}

.vocab-panel {
  display: grid;
  gap: 12px;
  margin: 0 14px 16px;
  border: 1px solid #e3dccf;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(76, 55, 30, 0.06);
}

.vocab-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.vocab-panel-head > div {
  display: grid;
  gap: 4px;
}

.vocab-panel strong {
  color: #17231c;
  font-size: 16px;
}

.vocab-panel span {
  color: #6d756d;
  font-size: 13px;
  line-height: 1.5;
}

.vocab-panel-head button,
.vocab-add button {
  border: 1px solid #cddfd3;
  border-radius: 8px;
  background: #f5fbf6;
  color: var(--green);
  font-weight: 900;
}

.vocab-panel-head button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.vocab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vocab-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e2d8c9;
  border-radius: 999px;
  padding: 7px 10px;
  background: #fffaf1;
  color: #473a2b;
  font-size: 13px;
  font-weight: 800;
}

.vocab-item button {
  border: 0;
  border-radius: 999px;
  background: #21b36b;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 8px;
}

.vocab-item.done {
  background: #edf8ef;
  border-color: #b8dfc2;
  color: #2f7c47;
}

.vocab-item input {
  width: 14px;
  height: 14px;
  accent-color: var(--green);
}

.vocab-empty {
  width: 100%;
  color: #7a7167;
  font-size: 13px;
  line-height: 1.6;
}

.vocab-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}

.vocab-add input {
  min-height: 40px;
  border: 1px solid #ddd6ca;
  border-radius: 8px;
  padding: 0 12px;
  background: #fffdf8;
}

.vocab-add button {
  min-height: 40px;
}

.word-practice-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(86, 98, 76, 0.32);
  padding: 20px;
}

.word-practice-card {
  position: relative;
  width: min(92vw, 390px);
  min-height: 520px;
  border-radius: 10px;
  background: #fff;
  padding: 18px 18px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.word-practice-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 1px solid #e1ddd4;
  border-radius: 999px;
  background: #fff;
  color: #8a8176;
  font-weight: 900;
}

.word-practice-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 34px 20px;
}

.word-practice-tabs button {
  min-width: 42px;
  height: 34px;
  border: 1px solid #f0c96c;
  border-radius: 999px;
  background: #fffef7;
  color: #4d7b57;
  font-weight: 900;
}

.word-practice-tabs button.active {
  background: #e9fff1;
  border-color: #21b36b;
  color: #15975a;
}

.word-practice-body {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding-top: 20px;
}

.practice-word {
  min-height: 66px;
  font-size: 42px;
  line-height: 1.15;
  color: #2d2f33;
  text-align: center;
}

.word-part {
  display: inline-block;
}

.part-0 { color: #1f7ae0; }
.part-1 { color: #f05b7d; }
.part-2 { color: #22a66a; }
.part-3 { color: #a566d8; }

.practice-meaning {
  color: #66736a;
  font-size: 14px;
  text-align: center;
  min-height: 22px;
}

.practice-phonics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
}

.practice-phonics span,
.practice-phonics button {
  min-width: 38px;
  border: 1px solid #dcefe4;
  border-radius: 7px;
  background: #f4fbf7;
  color: #329466;
  padding: 7px 10px;
  font-weight: 900;
  text-align: center;
}

.practice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.practice-actions button,
.practice-record button,
.practice-spell-box button,
.practice-example button {
  min-height: 42px;
  border: 1px solid #cddfd3;
  border-radius: 8px;
  background: #21b36b;
  color: #fff;
  font-weight: 900;
}

.practice-record {
  display: grid;
  gap: 6px;
  width: 100%;
}

.practice-record span {
  color: #7a837c;
  font-size: 12px;
  text-align: center;
}

.practice-example {
  width: 100%;
  border-top: 1px solid #edf0e9;
  padding-top: 14px;
  text-align: center;
}

.practice-example strong {
  display: block;
  color: #8a8176;
  font-size: 13px;
  margin-bottom: 8px;
}

.practice-example p {
  margin: 0 0 10px;
  color: #4b554e;
  line-height: 1.6;
}

.practice-spell-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  width: 100%;
}

.practice-spell-box input {
  min-height: 42px;
  border: 1px solid #ddd6ca;
  border-radius: 8px;
  padding: 0 12px;
}

.practice-spell-box p {
  grid-column: 1 / -1;
  margin: 0;
  color: #6d756d;
  font-size: 13px;
}

@keyframes settle-page {
  0% {
    transform: translateX(4px) scale(0.992);
    filter: brightness(0.96);
  }
  100% {
    transform: translateX(0) scale(1);
    filter: brightness(1);
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .control-panel {
    padding: 12px 4px 0;
  }

  .phone {
    min-height: 730px;
  }
}

.viewer-body {
  min-height: 100vh;
  background: #f7f3ed;
}

.viewer-app {
  width: min(480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: #fff9ef;
  color: #2c2018;
  box-shadow: 0 0 0 1px rgba(120, 88, 52, 0.08);
}

.viewer-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  height: 72px;
  border-bottom: 1px solid #e9dfd1;
  background: rgba(248, 248, 248, 0.96);
  padding: 0 8px;
}

.viewer-top button {
  border: 0;
  background: transparent;
  color: #1c1f1d;
  font-size: 34px;
  line-height: 1;
}

.viewer-top div {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.viewer-top strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 21px;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-top span {
  color: #777;
  font-size: 13px;
  font-weight: 700;
}

.viewer-shelf-screen {
  min-height: 100vh;
  padding: 16px 14px 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 247, 235, 0.88)),
    #fff7ec;
}

.viewer-search {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 10px;
  margin-bottom: 10px;
}

.viewer-search input {
  height: 45px;
  border: 1px solid rgba(170, 143, 108, 0.24);
  border-radius: 999px;
  background: #fffef9;
  color: #5b4535;
  padding: 0 18px;
  outline: none;
  box-shadow: inset 0 1px 5px rgba(92, 69, 44, 0.08);
}

.viewer-search button {
  border: 0;
  border-radius: 999px;
  background: #fffef9;
  color: #8a6a4b;
  font-size: 24px;
  box-shadow: 0 8px 20px rgba(92, 69, 44, 0.1);
}

.viewer-book-shelf {
  min-height: calc(100vh - 86px);
}

.category-admin {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
  border: 1px solid rgba(23, 32, 27, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
  padding: 16px;
}

.category-admin strong,
.category-admin span {
  display: block;
}

.category-admin strong {
  font-size: 17px;
}

.category-admin span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.category-add {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 10px;
}

.category-rename {
  grid-template-columns: 1fr 132px;
}

.category-add input {
  min-width: 0;
  min-height: 46px;
  border: 1px solid rgba(23, 32, 27, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--foreground);
  padding: 0 13px;
  outline: none;
}

.category-tools {
  display: flex;
  justify-content: flex-end;
}

.category-tools button {
  min-height: 38px;
  border-color: rgba(232, 77, 53, 0.25);
  background: rgba(232, 77, 53, 0.08);
  color: var(--red);
  padding: 0 14px;
}

.category-add button:disabled,
.category-add input:disabled,
.category-tools button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid rgba(142, 109, 72, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #7b6248;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.category-tabs button.active {
  border-color: rgba(27, 166, 109, 0.42);
  background: var(--green);
  color: white;
  box-shadow: 0 8px 18px rgba(27, 166, 109, 0.18);
}

.viewer-category-tabs,
.phone-category-tabs {
  margin-bottom: 14px;
}

.shelf-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed rgba(146, 117, 80, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: #826d55;
  padding: 24px;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
}

.viewer-reader-screen {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f5f1e7, #eaf6df 58%, #fff8e9);
}

.viewer-reader-bar {
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  align-items: center;
  min-height: 68px;
  background: rgba(255, 250, 240, 0.94);
  color: #1d2b22;
  border-bottom: 1px solid rgba(128, 113, 76, 0.18);
  padding: 0 10px;
}

.viewer-reader-bar button {
  border: 0;
  background: transparent;
  color: #315f43;
  font-size: 34px;
}

.viewer-reader-bar div {
  min-width: 0;
  text-align: center;
}

.viewer-reader-bar strong,
.viewer-reader-bar span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-reader-bar strong {
  font-size: 18px;
}

.viewer-reader-bar span {
  margin-top: 3px;
  color: #7a745f;
  font-size: 12px;
}

.viewer-book-stage {
  height: min(560px, calc(100vh - 220px));
  margin: 0;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.9), transparent 58%),
    linear-gradient(180deg, #f8f2e6, #eaf5df);
}

.reader-loading {
  display: grid;
  place-items: center;
  width: 334px;
  height: 472px;
  border-radius: 8px;
  background: #fff;
  color: #6d6256;
  padding: 24px;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14);
}

.viewer-reader-tools {
  margin: 0;
  border-top: 1px solid rgba(126, 113, 78, 0.14);
  background: rgba(255, 250, 240, 0.9);
  color: #4e5f4b;
}

.viewer-reader-tools button {
  color: #2c6f48;
}

.viewer-bottom-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 68px;
  background: rgba(255, 250, 240, 0.94);
  border-top: 1px solid rgba(126, 113, 78, 0.14);
}

.viewer-bottom-tools button {
  border: 0;
  background: transparent;
  color: #315f43;
  font-size: 28px;
}

.practice-material-panel {
  display: grid;
  gap: 12px;
  margin: 14px;
  border: 1px solid rgba(106, 142, 91, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.9);
  padding: 16px;
  box-shadow: 0 16px 38px rgba(92, 77, 44, 0.08);
}

.practice-material-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.practice-material-head strong,
.practice-material-head span {
  display: block;
}

.practice-material-head strong {
  font-size: 18px;
}

.practice-material-head span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 13px;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.resource-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  border: 1px solid rgba(106, 142, 91, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, #fbfff4, #fff8e8);
  color: #273326;
  padding: 10px;
  text-decoration: none;
}

.resource-item strong,
.resource-item em {
  display: block;
}

.resource-item strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-item em {
  margin-top: 3px;
  color: #7a745f;
  font-size: 12px;
  font-style: normal;
}

.resource-item b {
  border-radius: 999px;
  background: #dff1d3;
  color: #276446;
  padding: 6px 9px;
  font-size: 12px;
}

.resource-empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(106, 142, 91, 0.22);
  border-radius: 8px;
  color: #7a745f;
  padding: 14px;
  text-align: center;
}

@media (max-width: 520px) {
  .viewer-app {
    width: 100%;
  }

  .viewer-book-stage {
    height: min(548px, calc(100vh - 208px));
  }

  .viewer-shelf-screen {
    padding-top: 14px;
  }
}

@media (max-width: 520px) {
  .form-grid,
  .share-card {
    grid-template-columns: 1fr;
  }

  .share-thumb {
    width: 86px;
  }

  .book-stage {
    height: 470px;
  }

  .designed-page h3 {
    font-size: 28px;
  }
}
