:root {
  --bg-top: #eef0e7;
  --bg-bottom: #e3e7d9;
  --surface: rgba(255, 252, 246, 0.94);
  --ink: #2d3b2f;
  --muted: #667163;
  --line: rgba(136, 152, 124, 0.28);
  --accent: #7f9b65;
  --accent-dark: #5b7348;
  --warn: #d28b58;
  --gold: #c7a055;
  --shadow: 0 14px 30px rgba(63, 72, 50, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "LXGW WenKai", "KaiTi", "Kaiti SC", "STKaiti", "Noto Serif SC", serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 255, 255, 0.72), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(220, 226, 206, 0.5), transparent 24%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body.module-1 { --accent: #7f9b65; --accent-dark: #5b7348; }
body.module-2 { --accent: #7a93ad; --accent-dark: #576d84; }
body.module-3 { --accent: #c09a54; --accent-dark: #8d703a; }
body.module-4 { --accent: #c48466; --accent-dark: #955e45; }
body.module-5 { --accent: #8a7ab2; --accent-dark: #65588a; }
body.module-6 { --accent: #6f9d99; --accent-dark: #4d7571; }

.hidden { display: none !important; }

.xfd-bg-illustration {
  position: fixed;
  left: clamp(-128px, -11vw, -52px);
  bottom: clamp(-94px, -8vw, -30px);
  width: min(33vw, 420px);
  aspect-ratio: 1 / 1;
  display: none;
  pointer-events: none;
  z-index: 0;
}

.module-shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.02rem 0.82rem 1.5rem;
}

.module-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.68rem;
  margin-bottom: 0.82rem;
}

.module-main-topbar {
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 255, 255, 0.84), transparent 24%),
    linear-gradient(145deg, rgba(255, 253, 247, 0.98), rgba(247, 246, 238, 0.94));
  box-shadow: 0 18px 34px rgba(63, 72, 50, 0.08);
  padding: 0.96rem 1.08rem;
}

.module-brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.module-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.module-brand-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.module-brand-wrap:hover h1 {
  color: var(--accent-dark);
}

.module-top-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
  object-position: center 30%;
  border: 0;
  box-shadow: none;
  flex: 0 0 auto;
}

.module-top h1 {
  margin: 0;
  font-size: clamp(1.14rem, 2vw, 1.46rem);
  color: #4f5f45;
  letter-spacing: 0.01em;
}

.module-top-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.module-current-user {
  color: #58684d;
  font-weight: 900;
  white-space: nowrap;
  margin-right: 0.2rem;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(136, 152, 124, 0.22);
}

.module-home-btn,
.module-exit-btn {
  min-height: 36px;
  border: 1px solid rgba(136, 152, 124, 0.26);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.98);
  color: #516148;
  padding: 0 0.86rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(72, 84, 58, 0.07);
}

.module-home-btn:hover,
.module-exit-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.module-home-btn {
  background: color-mix(in srgb, var(--accent) 12%, #fff8f0);
}

.module-quick-nav {
  margin-bottom: 0.88rem;
  border: 1px solid rgba(136, 152, 124, 0.2);
  border-radius: 22px;
  background: rgba(255, 252, 246, 0.84);
  padding: 0.78rem;
}

.classroom-quick-nav {
  border-radius: 20px;
  padding: 0.68rem;
  box-shadow: 0 8px 18px rgba(72, 84, 58, 0.07);
}

.module-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.46rem;
}

.teacher-quick-nav .module-nav-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0.72rem 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(136, 152, 124, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(246, 244, 236, 0.92));
  color: #55654b;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.module-nav-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 52%, #fff);
  box-shadow: 0 8px 16px rgba(72, 84, 58, 0.1);
}

.module-nav-btn.active {
  color: #fff;
  border-color: var(--accent);
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 74%, #d7bc86));
}

.module-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.96), rgba(250, 248, 242, 0.94));
  box-shadow: 0 16px 30px rgba(63, 72, 50, 0.08);
  padding: 1.12rem;
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.module-card > .module-head {
  display: none;
}

.module-no {
  margin: 0;
  padding: 0.12rem 0.56rem;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, #fff);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 15%, #fff);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.group-corner {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 0.56rem;
  border-radius: 999px;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, #fff);
  background: color-mix(in srgb, var(--accent) 11%, #fff);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.module-card h2 {
  margin: 0.42rem 0 0.48rem;
  font-size: clamp(1.24rem, 2.4vw, 1.62rem);
  color: #4d5c43;
}

.dialog-tip {
  margin: 0.2rem 0 0.82rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.78;
  max-width: 880px;
}

.teacher-workbench .result-box {
  background: linear-gradient(180deg, #fbfffd 0%, #f5fbf8 100%);
}

.teacher-home-card h2 {
  margin-top: 0.42rem;
}

.teacher-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  margin-top: 0.86rem;
}

.teacher-home-tile {
  min-height: 116px;
  border: 1px solid #c6dfd0;
  border-radius: 18px;
  padding: 0.9rem;
  color: #24543f;
  text-decoration: none;
  background:
    radial-gradient(circle at 84% 20%, rgba(255, 255, 255, 0.86), transparent 28%),
    linear-gradient(135deg, #f8fff9 0%, #eef9f2 100%);
  box-shadow: 0 10px 22px rgba(45, 105, 75, 0.08);
  display: grid;
  align-content: center;
  gap: 0.3rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.teacher-home-tile strong {
  font-size: clamp(1.08rem, 2.6vw, 1.34rem);
}

.teacher-home-tile span {
  color: #5a7d70;
  font-weight: 700;
}

.teacher-home-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 14px 28px rgba(45, 105, 75, 0.14);
}

.teacher-home-tile.art {
  background: linear-gradient(135deg, #f4fbff 0%, #eef7ff 100%);
}

.teacher-home-tile.stars {
  background: linear-gradient(135deg, #fffaf0 0%, #fff3d8 100%);
}

.teacher-home-tile.show {
  background: linear-gradient(135deg, #fff6ef 0%, #ffeadf 100%);
}

.teacher-panel {
  scroll-margin-top: 16px;
  border-top: 1px dashed #c9ded1;
  padding-top: 0.72rem;
  margin-top: 0.72rem;
}

.teacher-panel:first-of-type {
  border-top: 0;
  margin-top: 0.3rem;
  padding-top: 0;
}

.teacher-panel h3 {
  margin: 0 0 0.46rem;
  color: #2d674f;
  font-size: 1.02rem;
}

.teacher-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.teacher-mini-card {
  border: 1px solid #c8ddd0;
  border-radius: 12px;
  background: #fff;
  padding: 0.55rem;
  min-height: 82px;
}

.teacher-mini-card p {
  margin: 0.12rem 0;
}

.teacher-art-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #d5e5dc;
  background: #f7fbf8;
}

.teacher-chat-layout {
  margin-top: 0.5rem;
}

.teacher-chat-list {
  min-height: 340px;
  max-height: 440px;
}

.teacher-feature-row {
  margin-top: 0.46rem;
}

.teacher-art-preview {
  margin-top: 0.56rem;
  min-height: 110px;
}

.teacher-record-panel {
  margin-top: 0.9rem;
}

.m4t-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.46rem;
}

.m4t-stat {
  border: 1px solid #cae0d3;
  border-radius: 11px;
  background: #fff;
  padding: 0.52rem 0.56rem;
}

.m4t-stat span {
  display: block;
  font-size: 0.82rem;
  color: #5d7f70;
}

.m4t-stat strong {
  display: block;
  margin-top: 0.14rem;
  color: #2c614c;
  font-size: 1.02rem;
}

.m4t-student-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 0.44rem;
}

.m4t-student-card {
  width: 100%;
  text-align: center;
  border: 1px solid #c9ddd1;
  border-radius: 11px;
  background: #fff;
  color: #2a5947;
  padding: 0.52rem 0.42rem;
  cursor: pointer;
}

.m4t-student-card.active {
  border-color: color-mix(in srgb, var(--accent) 65%, #fff);
  background: color-mix(in srgb, var(--accent) 13%, #fff);
}

.m4t-student-name {
  margin: 0;
  font-weight: 800;
}

.m4t-student-card .stars {
  display: block;
  margin-top: 0.16rem;
  font-size: 1.02rem;
}

.m4t-student-card .tiny-hint {
  margin-top: 0.12rem;
}

.m4t-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.m4t-compare-card {
  border: 1px solid #cfe0d6;
  border-radius: 8px;
  background: #fff;
  padding: 0.52rem;
}

.m4t-compare-card .poem-pre {
  border-top: 1px dashed #d6e4dc;
  margin-top: 0.34rem;
  padding-top: 0.42rem;
}

.m4t-star-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.34rem;
}

.m4t-star-pill {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.16rem 0.36rem;
  border: 1px solid #edd28a;
  border-radius: 8px;
  background: #fffaf0;
  padding: 0.34rem 0.48rem;
}

.m4t-star-pill.highlight {
  border-color: #dfb64d;
  background: #fff3c8;
}

.m4t-star-pill > span:first-child {
  color: #668477;
  font-weight: 800;
}

.m4t-star-pill strong {
  color: #7a5a0a;
}

.m4t-star-pill .stars {
  grid-column: 1 / -1;
  font-size: 1.24rem;
}

.m4t-star-arrow {
  color: #9b7a19;
  font-size: 1.3rem;
  font-weight: 900;
}

.m4t-compare-note {
  color: #2f8f60;
  font-weight: 800;
}

.list-line {
  border: 1px solid #d2e3d9;
  border-radius: 10px;
  background: #fff;
  padding: 0.5rem;
  margin-top: 0.42rem;
}

.list-line p {
  margin: 0.1rem 0;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
  color: #4b5944;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(136, 152, 124, 0.24);
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.96);
  color: var(--ink);
  padding: 0.72rem 0.8rem;
}

textarea { resize: vertical; }

.m1-input-wrap {
  margin-top: 0.58rem;
  font-size: 1rem;
  font-weight: 800;
  color: #2f654f;
}

.m1-input-wrap textarea,
#childInput,
#m3PoemText {
  min-height: 150px;
  max-height: none;
  overflow: hidden;
  border: 2px solid #b9dbc9;
  border-radius: 18px;
  background: repeating-linear-gradient(
    to bottom,
    #ffffff 0,
    #ffffff 35px,
    rgba(75, 169, 114, 0.12) 36px
  );
  color: #21483b;
  font-size: clamp(0.92rem, 1.5vw, 1.02rem);
  line-height: 1.65;
  padding: 0.86rem 1rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 8px 18px rgba(42, 92, 66, 0.06);
}

.m1-input-wrap textarea:focus,
#childInput:focus,
#m3PoemText:focus,
#m4PoemInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent), 0 10px 18px rgba(42, 92, 66, 0.08);
}

#m3PoemText {
  min-height: 260px;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-top: 0.52rem;
}

.feature-row .module-action-btn {
  min-height: 42px;
}

.module-action-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 18px;
  border: 1px solid var(--accent);
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 74%, #d7bc86));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  padding: 0.62rem 0.82rem;
  box-shadow: 0 12px 20px rgba(88, 102, 65, 0.12);
}

.module-action-btn.secondary {
  border-color: rgba(136, 152, 124, 0.24);
  background: rgba(255, 251, 245, 0.96);
  color: #59684f;
  box-shadow: none;
}

.module-action-btn.ghost {
  border-color: rgba(136, 152, 124, 0.22);
  background: rgba(255, 255, 255, 0.84);
  color: #657360;
  box-shadow: none;
}

.module-action-btn.danger {
  border-color: #e4a6a0;
  background: #fff5f3;
  color: #b84c42;
}

.module-action-btn.publish {
  border-color: #c99a3d;
  background: linear-gradient(90deg, #d7a849, #f0c769);
  color: #fff;
}

.module-action-btn:hover {
  filter: brightness(1.02);
}

.module-action-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.m4t-book-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.42fr);
  gap: 0.46rem;
  margin-top: 0.48rem;
}

.result-box,
.trend-box,
.chat-box,
.art-preview,
.dialog-box {
  border: 1px solid rgba(136, 152, 124, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  padding: 0.62rem;
  margin-top: 0.62rem;
}

.tiny-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
}

.tiny-hint.error {
  color: #b6513b;
  font-weight: 800;
}

.tiny-hint.success {
  color: #2f8f60;
  font-weight: 800;
}

.stars {
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0;
}

.visual-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  vertical-align: -0.08rem;
}

.visual-star {
  color: #fff3c7;
  font-size: 1.08em;
  line-height: 1;
  text-shadow: 0 0 0 #d6b163;
  -webkit-text-stroke: 1px #dfb64d;
}

.visual-star.filled {
  color: #f5bd22;
  text-shadow: 0 1px 0 #b98208, 0 2px 5px rgba(214, 151, 19, 0.28);
}

.star-badge {
  margin-top: 0.65rem;
  border: 1px solid #f0d598;
  border-radius: 12px;
  background: linear-gradient(120deg, #fff9eb, #fff4da);
  padding: 0.58rem 0.64rem;
}

.star-badge p {
  margin: 0;
}

.star-badge .stars {
  margin-top: 0.2rem;
  font-size: 1.08rem;
}

.guide-list {
  margin: 0.3rem 0 0;
  padding-left: 1.16rem;
  display: grid;
  gap: 0.28rem;
}

.dialog-pair {
  display: grid;
  gap: 0.52rem;
  margin-top: 0.62rem;
}

.dialog-box p {
  margin: 0;
  line-height: 1.56;
}

.xfd-mascot-widget,
body.module-1 .xfd-mascot-widget {
  display: none;
}

.m1-chat-layout {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.m1-side {
  border: 1px solid rgba(136, 152, 124, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.76), transparent 24%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.94) 0%, rgba(246, 244, 236, 0.98) 100%);
  padding: 0.92rem 0.8rem;
  text-align: center;
  position: sticky;
  top: 0.9rem;
  box-shadow: 0 16px 28px rgba(72, 84, 58, 0.07);
}

.m1-side-mascot {
  width: 120px;
  height: 120px;
  object-fit: cover;
  object-position: center center;
  border-radius: 24px;
  border: 0;
  box-shadow: none;
}

.m1-side-title {
  margin: 0.56rem 0 0.2rem;
  font-size: 1.02rem;
  font-weight: 800;
  color: #55654b;
}

.m1-side-tip {
  margin: 0;
  color: #6a7465;
  font-size: 0.86rem;
  line-height: 1.45;
}

.m1-chat-panel {
  border: 1px solid rgba(136, 152, 124, 0.18);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.9) 0%, rgba(248, 247, 241, 0.96) 100%);
  padding: 0.78rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.m1-chat-list {
  border: 1px solid rgba(136, 152, 124, 0.18);
  border-radius: 20px;
  background: rgba(247, 247, 241, 0.92);
  min-height: 360px;
  max-height: 500px;
  overflow-y: auto;
  padding: 0.72rem;
  display: grid;
  gap: 0.58rem;
}

.m1-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.42rem;
}

.m1-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: #2e6950;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  overflow: hidden;
}

.m1-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: inherit;
}

.m1-msg-bubble {
  max-width: min(78%, 560px);
  border: 1px solid rgba(136, 152, 124, 0.2);
  border-radius: 18px;
  padding: 0.58rem 0.68rem;
  line-height: 1.6;
  font-size: 0.94rem;
  word-break: break-word;
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  color: #384638;
}

.m1-msg-bot .m1-msg-bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 11px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 8px solid #fff;
}

.m1-msg-user {
  justify-content: flex-end;
}

.m1-msg-user .m1-msg-bubble {
  background: #f1eed9;
  border-color: #d6c891;
}

.m1-msg-user .m1-msg-bubble::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 11px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #f1eed9;
}

.example-panel {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.46rem;
}

.example-item {
  border: 1px dashed #bfd9cb;
  border-radius: 10px;
  padding: 0.58rem;
  background: #fbfffd;
}

.example-title {
  margin: 0 0 0.26rem;
  color: #35674f;
  font-weight: 800;
}

.m3-review-layout {
  grid-template-columns: 230px minmax(0, 1fr);
}

.m3-review-panel .mode-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.m3-review-chat {
  min-height: 360px;
  max-height: 520px;
}

.m3-review-chat .m1-msg-bubble {
  max-width: min(86%, 720px);
}

.compact-btn {
  margin-top: 0.44rem;
  min-height: 38px;
}

.m3-version-list {
  margin-top: 0.62rem;
  border: 1px solid #cbe0d4;
  border-radius: 12px;
  background: #fff;
  padding: 0.62rem;
  display: grid;
  gap: 0.46rem;
}

.m3-version-list > p {
  margin: 0;
}

.m3-version-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.56rem;
  border: 1px solid #d5e5dc;
  border-radius: 10px;
  background: #fbfffd;
  padding: 0.5rem 0.58rem;
}

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

.m3-version-card span {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.12rem;
}

.m3-version-card p {
  margin: 0;
  white-space: nowrap;
}

.m3-publish-status {
  margin-top: 0.56rem;
}

.m3-publish-status p {
  margin: 0;
  border: 1px solid #ead29a;
  border-radius: 12px;
  background: linear-gradient(120deg, #fffaf0, #fdf2d9);
  color: #8a6631;
  font-weight: 800;
  padding: 0.5rem 0.62rem;
}

.m3-review-extra {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.m3-review-note-card,
.m3-media-studio {
  border: 1px solid rgba(78, 171, 122, 0.24);
  border-radius: 8px;
  background: #f8fcfa;
  padding: 16px;
}

.m3-review-note-card h3,
.m3-media-studio h3 {
  margin: 0 0 10px;
  color: #285f48;
  font-size: 1.04rem;
}

.m3-review-note-card textarea {
  min-height: 92px;
  margin: 8px 0 10px;
}

.teacher-review-notes {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.teacher-inline-review {
  background: #fbfffc;
  padding: 12px;
}

.teacher-inline-review p {
  margin: 0.22rem 0;
}

.teacher-review-highlight {
  border-color: rgba(219, 169, 67, 0.42);
  background: #fffaf0;
}

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

.review-note-line {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4faf7;
  border: 1px solid rgba(78, 171, 122, 0.18);
  margin: 8px 0;
}

.review-note-line em {
  font-style: normal;
  color: #456f5d;
}

.m3-media-studio {
  margin: 16px 0 18px;
}

.m3-media-studio .form-grid {
  align-items: stretch;
}

.m3-media-studio textarea {
  min-height: 110px;
  resize: vertical;
}

.status-success {
  color: #2f8f5d;
  font-weight: 700;
}

.status-error {
  color: #b45b4b;
  font-weight: 700;
}

.m3-stars-stage {
  margin-top: 0.72rem;
}

.m3-stars-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.72rem;
}

.m4-showcase-meta {
  margin-top: 0.5rem;
  border: 1px solid #f0c9b5;
  border-radius: 12px;
  background: #fff8f3;
  color: #8a563c;
  padding: 0.5rem 0.62rem;
  font-weight: 800;
}

.m4-showcase-meta p {
  margin: 0;
}

.m4-create-panel {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 0.78rem;
  margin-top: 0.82rem;
  padding: 0.82rem;
  border: 1px solid #f0c9b5;
  border-radius: 18px;
  background:
    radial-gradient(circle at 95% 6%, rgba(255, 215, 184, 0.58), transparent 16%),
    linear-gradient(145deg, rgba(255, 250, 246, 0.98), rgba(247, 255, 250, 0.96));
}

.m4-create-left {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.5rem;
  min-height: 260px;
  border: 1px solid #d4e8dc;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  color: #2b664f;
  text-align: center;
  padding: 1rem;
}

.m4-create-left img {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 999px;
  border: 5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 24px rgba(61, 119, 84, 0.16);
}

.m4-create-left strong {
  font-size: 1.05rem;
  line-height: 1.45;
}

.m4-create-left span {
  color: #668879;
  line-height: 1.5;
}

.m4-create-main {
  display: grid;
  gap: 0.58rem;
}

.m4-create-main label {
  color: #2b664f;
  font-weight: 900;
}

#m4PoemInput {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border: 1px solid #cbe0d4;
  border-radius: 18px;
  background: repeating-linear-gradient(
    to bottom,
    #ffffff 0,
    #ffffff 32px,
    rgba(237, 143, 103, 0.1) 33px
  );
  color: #21483b;
  font-size: clamp(0.92rem, 1.4vw, 1rem);
  line-height: 1.65;
  padding: 0.78rem 0.9rem;
}

.m4-create-actions {
  margin-top: 0;
}

.m4-create-preview {
  min-height: 156px;
  border: 1px dashed #e5bca8;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  padding: 0.72rem;
}

.m4-generated-image {
  margin: 0;
}

.m4-generated-image img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
}

.m4-generated-image figcaption {
  margin-top: 0.45rem;
  color: #6c8378;
  font-weight: 700;
}

.m4-generated-plan,
.m4-modal-media {
  border: 1px solid #d7e6de;
  border-radius: 14px;
  background: #fff;
  padding: 0.72rem;
}

.m4-generated-plan h4,
.m4-modal-media h4 {
  margin: 0 0 0.42rem;
  color: #2b664f;
}

.m4-video-shots {
  display: grid;
  gap: 0.42rem;
}

.m4-video-shots div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.5rem;
  align-items: start;
  border: 1px solid #edf1eb;
  border-radius: 12px;
  background: #fbfffc;
  padding: 0.5rem 0.58rem;
}

.m4-video-shots strong {
  color: #b66441;
}

.m4-media-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.m4-media-badges span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.12rem 0.42rem;
}

.m4-play-btn {
  max-width: 180px;
  margin-top: 0.45rem;
}

.m4-showcase-title {
  margin: 1rem 0 0.2rem;
  color: #2b664f;
  font-size: clamp(1.15rem, 2vw, 1.38rem);
}

.module-5 {
  --m5-mint: #dff8ed;
  --m5-lavender: #eee8ff;
  --m5-cream: #fff8e8;
  --m5-peach: #ffe8dc;
  --m5-blue: #e6f5ff;
}

.module-5 .m5-growth-card {
  padding: clamp(1rem, 2vw, 1.35rem);
  border-color: #c9e6d7;
  background:
    radial-gradient(circle at 92% 6%, rgba(255, 226, 184, 0.72), transparent 16%),
    radial-gradient(circle at 8% 16%, rgba(218, 238, 255, 0.86), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 255, 251, 0.97) 100%);
}

.module-5 .m5-growth-card > h2 {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
  color: #235f49;
  font-size: clamp(1.42rem, 3vw, 1.95rem);
}

.module-5 .m5-growth-card > h2::before {
  content: "";
  width: 42px;
  height: 42px;
  border-radius: 16px 16px 10px 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.38), transparent 42%),
    linear-gradient(135deg, #8c79ce, #72c8c3);
  box-shadow: 0 8px 16px rgba(92, 85, 160, 0.18);
}

.module-5 .dialog-tip {
  max-width: 760px;
  margin-bottom: 0.9rem;
  color: #557567;
  font-weight: 800;
}

.m5-archive-section {
  position: relative;
  margin-top: 0.9rem;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  padding: clamp(0.82rem, 1.8vw, 1.12rem);
  box-shadow: 0 12px 28px rgba(47, 98, 72, 0.1);
  overflow: hidden;
}

.m5-archive-section::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -36px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  pointer-events: none;
}

.m5-record-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.28)),
    linear-gradient(135deg, var(--m5-lavender), var(--m5-mint));
}

.m5-poem-section {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.75), transparent 20%),
    linear-gradient(135deg, var(--m5-cream), var(--m5-blue));
}

.m5-archive-section h3 {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.52rem;
  margin: 0 0 0.36rem;
  color: #235f49;
  font-size: clamp(1.12rem, 2vw, 1.34rem);
}

.m5-archive-section h3 span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 6px 14px rgba(92, 85, 160, 0.14);
  font-weight: 900;
}

.m5-archive-section > .tiny-hint {
  position: relative;
  z-index: 1;
  margin: 0 0 0.72rem;
  color: #5d7d70;
  font-weight: 800;
}

.module-5 .m5-form-grid {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-5 label {
  color: #2f604d;
  font-weight: 900;
}

.module-5 input,
.module-5 textarea,
.module-5 select {
  border: 2px solid rgba(142, 194, 166, 0.6);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  color: #254b3e;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.module-5 input:focus,
.module-5 textarea:focus,
.module-5 select:focus {
  outline: none;
  border-color: #8c79ce;
  box-shadow: 0 0 0 4px rgba(140, 121, 206, 0.14);
}

.module-5 #m5MaterialText {
  min-height: 126px;
  border-color: #d7c7a0;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.96) 0, rgba(255, 255, 255, 0.96) 34px, rgba(255, 221, 159, 0.34) 35px),
    #fffdf6;
  line-height: 1.75;
}

.module-5 .module-input-modes {
  position: relative;
  z-index: 1;
  border: 2px dashed rgba(140, 121, 206, 0.34);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.68rem;
}

.module-5 .mode-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.module-5 .mode-tab-btn {
  min-height: 42px;
  border-width: 2px;
  border-color: rgba(140, 121, 206, 0.26);
  color: #4f477f;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(87, 77, 137, 0.08);
}

.module-5 .mode-tab-btn.active {
  background: linear-gradient(90deg, #8c79ce, #9fc4ef);
  color: #fff;
}

.module-5 .row {
  position: relative;
  z-index: 1;
}

.module-5 .module-action-btn {
  min-height: 48px;
  border-radius: 18px;
  font-size: 1rem;
  box-shadow: 0 10px 18px rgba(100, 82, 174, 0.16);
}

.module-5 .module-action-btn.secondary {
  border-color: #9bcdb1;
  background: #f5fff9;
  color: #2b6a50;
}

.module-5 .m5-search-box {
  position: relative;
  z-index: 1;
  margin-top: 0.8rem;
  border: 2px solid rgba(225, 194, 128, 0.44);
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.7), transparent),
    #fff9e9;
  padding: 0.76rem;
}

.module-5 .book-toolbar {
  align-items: flex-end;
  gap: 0.58rem;
}

.m5-search-label {
  margin: 0;
  flex: 1 1 280px;
}

.module-5 .book-actions {
  flex-wrap: wrap;
}

.module-5 .book-actions button {
  min-height: 38px;
  border: 2px solid #ead29c;
  background: #fffdfa;
  color: #7b6232;
  font-weight: 900;
  box-shadow: 0 6px 12px rgba(140, 108, 48, 0.08);
}

.module-5 .book-page {
  border: 2px solid #efdcae;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255, 247, 218, 0.9) 0 18px, transparent 18px),
    repeating-linear-gradient(to bottom, #fffefa 0, #fffefa 32px, rgba(239, 220, 174, 0.44) 33px),
    #fffefa;
  min-height: 170px;
  padding: 0.78rem 0.88rem 0.78rem 1.25rem;
  color: #2b5143;
}

.module-5 .m5-poem-section.result-box {
  border: 2px solid rgba(130, 192, 210, 0.48);
  padding: clamp(0.82rem, 1.8vw, 1.12rem);
}

.m5-book-select {
  position: relative;
  z-index: 1;
  margin-top: 0.68rem;
}

.module-5 #m5CollectionReader {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.58rem;
}

.module-5 #m5CollectionReader > p:first-child {
  margin: 0.2rem 0 0;
  color: #235f49;
  font-size: 1.06rem;
}

.module-5 .book-item {
  border: 2px solid rgba(196, 220, 209, 0.9);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 14%, rgba(255, 231, 159, 0.45), transparent 18%),
    #ffffff;
  padding: 0.72rem;
  box-shadow: 0 8px 16px rgba(47, 98, 72, 0.08);
}

.module-5 .book-item p {
  margin: 0 0 0.42rem;
  color: #265845;
}

.module-5 .book-item pre {
  border-radius: 14px;
  background: #f8fffb;
  padding: 0.62rem;
  color: #294a40;
  font-weight: 800;
}

.module-5 #m5Stats,
.module-5 #m5Trend,
.module-5 #m5Comment {
  border-radius: 20px;
}

.m5-growth-chart {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(78, 171, 122, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfffd, #f2faf6);
  padding: 10px;
}

.m5-growth-chart svg {
  display: block;
  min-width: 620px;
  width: 100%;
  height: auto;
}

.m5-growth-chart text {
  fill: #446b59;
  font-size: 13px;
  font-weight: 800;
}

.chart-axis {
  stroke: #8fb9a2;
  stroke-width: 2;
}

.chart-grid {
  stroke: rgba(143, 185, 162, 0.28);
  stroke-width: 1;
}

.chart-area {
  fill: rgba(101, 183, 132, 0.16);
}

.chart-line {
  fill: none;
  stroke: #3f9f67;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: #f4c34f;
  stroke: #2f6b4f;
  stroke-width: 2;
}

.m3-star-work-card {
  border: 1px solid #cddfd3;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 12px 22px rgba(47, 98, 72, 0.08);
  min-height: 220px;
  display: grid;
  grid-template-rows: 118px 1fr;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.m3-star-work-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px rgba(47, 98, 72, 0.13);
}

.m3-star-work-card:focus {
  outline: 3px solid rgba(211, 162, 74, 0.3);
  outline-offset: 3px;
}

.m3-star-work-cover {
  padding: 0.78rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.42rem;
  position: relative;
  overflow: hidden;
}

.m3-star-work-cover::before,
.m3-star-work-cover::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.m3-star-work-cover::before {
  width: 90px;
  height: 90px;
  right: -18px;
  top: -16px;
}

.m3-star-work-cover::after {
  width: 42px;
  height: 42px;
  right: 18px;
  top: 22px;
}

.m3-star-work-cover span,
.m3-star-work-cover strong {
  position: relative;
  z-index: 1;
}

.m3-star-work-cover span {
  align-self: flex-start;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  padding: 0.18rem 0.44rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.m3-star-work-cover strong {
  font-size: 1rem;
  line-height: 1.25;
}

.m3-star-work-cover em {
  position: relative;
  z-index: 1;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 800;
}

.m3-star-work-body {
  padding: 0.7rem;
  display: grid;
  align-content: space-between;
  gap: 0.66rem;
}

.m3-star-work-thumb {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #d7e6dd;
}

.m3-star-work-text {
  margin: 0;
  color: #24483c;
  line-height: 1.52;
  font-weight: 800;
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 7.6em;
  overflow: hidden;
}

.m3-star-work-meta {
  display: grid;
  gap: 0.28rem;
  color: #668376;
  font-size: 0.82rem;
  font-weight: 800;
}

.m3-stars-empty {
  grid-column: 1 / -1;
  min-height: 160px;
  border: 1px dashed #bed8c8;
  border-radius: 16px;
  background: #fbfffd;
  color: #416d59;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
}

.m3-stars-empty strong,
.m3-stars-empty span {
  display: block;
}

.m3-star-work-card.tone-1 .m3-star-work-cover {
  background: linear-gradient(135deg, #f1b443, #f7d875);
}

.m3-star-work-card.tone-2 .m3-star-work-cover {
  background: linear-gradient(135deg, #55a4d8, #8bc6ef);
}

.m3-star-work-card.tone-3 .m3-star-work-cover {
  background: linear-gradient(135deg, #ef86a7, #f5b5ca);
}

.m3-star-work-card.tone-4 .m3-star-work-cover {
  background: linear-gradient(135deg, #49b875, #85d694);
}

.m3-star-work-card.tone-5 .m3-star-work-cover {
  background: linear-gradient(135deg, #7d8bdc, #72c5d1);
}

.m3-work-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: clamp(0.8rem, 3vw, 2rem);
}

.m3-work-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 52, 40, 0.35);
  backdrop-filter: blur(5px);
}

.m3-work-modal-card {
  position: relative;
  z-index: 1;
  width: min(920px, 96vw);
  max-height: min(86vh, 860px);
  overflow: auto;
  border: 1px solid #bed9c8;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcf9 100%);
  box-shadow: 0 24px 58px rgba(33, 72, 56, 0.24);
  padding: clamp(0.9rem, 2vw, 1.25rem);
}

.m3-modal-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #c9ded1;
  border-radius: 999px;
  background: #fff;
  color: #2c624b;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.m3-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  margin-top: -0.2rem;
  border-bottom: 1px solid #d8e8df;
  padding-bottom: 0.72rem;
}

.m3-modal-head h3 {
  margin: 0.34rem 0 0.24rem;
  color: #235943;
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
}

.m3-modal-head p {
  margin: 0;
  color: #668577;
  font-weight: 800;
}

.m3-modal-ai-star {
  min-width: 154px;
  border: 1px solid #ecd399;
  border-radius: 15px;
  background: #fff8e8;
  color: #8d682b;
  padding: 0.58rem 0.68rem;
  text-align: center;
}

.m3-modal-ai-star span,
.m3-modal-ai-star strong {
  display: block;
}

.m3-modal-body {
  display: grid;
  gap: 0.76rem;
  margin-top: 0.78rem;
}

.m3-modal-image {
  margin: 0;
  border: 1px solid #cfe2d7;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.m3-modal-image img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.m3-modal-poem,
.m3-modal-feedback,
.m3-peer-stars-panel,
.m3-modal-audio {
  border: 1px solid #cfe1d6;
  border-radius: 16px;
  background: #fff;
  padding: 0.72rem;
}

.m3-modal-poem h4,
.m3-modal-feedback h4,
.m3-peer-stars-panel h4,
.m3-modal-audio h4 {
  margin: 0 0 0.48rem;
  color: #285f49;
}

.m3-modal-audio audio {
  width: 100%;
  display: block;
}

.m3-modal-poem pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  line-height: 1.75;
  color: #203f35;
  font-size: 1rem;
}

.m3-modal-feedback {
  color: #365f50;
  line-height: 1.58;
}

.m3-peer-stars-panel p {
  margin: 0 0 0.5rem;
  color: #55786a;
  font-weight: 800;
}

.m3-peer-star-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.42rem;
}

.m3-peer-star-buttons button {
  min-height: 42px;
  border: 1px solid #e6c981;
  border-radius: 999px;
  background: #fffaf0;
  color: #d0a33a;
  font-weight: 900;
  cursor: pointer;
}

.m3-peer-star-buttons button.active {
  background: linear-gradient(90deg, #d8a748, #f1cb6e);
  color: #fff;
}

.m3-peer-comment-wrap {
  display: grid;
  gap: 0.36rem;
  margin-top: 0.58rem;
  color: #2e624c;
  font-weight: 800;
}

.m3-peer-comment-wrap textarea {
  width: 100%;
  min-height: 86px;
  border: 1px solid #cfe2d6;
  border-radius: 14px;
  background: #fbfffd;
  color: #24483c;
  font: inherit;
  line-height: 1.55;
  padding: 0.56rem 0.66rem;
  resize: vertical;
}

.m3-peer-comment-wrap textarea:focus {
  outline: none;
  border-color: #d7a849;
  box-shadow: 0 0 0 3px rgba(215, 168, 73, 0.16);
}

.m3-peer-star-summary {
  margin-top: 0.62rem;
}

.m3-peer-star-list {
  display: grid;
  gap: 0.38rem;
}

.m3-peer-star-list span {
  border: 1px solid #d8e7dd;
  border-radius: 13px;
  background: #f7fcf9;
  color: #416d5b;
  padding: 0.46rem 0.55rem;
  font-weight: 800;
  font-size: 0.86rem;
}

.m3-peer-star-list em {
  display: block;
  margin-top: 0.18rem;
  color: #668477;
  font-style: normal;
  font-weight: 700;
  line-height: 1.45;
}

.example-item pre,
.book-item pre,
.poem-pre {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.62;
  font-family: inherit;
}

.module-input-modes {
  margin-bottom: 0.52rem;
  border: 1px dashed #c9ded1;
  border-radius: 12px;
  background: #f8fcfa;
  padding: 0.56rem;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
  margin: 0.34rem 0;
}

.mode-tab-btn {
  min-height: 36px;
  border: 1px solid #c5d9cd;
  border-radius: 999px;
  background: #fff;
  color: #3a6653;
  font-weight: 700;
  cursor: pointer;
}

.mode-tab-btn.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, #fff);
  color: var(--accent-dark);
}

.mode-extra {
  margin-top: 0.42rem;
}

.mode-extra input[type="file"] {
  border: 1px dashed #bfd6c8;
  border-radius: 10px;
  padding: 0.54rem;
  background: #fff;
}

.photo-preview {
  margin-top: 0.42rem;
  border: 1px solid #d0e0d5;
  border-radius: 10px;
  min-height: 92px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0.42rem;
}

.photo-preview img,
.art-preview img,
.book-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.art-preview {
  min-height: 210px;
  overflow: hidden;
}

.poem-card {
  border: 1px solid #c6ddcf;
  border-radius: 12px;
  background: #fbfffd;
  padding: 0.62rem;
}

.qr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 0.52rem;
  align-items: center;
}

.qr-grid img {
  width: 128px;
  height: 128px;
  border: 1px solid #cedfd4;
  border-radius: 10px;
  background: #fff;
}

.book-shell {
  border: 1px solid #d6e4dc;
  border-radius: 13px;
  background: linear-gradient(180deg, #fdfaf1 0%, #f9f4e8 100%);
  padding: 0.58rem;
}

.book-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.44rem;
  margin-bottom: 0.5rem;
}

.book-page {
  border: 1px solid #dccca9;
  border-radius: 12px;
  background: #fffdf5;
  min-height: 160px;
  padding: 0.62rem;
}

.book-cover-page {
  min-height: 260px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 250, 236, 0.95)),
    radial-gradient(circle at 20% 18%, rgba(92, 174, 119, 0.22), transparent 24%),
    radial-gradient(circle at 84% 82%, rgba(237, 158, 93, 0.2), transparent 24%),
    #fff8e8;
}

.book-cover-page h3 {
  margin: 0.25rem 0;
  color: #2d634c;
  font-size: clamp(1.36rem, 3vw, 2rem);
}

.book-cover-kicker {
  margin: 0;
  color: #6e806d;
  font-weight: 800;
}

.book-actions {
  display: flex;
  gap: 0.42rem;
}

.book-actions button {
  min-height: 34px;
  border: 1px solid #d1c3a0;
  border-radius: 999px;
  background: #fff6e4;
  color: #68573f;
  padding: 0 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.book-actions button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.book-photo {
  margin-top: 0.54rem;
  border: 1px solid #dfd0ad;
  border-radius: 10px;
  overflow: hidden;
}

.teacher-book-shell {
  position: relative;
  margin-top: 0.82rem;
  border: 0;
  border-radius: 12px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.62), transparent 34%),
    linear-gradient(135deg, #e8efe8 0%, #f7ead0 100%);
  padding: clamp(0.74rem, 2vw, 1.1rem);
  box-shadow: 0 18px 38px rgba(63, 82, 67, 0.18);
}

.teacher-book-shell::before {
  content: "";
  position: absolute;
  inset: 0.48rem;
  border: 1px solid rgba(141, 112, 53, 0.16);
  border-radius: 10px;
  pointer-events: none;
}

.teacher-book-shell > .tiny-hint {
  position: relative;
  z-index: 1;
}

.teacher-book-shell .book-toolbar {
  position: relative;
  z-index: 2;
  border: 1px solid rgba(196, 173, 117, 0.55);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.88);
  padding: 0.48rem;
}

.teacher-book-shell .book-actions {
  flex-wrap: wrap;
}

.teacher-book-shell .book-actions button {
  border-color: #caa85a;
  background: #fffaf0;
  color: #71591f;
  font-weight: 900;
}

.teacher-book-stage {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  margin: 0.78rem auto 0;
  filter: drop-shadow(0 18px 22px rgba(88, 68, 33, 0.2));
}

.teacher-book-cover-stage {
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.teacher-book-cover {
  position: relative;
  width: min(520px, 100%);
  min-height: 360px;
  border: 1px solid #2f6f55;
  border-radius: 10px 16px 16px 10px;
  background:
    linear-gradient(90deg, rgba(24, 76, 56, 0.42) 0 46px, transparent 46px),
    radial-gradient(circle at 78% 18%, rgba(255, 229, 147, 0.5), transparent 18%),
    linear-gradient(145deg, #2f8f68 0%, #4fb17d 52%, #f2c76f 100%);
  color: #fff;
  overflow: hidden;
  transform: rotateY(-5deg);
  transform-origin: left center;
  box-shadow:
    inset 8px 0 18px rgba(20, 58, 44, 0.38),
    inset -2px 0 0 rgba(255, 255, 255, 0.32);
}

.teacher-book-cover::before,
.teacher-book-cover::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.teacher-book-cover::before {
  inset: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.46);
  border-radius: 8px;
}

.teacher-book-cover::after {
  right: 1.1rem;
  bottom: 1.1rem;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.95) 0 10px, transparent 11px),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.35), transparent 58%);
}

.teacher-book-cover h3 {
  max-width: min(360px, 78%);
  margin: 0.46rem auto 0.6rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(35, 82, 60, 0.26);
}

.teacher-book-cover .tiny-hint,
.teacher-book-cover .book-cover-kicker,
.teacher-book-count,
.teacher-book-cover-line,
.teacher-book-cover-meta {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.9);
}

.teacher-book-cover-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.38rem;
  max-width: 360px;
  margin: 0.4rem auto 0.5rem;
}

.teacher-book-cover-chip {
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  padding: 0.16rem 0.52rem;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.teacher-book-cover-line {
  max-width: 380px;
  margin: 0.16rem auto;
  font-weight: 800;
  line-height: 1.45;
}

.teacher-book-cover.book-cover-image-page {
  width: min(420px, 92vw);
  min-height: auto;
  aspect-ratio: 1280 / 1814;
  padding: 0;
  background: #eaf5e7;
  border-color: rgba(47, 111, 85, 0.42);
  transform: rotateY(-3deg);
}

.teacher-book-cover.book-cover-image-page::before,
.teacher-book-cover.book-cover-image-page::after {
  display: none;
}

.book-cover-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teacher-book-spine-text {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 900;
  writing-mode: vertical-rl;
  letter-spacing: 0.12em;
}

.teacher-book-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 420px;
  perspective: 1400px;
}

.teacher-book-page {
  position: relative;
  min-height: 420px;
  border: 1px solid #d7c599;
  border-radius: 8px;
  background:
    repeating-linear-gradient(to bottom, rgba(221, 203, 155, 0.18) 0, rgba(221, 203, 155, 0.18) 1px, transparent 1px, transparent 34px),
    linear-gradient(180deg, #fffefa 0%, #fff8e8 100%);
  color: #2c473d;
  padding: clamp(0.86rem, 2vw, 1.18rem);
  box-shadow:
    inset 0 0 24px rgba(150, 123, 68, 0.08),
    0 8px 16px rgba(88, 68, 33, 0.08);
}

.teacher-book-left {
  border-right: 0;
  border-radius: 10px 2px 2px 10px;
  transform: rotateY(2deg);
  transform-origin: right center;
}

.teacher-book-right {
  border-left: 0;
  border-radius: 2px 10px 10px 2px;
  transform: rotateY(-2deg);
  transform-origin: left center;
}

.teacher-book-gutter {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 20px;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg, rgba(93, 70, 30, 0.2), rgba(255, 255, 255, 0.35), rgba(93, 70, 30, 0.22));
  box-shadow: 0 0 18px rgba(88, 68, 33, 0.24);
  pointer-events: none;
}

.teacher-book-kicker {
  margin: 0 0 0.28rem;
  color: #8a6a24;
  font-weight: 900;
}

.teacher-book-page h3 {
  margin: 0 0 0.36rem;
  color: #275847;
  font-size: clamp(1.2rem, 2.3vw, 1.62rem);
}

.teacher-book-page .poem-pre {
  margin-top: 0.72rem;
  color: #25463b;
  font-size: 1rem;
  line-height: 1.78;
}

.teacher-book-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0;
  border: 1px solid #dbc99c;
  border-radius: 8px;
  background: #fffaf0;
  overflow: hidden;
}

.teacher-book-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fffaf0;
}

.teacher-book-photo.empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: #8a6a24;
  font-weight: 900;
  text-align: center;
  padding: 1rem;
}

.teacher-book-photo.broken {
  border-style: dashed;
  background: #fff8e8;
  color: #9b6a16;
}

.teacher-book-note {
  margin-top: 0.74rem;
  border-top: 1px dashed #d9c99d;
  padding-top: 0.64rem;
}

.teacher-book-note p {
  margin: 0.2rem 0;
}

.teacher-book-note .stars {
  font-size: 1.2rem;
}

.teacher-book-page-no {
  position: absolute;
  bottom: 0.5rem;
  left: 0;
  right: 0;
  margin: 0;
  color: #9a8352;
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
}

.trend-row {
  display: grid;
  grid-template-columns: 62px 1fr 50px;
  gap: 0.52rem;
  align-items: center;
  margin-bottom: 0.42rem;
}

.trend-bar {
  border: 1px solid #c8dacc;
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf6f1;
}

.trend-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 58%, #fff));
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
}

.stat-cell {
  border: 1px solid #c9ddcf;
  border-radius: 10px;
  background: #fff;
  padding: 0.54rem;
}

.stat-cell span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-cell strong {
  font-size: 1.04rem;
}

.resource-grid {
  display: grid;
  gap: 0.48rem;
}

.m6-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 0.62rem;
}

.m6-video-card {
  border: 1px solid #c7ddd0;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f8fffb 100%);
  box-shadow: 0 12px 24px rgba(49, 106, 79, 0.1);
  display: flex;
  flex-direction: column;
  color: inherit;
  font: inherit;
  text-align: left;
}

.m6-video-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.m6-video-link:hover,
.m6-video-link:focus {
  transform: translateY(-3px);
  border-color: #7ec4a1;
  box-shadow: 0 18px 32px rgba(49, 106, 79, 0.16);
  outline: none;
}

.m6-video-image {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  background: #e9f7f0;
}

.m6-video-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(24, 63, 47, 0.08), rgba(24, 63, 47, 0.38));
}

.m6-video-image img {
  width: 100%;
  height: 168px;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
}

.m6-video-image .m6-cover-chip {
  position: absolute;
  left: 0.68rem;
  top: 0.62rem;
  z-index: 1;
  border-color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.88);
  color: #2f6a50;
  box-shadow: 0 6px 14px rgba(38, 77, 57, 0.14);
}

.m6-video-cover {
  min-height: 128px;
  padding: 0.58rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.34rem;
  color: #fff;
}

.m6-cover-readwrite {
  background: linear-gradient(135deg, #67c57f 0%, #43a56d 100%);
}

.m6-cover-shine {
  background: linear-gradient(135deg, #f0c45f 0%, #d89a3d 100%);
}

.m6-cover-peer {
  background: linear-gradient(135deg, #67afd8 0%, #4b90bd 100%);
}

.m6-cover-master {
  background: linear-gradient(135deg, #9b8bd8 0%, #7a66c5 100%);
}

.m6-cover-chip {
  display: inline-flex;
  width: max-content;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.08rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
}

.m6-cover-title {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 800;
  line-height: 1.35;
}

.m6-cover-hint {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.95;
}

.m6-video-body {
  padding: 0.72rem;
  display: grid;
  gap: 0.38rem;
}

.m6-video-title {
  margin: 0;
  color: #2a5f49;
  font-weight: 800;
  font-size: 0.94rem;
  line-height: 1.38;
}

.m6-video-meta {
  margin: 0;
  color: #5d7f70;
  font-size: 0.81rem;
}

.m6-video-desc {
  margin: 0;
  color: #416b5b;
  font-size: 0.86rem;
  line-height: 1.5;
  min-height: 2.7em;
}

.m6-video-body .m6-cover-hint {
  color: #6f897d;
  font-weight: 800;
}

.m6-video-actions {
  margin-top: 0.08rem;
}

.m6-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.16rem 0.72rem;
  border-radius: 999px;
  border: 1px solid #a7d1bc;
  background: #eff9f3;
  color: #2e6a50;
  font-weight: 900;
  font-size: 0.84rem;
  text-decoration: none;
}

.m6-action-disabled {
  border-color: #d5e4dc;
  background: #f8fbf9;
  color: #7d9b8f;
}

.resource-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.42rem;
  margin: 0.48rem 0 0.62rem;
}

.resource-tab {
  min-height: 36px;
  border: 1px solid #c7ddcf;
  border-radius: 999px;
  background: #fff;
  color: #396651;
  font-weight: 700;
  cursor: pointer;
  padding: 0 0.6rem;
}

.resource-tab.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, #fff);
  color: var(--accent-dark);
}

.resource-item {
  border: 1px solid #c6ddcf;
  border-radius: 10px;
  background: #fbfefc;
  padding: 0.58rem;
}

.resource-item a,
.teacher-entry-link {
  color: var(--accent-dark);
  font-weight: 800;
}

.xfd-mascot-widget {
  position: fixed;
  right: clamp(8px, 1.8vw, 20px);
  bottom: clamp(8px, 1.9vw, 18px);
  z-index: 34;
  width: clamp(86px, 8.2vw, 116px);
  display: grid;
  justify-items: end;
  gap: 0.32rem;
  pointer-events: none;
}

.xfd-mascot-bubble {
  max-width: min(206px, 56vw);
  padding: 0.4rem 0.56rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, #fff);
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-dark);
  font-size: 0.8rem;
  line-height: 1.3;
  box-shadow: 0 8px 15px rgba(36, 77, 59, 0.12);
}

.xfd-mascot-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
  border-radius: 24px;
  border: 0;
  box-shadow: none;
  animation: xfdFloat 4.8s ease-in-out infinite;
}

@keyframes xfdFloat {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

@media (max-width: 920px) {
  .module-nav-grid,
  .form-grid,
  .qr-grid {
    grid-template-columns: 1fr;
  }

  .module-5 .m5-form-grid {
    grid-template-columns: 1fr;
  }

  .m4t-compare-grid {
    grid-template-columns: 1fr;
  }

  .teacher-book-open {
    grid-template-columns: 1fr;
  }

  .teacher-book-left,
  .teacher-book-right {
    border: 1px solid #d7c599;
    border-radius: 8px;
    transform: none;
  }

  .teacher-book-right {
    margin-top: 0.72rem;
  }

  .teacher-book-gutter {
    display: none;
  }

  .m1-chat-layout {
    grid-template-columns: 1fr;
  }

  .m3-stars-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .m1-side {
    position: static;
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 0.5rem;
    align-items: center;
    text-align: left;
  }

  .m1-side-mascot {
    width: 82px;
    height: 82px;
  }
}

@media (max-width: 640px) {
  .module-shell {
    padding: 0.74rem 0.56rem 1.12rem;
  }

  .module-top h1 {
    font-size: 1.03rem;
  }

  .module-top {
    align-items: flex-start;
  }

  .module-main-topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.84rem 0.88rem;
  }

  .module-brand-wrap {
    align-items: center;
  }

  .module-top-actions {
    justify-content: flex-start;
  }

  .module-current-user {
    width: 100%;
  }

  .module-home-btn,
  .module-exit-btn {
    min-height: 34px;
    padding: 0 0.68rem;
  }

  .row,
  .mode-tabs,
  .module-nav-grid {
    grid-template-columns: 1fr;
  }

  .module-5 .mode-tabs,
  .module-5 .m5-form-grid {
    grid-template-columns: 1fr;
  }

  .module-5 .book-actions,
  .module-5 .book-actions button,
  .teacher-book-shell .book-actions,
  .teacher-book-shell .book-actions button {
    width: 100%;
  }

  .teacher-book-cover {
    min-height: 310px;
    transform: none;
  }

  .teacher-book-stage {
    filter: drop-shadow(0 10px 18px rgba(88, 68, 33, 0.16));
  }

  .m1-chat-list {
    min-height: 300px;
    max-height: 390px;
  }

  .m1-msg-bubble {
    max-width: 86%;
  }

  .m6-video-grid {
    grid-template-columns: 1fr;
  }

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

  .m3-star-work-card {
    min-height: 200px;
  }

  .module-action-btn {
    min-height: 46px;
  }

  .m4-create-panel {
    grid-template-columns: 1fr;
  }

  .m4-create-left {
    min-height: auto;
  }

  .m4-create-left img {
    width: 104px;
    height: 104px;
  }

  .xfd-bg-illustration,
  .xfd-mascot-bubble {
    display: none;
  }

  .xfd-mascot-widget {
    width: 72px;
    right: 8px;
    bottom: 8px;
  }
}

.xfd-mascot-widget {
  display: none !important;
}
