:root {
  --paper: #f5f3ec;
  --paper-deep: #e9e4d7;
  --ink: #171814;
  --forest: #103f34;
  --mint: #afd6c4;
  --lime: #91c51a;
  --orange: #ef8f08;
  --line: rgba(23, 24, 20, 0.2);
  --white: #fff;
  --danger: #b54b3d;
  --serif: "Songti SC", "STSong", "SimSun", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 8%, rgba(145, 197, 26, 0.1), transparent 22%),
    var(--paper);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.portal-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 100px;
  padding: 12px clamp(20px, 5vw, 74px);
}

.portal-brand {
  align-items: center;
  display: flex;
  gap: 17px;
}

.portal-brand img {
  height: auto;
  width: 130px;
}

.portal-brand span {
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 17px;
}

.portal-brand strong {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
}

.portal-brand small {
  color: var(--forest);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.portal-back,
.portal-ghost {
  border-bottom: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: 12px;
  padding: 9px 0;
}

.portal-main {
  margin: 0 auto;
  max-width: 1320px;
  min-height: calc(100vh - 100px);
  padding: clamp(54px, 8vw, 110px) clamp(20px, 5vw, 70px) 110px;
}

.portal-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.25em;
  margin: 0 0 26px;
}

.portal-heading {
  font-family: var(--serif);
  font-size: clamp(39px, 6vw, 76px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin: 0;
}

.portal-heading small {
  color: var(--forest);
  display: block;
  font-family: Georgia, serif;
  font-size: 0.19em;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.4;
  margin-top: 14px;
}

.portal-intro {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.85;
  margin: 24px 0 0;
  max-width: 660px;
}

.portal-intro small {
  color: #70716a;
  display: block;
  font-family: Arial, sans-serif;
  font-size: 10px;
  line-height: 1.7;
  margin-top: 7px;
}

.login-layout {
  align-items: start;
  display: grid;
  gap: clamp(44px, 9vw, 130px);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.68fr);
}

.login-card,
.account-card,
.create-card {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--ink);
  box-shadow: 10px 12px 0 rgba(23, 24, 20, 0.1);
  padding: clamp(28px, 4vw, 48px);
}

.login-card h2,
.create-card h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  margin: 0 0 28px;
}

.form-grid {
  display: grid;
  gap: 17px;
}

.form-grid label,
.account-field {
  display: grid;
  gap: 7px;
  font-size: 10px;
  letter-spacing: 0.07em;
}

.form-grid input,
.account-field input {
  border: 1px solid var(--line);
  border-radius: 0;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--white);
  color: var(--ink);
  outline: none;
}

.form-grid input:focus,
.account-field input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 2px rgba(16, 63, 52, 0.12);
}

.portal-button {
  align-items: center;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 99px;
  color: var(--white);
  display: inline-flex;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  transition: background 180ms ease, transform 180ms ease;
}

.portal-button:hover {
  background: var(--forest);
  transform: translateY(-2px);
}

.portal-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.portal-button small {
  color: var(--mint);
  font-size: 7px;
  letter-spacing: 0.1em;
  margin-left: 7px;
}

.portal-button-light {
  background: transparent;
  color: var(--ink);
}

.form-message {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  min-height: 19px;
}

.dashboard-head {
  align-items: end;
  display: flex;
  gap: 30px;
  justify-content: space-between;
  margin-bottom: 55px;
}

.dashboard-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.member-dashboard-head {
  align-items: end;
  border-bottom: 1px solid var(--ink);
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 34px;
  padding-bottom: 34px;
}

.member-dashboard-head .portal-eyebrow {
  color: var(--forest);
  margin-bottom: 18px;
}

.member-hero-title {
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.04;
  margin: 0;
}

.member-hero-subtitle {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.7;
  margin: 20px 0 0;
}

.member-hero-subtitle small,
.teacher-library-heading p small,
.member-collection-heading p small {
  color: #77786f;
  display: block;
  font-family: Georgia, serif;
  font-size: 9px;
  margin-top: 5px;
}

.user-chip {
  align-items: center;
  background: var(--mint);
  border: 1px solid var(--ink);
  border-radius: 99px;
  display: inline-flex;
  font-family: var(--serif);
  font-size: 12px;
  padding: 10px 16px;
}

.collection-summary {
  align-items: center;
  background: var(--mint);
  border: 1px solid var(--ink);
  display: flex;
  gap: 16px;
  margin: 0 0 70px;
  min-height: 54px;
  padding: 12px 18px;
  width: fit-content;
}

.collection-summary:empty {
  display: none;
}

.collection-summary span {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.collection-summary strong {
  border-left: 1px solid rgba(23, 24, 20, 0.35);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  padding-left: 16px;
}

.member-collection {
  margin-top: 12px;
}

.member-collection-heading {
  align-items: end;
  display: grid;
  gap: 30px;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.45fr);
  margin-bottom: 34px;
}

.member-collection-heading .portal-eyebrow {
  margin-bottom: 16px;
}

.member-collection-heading h2 {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 62px);
  font-weight: 500;
  letter-spacing: -0.05em;
  margin: 0;
}

.member-collection-heading > p {
  border-left: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.75;
  margin: 0;
  padding-left: 18px;
}

.book-shelf {
  display: grid;
  gap: 24px 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.member-book {
  background: transparent;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  transition: transform 180ms ease;
}

.member-book:hover {
  transform: translateY(-6px);
}

.member-book-index {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: flex;
  font-family: Georgia, serif;
  font-size: 9px;
  height: 34px;
  justify-content: center;
  left: 14px;
  position: absolute;
  top: 14px;
  width: 34px;
  z-index: 2;
}

.member-book-cover {
  aspect-ratio: 4 / 5;
  background: var(--paper-deep);
  border: 1px solid var(--ink);
  box-shadow: 9px 10px 0 rgba(23, 24, 20, 0.12);
  display: block;
  overflow: hidden;
  padding: 10px;
}

.member-book-cover img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.member-book-copy {
  display: block;
  padding: 21px 5px 0;
}

.member-book-copy > small {
  color: var(--forest);
  display: block;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.member-book h3 {
  font-family: Georgia, serif;
  font-size: clamp(22px, 2.4vw, 31px);
  font-weight: 500;
  line-height: 1.08;
  margin: 11px 0 8px;
}

.member-book p {
  font-family: var(--serif);
  font-size: 11px;
  margin: 0;
}

.member-book-copy > span:last-child {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 18px;
  font-size: 9px;
}

.teacher-library {
  border-top: 1px solid var(--ink);
  margin-top: 80px;
  padding-top: 55px;
}

.teacher-library-heading {
  align-items: end;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.55fr);
  justify-content: space-between;
  margin-bottom: 30px;
}

.teacher-library-heading .portal-eyebrow {
  margin-bottom: 15px;
}

.teacher-library-heading h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: -0.04em;
  margin: 0;
}

.teacher-library-heading p {
  border-left: 1px solid var(--ink);
  color: #6d6e68;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.7;
  margin: 0;
  padding-left: 18px;
}

.teacher-download-list {
  border-top: 1px solid var(--line);
}

.teacher-download-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 22px;
  grid-template-columns: 36px 1fr auto;
  padding: 20px 8px;
}

.teacher-download-row > span {
  color: var(--orange);
  font-family: Georgia, serif;
  font-size: 11px;
}

.teacher-download-row strong,
.teacher-download-row small {
  display: block;
}

.teacher-download-row strong {
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 500;
}

.teacher-download-row small {
  font-family: var(--serif);
  font-size: 10px;
  margin-top: 5px;
}

.teacher-download-actions {
  display: flex;
  gap: 8px;
}

.teacher-download-actions a {
  border: 1px solid var(--ink);
  border-radius: 99px;
  font-size: 9px;
  padding: 9px 12px;
}

.teacher-download-actions a:first-child {
  background: var(--ink);
  color: white;
}

.admin-grid {
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
}

.permission-picker {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, 1fr);
}

.permission-picker label {
  align-items: center;
  border: 1px solid var(--line);
  display: flex;
  font-size: 12px;
  gap: 9px;
  min-height: 44px;
  padding: 10px;
}

.account-list {
  display: grid;
  gap: 12px;
}

.account-list-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.account-list-heading h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  margin: 8px 0 0;
}

.account-count {
  color: #6d6e68;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.account-card {
  box-shadow: none;
  padding: 20px 22px;
}

.account-card-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.account-identity {
  min-width: 0;
}

.account-card-head strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.account-identity > span {
  color: #6d6e68;
  display: block;
  font-size: 10px;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-head-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 8px;
  padding: 7px 10px;
}

.status-pill.is-active {
  background: var(--mint);
  border-color: var(--forest);
}

.account-edit-button,
.account-delete-button {
  background: transparent;
  border: 1px solid var(--ink);
  min-height: 32px;
  padding: 6px 12px;
}

.account-edit-button:hover {
  background: var(--ink);
  color: var(--white);
}

.account-delete-button {
  border-color: var(--danger);
  color: var(--danger);
}

.account-delete-button:hover {
  background: var(--danger);
  color: var(--white);
}

.account-delete-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.account-protected {
  color: #77786f;
  font-size: 9px;
}

.account-overview {
  border-top: 1px solid var(--line);
  color: #686a64;
  display: grid;
  font-size: 10px;
  gap: 5px;
  line-height: 1.55;
  margin-top: 16px;
  padding-top: 13px;
}

.account-editor {
  border-top: 1px solid var(--ink);
  margin-top: 18px;
  padding-top: 20px;
}

.account-editor .permission-picker {
  margin-top: 16px;
}

.admin-access-note {
  background: rgba(178, 216, 202, 0.38);
  border-left: 2px solid var(--forest);
  font-size: 11px;
  line-height: 1.7;
  margin: 16px 0 0;
  padding: 11px 13px;
}

.account-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

.account-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 18px;
}

.account-actions .portal-button {
  min-height: 40px;
  padding: 9px 17px;
}

.active-toggle {
  align-items: center;
  display: flex;
  font-size: 11px;
  gap: 8px;
}

.empty-state {
  border: 1px dashed var(--line);
  color: #6d6e68;
  padding: 36px;
  text-align: center;
}

@media (max-width: 900px) {
  .login-layout,
  .admin-grid,
  .member-dashboard-head,
  .member-collection-heading,
  .teacher-library-heading {
    grid-template-columns: 1fr;
  }

  .member-dashboard-head,
  .member-collection-heading,
  .teacher-library-heading {
    align-items: start;
  }

  .book-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .direction-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .portal-header {
    min-height: 84px;
    padding: 8px 16px;
  }

  .portal-brand {
    gap: 8px;
  }

  .portal-brand img {
    width: 105px;
  }

  .portal-brand span {
    padding-left: 8px;
  }

  .portal-brand strong {
    font-size: 9px;
  }

  .portal-brand small {
    font-size: 5px;
  }

  .portal-back {
    font-size: 9px;
  }

  .portal-main {
    padding: 55px 18px 80px;
  }

  .dashboard-head {
    align-items: start;
    flex-direction: column;
  }

  .dashboard-actions {
    width: 100%;
  }

  .book-shelf,
  .direction-grid,
  .permission-picker,
  .account-fields {
    grid-template-columns: 1fr;
  }

  .teacher-download-row {
    grid-template-columns: 30px 1fr;
  }

  .teacher-download-actions {
    grid-column: 2;
    flex-wrap: wrap;
  }

  .member-book {
    min-height: 245px;
  }

  .login-card,
  .create-card,
  .account-card {
    padding: 25px 20px;
  }

  .account-card-head {
    align-items: start;
    flex-direction: column;
  }

  .account-head-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .account-overview {
    margin-top: 14px;
  }
}

/* Unified member bookshelf · member6 */
.member-collection-bordered,
.access-map {
  border-top: 1px solid var(--ink);
  margin-top: 82px;
  padding-top: 58px;
}

.member-direction-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.member-direction {
  appearance: none;
  background: #efe8d8;
  border: 1px solid var(--ink);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  font: inherit;
  min-height: 430px;
  overflow: hidden;
  padding: 0;
  position: relative;
  text-align: left;
  transition: box-shadow 180ms ease, transform 180ms ease;
  width: 100%;
}

.member-direction:nth-child(1) {
  background: #f0c766;
}

.member-direction:nth-child(2) {
  background: #afd6c4;
}

.member-direction:nth-child(3) {
  background: #d2d9e9;
}

.member-direction:nth-child(4) {
  background: #d6dfb0;
}

.member-direction.is-open:hover {
  box-shadow: 10px 12px 0 var(--ink);
  transform: translate(-4px, -5px);
}

.member-direction.is-locked {
  cursor: pointer;
}

.member-direction.is-locked::after {
  background: rgba(245, 243, 236, 0.56);
  content: "";
  inset: 0;
  position: absolute;
  transition: background 180ms ease;
  z-index: 3;
}

.member-direction.is-locked:hover::after {
  background: rgba(245, 243, 236, 0.36);
}

.member-direction-index,
.member-direction-state {
  font-size: 8px;
  letter-spacing: 0.1em;
  position: absolute;
  top: 16px;
  z-index: 5;
}

.member-direction-index {
  left: 16px;
}

.member-direction-state {
  right: 16px;
}

.member-direction-art {
  align-items: center;
  display: flex;
  height: 215px;
  justify-content: center;
  overflow: hidden;
  padding: 48px 24px 12px;
}

.member-direction-art img {
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform 220ms ease;
}

.member-direction.is-open:hover .member-direction-art img {
  transform: rotate(-2deg) scale(1.035);
}

.member-direction-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 18px 18px;
}

.member-direction-copy small {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.member-direction-copy strong {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  margin-top: 12px;
}

.member-direction-copy > span {
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.7;
  margin-top: 9px;
}

.member-direction-enter {
  border-top: 1px solid rgba(23, 24, 20, 0.4);
  display: block;
  font-size: 8px;
  margin-top: auto;
  padding: 15px 18px;
  position: relative;
  z-index: 5;
}

.member-book {
  appearance: none;
  border: 0;
  color: var(--ink);
  font: inherit;
  padding: 0;
  text-align: left;
}

.member-book-state {
  background: var(--ink);
  border-radius: 999px;
  color: var(--white);
  font-size: 7px;
  letter-spacing: 0.08em;
  padding: 7px 9px;
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 2;
}

.member-book.is-locked {
  cursor: pointer;
}

.member-book.is-locked .member-book-cover,
.member-book.is-locked .member-book-copy {
  filter: grayscale(0.7);
  opacity: 0.48;
}

.member-book.is-locked:hover {
  transform: none;
}

.dragon-shelf {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dragon-episode {
  appearance: none;
  background: #0d0e11;
  border: 1px solid var(--ink);
  color: #f5e5a7;
  display: flex;
  flex-direction: column;
  font: inherit;
  padding: 0;
  text-align: left;
  transition: box-shadow 180ms ease, transform 180ms ease;
  width: 100%;
}

.dragon-episode:not(.is-locked):hover {
  box-shadow: 9px 10px 0 rgba(23, 24, 20, 0.18);
  transform: translateY(-5px);
}

.dragon-episode-image {
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid rgba(245, 229, 167, 0.3);
  display: block;
  overflow: hidden;
  position: relative;
}

.dragon-episode-image img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.dragon-episode-image i {
  align-items: center;
  background: rgba(245, 229, 167, 0.92);
  border-radius: 50%;
  bottom: 14px;
  color: #0d0e11;
  display: flex;
  font-size: 12px;
  font-style: normal;
  height: 38px;
  justify-content: center;
  position: absolute;
  right: 14px;
  width: 38px;
}

.dragon-episode-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.dragon-episode-copy small {
  color: rgba(245, 229, 167, 0.65);
  font-size: 7px;
  letter-spacing: 0.16em;
}

.dragon-episode-copy strong {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  margin-top: 9px;
}

.dragon-episode-copy span {
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--serif);
  font-size: 10px;
  margin-top: 8px;
}

.dragon-episode-action {
  border-top: 1px solid rgba(245, 229, 167, 0.28);
  display: block;
  font-size: 8px;
  letter-spacing: 0.08em;
  padding: 14px 20px;
}

.dragon-episode.is-locked {
  cursor: pointer;
  filter: grayscale(0.78);
  opacity: 0.48;
}

.modal-open {
  overflow: hidden;
}

.portal-modal {
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 18px 22px 0 rgba(23, 24, 20, 0.22);
  display: grid;
  gap: 30px;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.52fr);
  left: 50%;
  max-height: calc(100vh - 40px);
  max-width: 760px;
  overflow: auto;
  padding: clamp(30px, 5vw, 54px);
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 36px);
  z-index: 10001;
}

.portal-modal[hidden] {
  display: none;
}

.portal-modal::before {
  background: rgba(13, 14, 11, 0.62);
  content: "";
  inset: -100vh -100vw;
  position: fixed;
  z-index: -1;
}

.portal-modal-close {
  align-items: center;
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  color: white;
  display: flex;
  font-size: 22px;
  height: 38px;
  justify-content: center;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 38px;
}

.permission-modal-copy h2 {
  font-family: var(--serif);
  font-size: clamp(31px, 5vw, 48px);
  font-weight: 500;
  letter-spacing: -0.04em;
  margin: 0 0 22px;
}

.permission-modal-copy > p:not(.portal-eyebrow) {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.75;
}

.permission-contact {
  color: #72736c;
}

.permission-phone {
  border-bottom: 1px solid var(--ink);
  display: inline-block;
  font-family: Georgia, serif;
  font-size: 25px;
  margin-top: 8px;
  padding-bottom: 5px;
}

.portal-modal > img {
  align-self: center;
  border: 1px solid var(--line);
  max-width: 100%;
}

.video-modal {
  background: #0d0e11;
  color: #f5e5a7;
  display: block;
  max-width: 1040px;
  padding: 30px;
}

.video-modal::before {
  background: rgba(0, 0, 0, 0.84);
}

.video-modal-head {
  align-items: end;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr auto;
  margin-bottom: 20px;
}

.video-modal-head .portal-eyebrow {
  grid-column: 1 / -1;
  margin: 0;
}

.video-modal-head h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 500;
  margin: 0;
}

.portal-modal-close-light {
  background: #f5e5a7;
  color: #0d0e11;
}

.language-switch {
  display: flex;
  gap: 7px;
}

.language-switch button {
  background: transparent;
  border: 1px solid rgba(245, 229, 167, 0.55);
  color: #f5e5a7;
  font-size: 9px;
  padding: 9px 12px;
}

.language-switch button.is-active {
  background: #f5e5a7;
  color: #0d0e11;
}

.video-modal video {
  aspect-ratio: 16 / 9;
  background: black;
  display: block;
  width: 100%;
}

.book-detail-main {
  padding-top: clamp(48px, 7vw, 90px);
}

.member-book-detail-hero {
  align-items: center;
  display: grid;
  gap: clamp(40px, 7vw, 90px);
  grid-template-columns: minmax(260px, 0.58fr) minmax(0, 1fr);
}

.member-book-detail-cover {
  background: var(--paper-deep);
  border: 1px solid var(--ink);
  box-shadow: 12px 14px 0 rgba(23, 24, 20, 0.15);
  padding: 12px;
  position: relative;
}

.member-book-detail-cover img {
  display: block;
  width: 100%;
}

.member-book-detail-cover span {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: flex;
  font-family: Georgia, serif;
  height: 46px;
  justify-content: center;
  left: 25px;
  position: absolute;
  top: 25px;
  width: 46px;
}

.book-detail-chinese {
  font-family: var(--serif);
  font-size: 20px;
  margin: 18px 0 0;
}

.member-book-detail-hero .user-chip {
  margin-top: 28px;
}

.book-resource-grid {
  border-top: 1px solid var(--ink);
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 82px;
  padding-top: 50px;
}

.book-resource-card {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: clamp(26px, 4vw, 42px);
}

.book-resource-card-teacher {
  background: var(--mint);
}

.book-resource-card h2 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  margin: 0;
}

.book-resource-card > p:not(.portal-eyebrow) {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.8;
}

.book-resource-card > .portal-button,
.book-resource-actions {
  margin-top: auto;
}

.book-resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.book-resource-actions a {
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: white;
  font-size: 10px;
  padding: 12px 16px;
}

.book-resource-actions a + a {
  background: transparent;
  color: var(--ink);
}

@media (max-width: 980px) {
  .member-direction-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dragon-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .member-book-detail-hero,
  .book-resource-grid,
  .portal-modal {
    grid-template-columns: 1fr;
  }

  .member-book-detail-cover {
    margin: 0 auto;
    max-width: 380px;
  }

  .portal-modal > img {
    margin: 0 auto;
    max-width: 260px;
  }

  .video-modal {
    padding: 24px 14px 14px;
  }

  .video-modal-head {
    align-items: start;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .member-collection-bordered,
  .access-map {
    margin-top: 60px;
    padding-top: 42px;
  }

  .member-direction-grid,
  .dragon-shelf {
    grid-template-columns: 1fr;
  }

  .member-direction {
    min-height: 390px;
  }

  .dragon-episode {
    min-height: 0;
  }

  .portal-modal {
    box-shadow: 8px 10px 0 rgba(23, 24, 20, 0.22);
    max-height: calc(100vh - 24px);
    padding: 42px 22px 24px;
    width: calc(100% - 24px);
  }

  .video-modal {
    padding: 56px 12px 12px;
  }

  .language-switch {
    width: 100%;
  }

  .language-switch button {
    flex: 1;
  }
}
