/* 月芽灵兽尾羽定制色：清透月光冰青蓝 (Moonlit Ice Cyan) */
:root {
  --cyan-primary: #1b687f;        /* 琉璃深青蓝：按钮、Logo底色，深邃澄澈 */
  --cyan-primary-dark: #134f61;   /* 悬浮更深的墨青蓝 */
  --cyan-tint: #edf7fa;           /* 尾羽高光月青微蓝底色，极其通透柔和 */
  --cyan-border: #cfe5ec;         /* 水光浅蓝青细腻边框 */
  --cyan-accent: #2e8da7;         /* 灵兽水晶青蓝：小标、点缀 */
  --cyan-ink: #163a45;            /* 深海青黛正文墨色 */
  --cyan-sub: #557885;            /* 柔和灰青副文本 */
  --purple: var(--cyan-primary) !important;
  --purple-dark: var(--cyan-primary-dark) !important;
  --lavender: var(--cyan-tint) !important;
  --soft: #f2f9fb !important;
}

/* Sidebar surfaces and interaction states live in sidebar.css. */
.avatar {
  border: 1px solid #cce4eb !important;
  background: #e6f3f7 !important;
  color: #1b687f !important;
}

/* 主展台 Hero 卡片：如灵兽尾羽般清透、微发光的月光冰青质感 */
.desk-hero.desk-hero-enhanced {
  background: linear-gradient(145deg, #f0f9fb 0%, #e6f4f8 100%) !important;
  border: 1px solid var(--cyan-border) !important;
  box-shadow: 0 4px 20px rgba(46, 141, 167, 0.06) !important;
}
.desk-hero.desk-hero-enhanced::before {
  background: linear-gradient(180deg, #42a5c2, #1b687f) !important;
}
.desk-hero-enhanced .desk-kicker {
  color: var(--cyan-accent) !important;
}
.desk-hero-enhanced h2 {
  color: var(--cyan-ink) !important;
}
.desk-hero-enhanced .desk-hero-note {
  color: var(--cyan-sub) !important;
}
.lesson-tag {
  background: rgba(46, 141, 167, 0.12) !important;
  color: var(--cyan-primary) !important;
}
.lesson-name {
  color: var(--cyan-ink) !important;
}
.desk-primary, .primary-link {
  background: linear-gradient(135deg, #257e99, #1b687f) !important;
  border: 1px solid #185f75 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(27, 104, 127, 0.22) !important;
}
.desk-primary:hover, .primary-link:hover {
  background: #134f61 !important;
  border-color: #134f61 !important;
}

/* 伴学人物与宠物展示区：微透水光青 */
.figure-placeholder {
  border: 1px dashed #b2dae6 !important;
  background: #eef7fa !important;
  color: #23748c !important;
}

/* One shared column rhythm: welcome/calendar, study/review, bookshelf/companion. */
.main { --desk-columns: minmax(0, 1.85fr) minmax(284px, 1fr); --desk-gap: 22px; }
.welcome.welcome-editorial { display: grid; grid-template-columns: var(--desk-columns); align-items: center; gap: var(--desk-gap); }
.desk-welcome-copy { min-width: 0; position: relative; }
.desk-daily-motto { display: block; margin-top: 10px; color: #786e60; font: italic 11px/1.5 var(--book-serif); letter-spacing: 1px; }

.desk-checkin-box {
  background: #fdfbf7;
  border: 1px solid #e5dfd2;
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 0;
  width: 100%;
  justify-self: end;
  display: grid;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(50,40,30,0.03);
}

.checkin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  gap: 10px;
  flex-wrap: nowrap;
}

.checkin-head-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.checkin-title {
  font-size: 12px;
  font-weight: 600;
  color: #4a3b53;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.checkin-days {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1ede4;
  font-size: 10px;
  line-height: 1.7;
  color: #7d7265;
  white-space: nowrap;
}

.checkin-days b {
  color: #315f68;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.checkin-coins {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid #e3e4dc;
  border-radius: 999px;
  background: #fffefa;
  color: #315f68;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.checkin-coins .icon {
  width: 13px;
  height: 13px;
}

.checkin-coins b {
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.checkin-coins:hover {
  background: #edf5f3;
  border-color: #b9cbc8;
}

.checkin-coins[data-wallet-state="loading"] b {
  color: #7d7265;
  font-size: 11px;
  font-weight: 500;
}

.checkin-coins[data-wallet-state="invalid"] b,
.checkin-coins[data-wallet-state="unavailable"] b {
  color: #9b3b30;
  font-size: 12px;
}

.checkin-dots {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.checkin-task {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.checkin-task-label {
  font-size: 10px;
  letter-spacing: .08em;
  color: #8c8273;
}

.checkin-task-value {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: #4a3b53;
}

.checkin-task-done .checkin-task-value {
  color: #446c53;
}

.checkin-bar {
  height: 6px;
  border-radius: 999px;
  background: #ece8df;
  overflow: hidden;
}

.checkin-bar > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #86b3b6, #315f68);
  transition: width .4s ease;
}

.checkin-task-done .checkin-bar > span {
  background: #446c53;
}

.checkin-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  color: #7d7265;
}

.checkin-foot .icon {
  width: 11px;
  height: 11px;
  vertical-align: -1px;
}

.checkin-foot b {
  color: #315f68;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.checkin-error {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  color: #a04438;
}

.c-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ece8df;
  color: #8c8273;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
}

.c-dot.active {
  background: #4a7c59;
  color: #ffffff;
}

.c-dot.today {
  border: 2px solid #695098;
  background: #ffffff;
  color: #695098;
  font-weight: 600;
}

/* The two cards are siblings, separated by the page gutter. */
.desk-focus-row { display: grid; grid-template-columns: var(--desk-columns); gap: var(--desk-gap); align-items: stretch; margin-bottom: 28px; }
.desk-hero.desk-hero-enhanced { display: block; min-width: 0; min-height: 284px; margin: 0; }
.desk-hero-enhanced .desk-hero-copy { height: 100%; display: flex; flex-direction: column; align-items: flex-start; padding: 28px 30px; }
.desk-hero-enhanced .desk-hero-actions { margin-top: auto; padding-top: 24px; }

.desk-lesson-status {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.lesson-tag {
  background: rgba(105, 80, 152, 0.12);
  color: #5c417a;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
}

.lesson-name {
  color: #554460;
  font-weight: 500;
}

/* A quiet paper review card: one surface, one clear destination. */
.desk-mistake-stage {
  min-width: 0;
  padding: 26px;
  background: #f6f1e7;
  border: 1px solid #e1d7c5;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.mistake-heading { display: flex; align-items: center; gap: 12px; }
.mistake-emblem { display: grid; place-items: center; width: 42px; height: 46px; flex: none; border: 1px solid #d8c9b0; border-radius: 5px; background: #eee3cf; color: #796040; }
.mistake-emblem .icon { width: 23px; height: 23px; }
.mistake-heading .eyebrow { color: #786748; font-size: 9px; letter-spacing: 1.5px; margin-bottom: 4px; }
.mistake-heading h2 { font: 600 22px/1.4 var(--book-serif); color: #514737; }
.mistake-tip { font-size: 13px; color: #716451; line-height: 1.9; margin: 18px 0 8px; max-width: 28ch; }
.mistake-status { font-size: 11px; line-height: 1.6; color: #786d5c; }
.mistake-btn-row { margin-top: auto; padding-top: 24px; width: 100%; }

.mistake-enter-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #fffdf8;
  border: 1px solid #d8ccb7;
  color: #6e583a;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  min-height: 42px;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mistake-enter-btn:hover {
  background: #ebe0cc;
  color: #51412e;
  border-color: #baa37c;
}

/* 双列并排：左侧我的书架 + 右侧小小人物与宠物中心 */
.desk-twin-row {
  display: grid;
  grid-template-columns: var(--desk-columns);
  gap: var(--desk-gap);
  margin-bottom: 30px;
}

.desk-twin-row .bookshelf-section {
  border-bottom: 0;
  padding: 0;
  margin-bottom: 0;
}

.pet-section {
  margin-bottom: 0;
}

.pet-desk-card {
  background: #f9f7f2;
  border: 1px solid #e7e0d3;
  border-radius: 6px;
  padding: 16px 20px;
  height: calc(100% - 45px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pet-avatar-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 6px 0 12px;
}

.pet-section .home-companions { justify-content: center; padding: 20px 18px; background: var(--ui-surface, #fffefa); }
.home-companion-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 16px; width: 100%; max-width: 420px; margin: auto; }
.home-companion-slot { min-width: 0; margin: 0; text-align: center; }
.home-companion-art { position: relative; display: grid; place-items: center; isolation: isolate; height: clamp(128px, 13vw, 160px); }
.home-companion-art::before { content: ''; position: absolute; z-index: -1; width: min(100%, 160px); aspect-ratio: 1; max-height: 100%; border-radius: 50%; background: var(--ui-soft, #edf5f3); opacity: .65; }
.home-companion-art::after { content: ''; position: absolute; z-index: -1; bottom: 0; left: 22%; right: 22%; height: 10px; border-radius: 50%; background: radial-gradient(ellipse, rgb(49 95 104 / 13%), transparent 72%); }
.home-companion-placeholder { display: grid; place-items: center; width: 72px; height: 90px; max-width: 80%; border: 1px dashed var(--ui-border-strong, #91b4b7); border-radius: 36px 36px 14px 14px; color: var(--ui-marker, #638b92); background: var(--ui-surface, #fffefa); }
.home-companion-placeholder .icon { width: 34px; height: 34px; }
.home-companion-pet .home-companion-placeholder { width: 72px; height: 72px; border-radius: 50%; }
.home-companion-art > .girl-dress-figure { position: absolute; top: 11%; left: 14%; display: block; width: 72%; height: 78%; max-width: 100%; max-height: 100%; margin: 0; padding: 0; aspect-ratio: auto; }
.home-companion-art > .home-companion-boy { position: absolute; top: 11%; left: 14%; display: block; width: 72%; height: 78%; max-width: 100%; max-height: 100%; margin: 0; padding: 0; object-fit: contain; }
.home-companion-art > .home-companion-pet-image { position: absolute; bottom: 0; left: 7.5%; display: block; width: 85%; height: 82%; min-width: 0; min-height: 0; max-height: 100%; object-fit: contain; }
.home-companion-slot figcaption { display: grid; gap: 3px; margin-top: 12px; }
.home-companion-slot figcaption strong { color: var(--ui-ink, #303c3d); font-size: 13px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.home-companion-slot figcaption span { color: var(--ui-muted, #5b6965); font-size: 11px; line-height: 1.5; }

.avatar-holder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.fig-icon {
  font-size: 38px;
  line-height: 1.1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.fig-badge {
  font-size: 9px;
  background: #695098;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
}

.fig-badge.pet-tag {
  background: #c27c38;
}

.avatar-holder small {
  font-size: 11px;
  color: #6b6255;
  font-weight: 500;
}

.bond-sparkle {
  font-size: 16px;
  animation: pulse 2s infinite ease-in-out;
}

.pet-status-info {
  background: #ffffff;
  border: 1px solid #ebe4d8;
  border-radius: 6px;
  padding: 10px 12px;
}

.pet-words {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 6px;
}

.pet-words b {
  color: #4f463b;
}

.pet-words span {
  color: #8c8273;
}

.pet-progress-bar {
  height: 6px;
  background: #eee8de;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #695098, #9774c4);
  border-radius: 999px;
}

/* 找学习内容 / 我的学习 / 收藏课程：标题区只留中文标题和一句说明，避免左上角三行叠在一起。 */
body[data-view="discover"] .page-heading-plain,
body[data-view="mine"] .page-heading-plain,
body[data-view="favorites"] .page-heading-plain,
body[data-view="library"] .page-heading-plain {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 28px;
  margin: 6px 0 28px;
}
body[data-view="discover"] .page-heading-plain > div,
body[data-view="mine"] .page-heading-plain > div,
body[data-view="favorites"] .page-heading-plain > div,
body[data-view="library"] .page-heading-plain > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}
body[data-view="discover"] .page-heading-plain h1,
body[data-view="mine"] .page-heading-plain h1,
body[data-view="favorites"] .page-heading-plain h1,
body[data-view="library"] .page-heading-plain h1 {
  font-size: clamp(26px, 2.2vw, 32px);
  line-height: 1.35;
  letter-spacing: 0;
}
body[data-view="discover"] .page-heading-plain p,
body[data-view="mine"] .page-heading-plain p,
body[data-view="favorites"] .page-heading-plain p,
body[data-view="library"] .page-heading-plain p {
  max-width: 36em;
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}
body[data-view="discover"] .home-section:first-of-type > .section-title {
  justify-content: flex-start;
  min-height: 0;
  margin-bottom: 12px;
}
body[data-view="mine"] .page-heading-plain .count-pill,
body[data-view="favorites"] .page-heading-plain .count-pill,
body[data-view="library"] .page-heading-plain .count-pill {
  flex: none;
  margin-bottom: 4px;
}
@media (max-width: 640px) {
  body[data-view="discover"] .page-heading-plain,
  body[data-view="mine"] .page-heading-plain,
  body[data-view="favorites"] .page-heading-plain,
  body[data-view="library"] .page-heading-plain {
    align-items: flex-start;
    gap: 10px;
    margin: 2px 0 22px;
  }
  body[data-view="discover"] .page-heading-plain h1,
  body[data-view="mine"] .page-heading-plain h1,
  body[data-view="favorites"] .page-heading-plain h1,
  body[data-view="library"] .page-heading-plain h1 {
    font-size: 24px;
  }
  body[data-view="discover"] .page-heading-plain p,
  body[data-view="mine"] .page-heading-plain p,
  body[data-view="favorites"] .page-heading-plain p,
  body[data-view="library"] .page-heading-plain p {
    font-size: 13px;
  }
}

/* Reserved image frames: no fictional profile, pet, or learning statistics. */
.desk-twin-row > div { min-width: 0; }
.desk-twin-row .bookshelf-section { display: flex; flex-direction: column; height: 100%; }
.desk-twin-row .home-section > .section-title { min-height: 48px; margin-bottom: 14px; align-items: center; }
.desk-twin-row .shelf-empty { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-content: center; gap: 12px 16px; flex: 1; min-height: 208px; }
.desk-twin-row .shelf-empty .button-secondary { grid-column: 2; justify-self: start; }
.desk-twin-row .bookshelf { grid-template-columns: minmax(0, 1fr); flex: 1; }
.pet-section { display: flex; flex-direction: column; height: 100%; }
.pet-desk-card { height: auto; flex: 1; min-height: 208px; }
.figure-placeholder { width: 74px; height: 88px; display: grid; place-items: center; border: 1px dashed #bbadca; border-radius: 18px 18px 8px 8px; background: #ece5f2; color: #70518d; }
.figure-placeholder .icon { width: 34px; height: 34px; }
.pet-placeholder { background: #f0e9dc; border-color: #c2ae8e; color: #846940; }
[data-companion-image] img { width: 100%; height: 100%; object-fit: contain; display: block; }
.companion-note { font-size: 11px; line-height: 1.7; color: #716754; margin: 0; }
.desk-lesson-status { flex-wrap: wrap; }
.lesson-name { overflow-wrap: anywhere; }
.tools-section .template-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 800px) {
  .main { --desk-columns: minmax(0, 1fr); --desk-gap: 20px; }
  .welcome.welcome-editorial { align-items: start; }
  .desk-checkin-box { max-width: 100%; }
  .desk-hero.desk-hero-enhanced { min-height: 0; }
  .desk-mistake-stage { padding: 22px 24px; }
  .mistake-tip { max-width: none; margin-top: 12px; }
  .mistake-btn-row { padding-top: 18px; }
}
@media (max-width: 640px) {
  .welcome.welcome-editorial { display: grid; gap: 18px; }
  .desk-daily-motto { display: none; }
  .desk-checkin-box { min-width: 0; width: 100%; }
  .desk-hero-enhanced .desk-hero-copy { padding: 23px 22px; }
  .desk-hero-enhanced .desk-hero-actions { padding-top: 22px; gap: 12px 18px; }
  .desk-mistake-stage { padding: 22px; }
  .mistake-heading h2 { font-size: 20px; }
  .desk-twin-row { gap: 24px; }
  .desk-twin-row .shelf-empty { grid-template-columns: 35px minmax(0, 1fr); min-height: 192px; }
  .tools-section .template-tools { grid-template-columns: 1fr; }
  .tools-section .template-tools .tool-tile { border-right: 0; border-bottom: 1px solid #ded8cb; }
  .tools-section .template-tools .tool-tile:last-child { border-bottom: 0; }
}
