
.study-sanctum-watermark {
  position: absolute;
  right: 224px;
  bottom: -24px;
  font-family: 'Noto Serif SC', 'Noto Sans SC', serif;
  font-size: 132px;
  line-height: 1;
  font-weight: 700;
  color: rgba(8, 127, 109, 0.055);
  pointer-events: none;
  user-select: none;
}

.study-sanctum-dragon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.study-sanctum-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.study-sanctum-avatar.dragon-realm-avatar {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  padding: 4px;
  background: linear-gradient(145deg, var(--cream), var(--paper));
  border: 2px solid rgba(238, 189, 91, 0.72);
  box-shadow: 0 4px 12px rgba(7, 85, 72, 0.12);
}

.study-sanctum-avatar .dragon-realm-evo-img {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  object-fit: cover;
}

.study-sanctum-sparkles {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.study-sanctum-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.study-sanctum-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.study-sanctum-stage-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  color: var(--jade-deep);
  background: rgba(8, 127, 109, 0.11);
}

.study-sanctum-roadmap-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--jade);
  white-space: nowrap;
}

.study-sanctum-roadmap-link:hover {
  text-decoration: underline;
}

.study-sanctum-roadmap-link .icon {
  width: 14px;
  height: 14px;
}

.study-sanctum-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.24;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.study-sanctum-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.study-sanctum-bar-track.dragon-realm-progress-track {
  height: 7px;
  margin: 2px 0;
}

.study-sanctum-cheer {
  margin-top: 2px;
  align-self: flex-start;
  max-width: 100%;
  min-height: 36px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(8, 127, 109, 0.22);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.study-sanctum-cheer:hover {
  border-color: var(--jade);
  background: var(--soft);
}

.study-cheer-zh {
  font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.study-cheer-py {
  font-size: 12px;
  font-weight: 650;
  color: var(--jade);
}

.study-cheer-vi {
  font-size: 11.5px;
  color: var(--muted);
}

.study-sanctum-stats {
  position: relative;
  z-index: 1;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.study-sanctum-kpi-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.study-sanctum-kpi-grid > div {
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.study-sanctum-kpi-grid dt {
  font-size: 11px;
  color: var(--muted);
  font-weight: 550;
}

.study-sanctum-kpi-grid dd {
  margin: 0;
  font-size: 19px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.study-sanctum-kpi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}

.study-sanctum-kpi-foot .quiet-link {
  min-height: 30px;
  font-size: 11.5px;
}

.study-sanctum-spin {
  position: relative;
  z-index: 1;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid rgba(238, 189, 91, 0.62);
  background: linear-gradient(155deg, var(--cream), var(--paper));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.study-spin-pill {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
  background: rgba(238, 189, 91, 0.24);
  color: #7c5310;
}

.study-sanctum-spin > strong {
  font-size: 14.5px;
  line-height: 1.3;
  color: var(--ink);
  font-weight: 750;
}

.study-sanctum-spin > p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.study-spin-btn {
  width: 100%;
  min-height: 40px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 700;
}

/* 8-Chapter HSK 0 -> HSK 7-9 Sanctum Stepper Bar */
.study-sanctum-chapter-bar {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(8, 127, 109, 0.16);
}

.study-chapter-bar-lead {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.study-chapter-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.study-chapter-bar-label .icon {
  width: 14px;
  height: 14px;
  color: var(--jade);
}

.study-chapter-auto-pill {
  min-height: 36px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px dashed rgba(8, 127, 109, 0.45);
  background: var(--cream);
  color: var(--jade-deep);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.study-chapter-auto-pill:hover {
  background: var(--soft);
}

.study-chapter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.study-chapter-chips::-webkit-scrollbar {
  display: none;
}

.study-chapter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.study-chapter-chip:hover {
  border-color: var(--jade);
  background: var(--soft);
}

.study-chapter-chip.is-active {
  border-color: var(--jade);
  background: var(--jade);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(8, 127, 109, 0.22);
}

.study-chapter-chip.is-complete:not(.is-active) {
  border-color: rgba(8, 127, 109, 0.42);
  background: rgba(8, 127, 109, 0.09);
  color: var(--jade-deep);
}

.study-chapter-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(8, 127, 109, 0.12);
  color: var(--jade-deep);
  font-family: 'Noto Serif SC', 'Noto Sans SC', serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.study-chapter-chip.is-active .study-chapter-seal {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.study-chapter-prog {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.78;
}

.study-chapter-chip:focus-visible,
.study-chapter-auto-pill:focus-visible,
.quest-mode-btn:focus-visible {
  outline: 3px solid #ecb855;
  outline-offset: 2px;
}

/* 2-Column Workspace Grid below Hero */
.study-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 12px;
  align-items: start;
}

.study-workspace-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.study-action-duo {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr);
  gap: 12px;
  align-items: stretch;
}

.study-action-duo > .panel {
  margin: 0;
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
}

.study-action-duo .resume-panel h2 {
  font-size: 17.5px;
  margin: 5px 0 5px;
}

.study-action-duo .resume-panel > p,
.study-action-duo .due-review-panel > p {
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.study-action-duo .resume-track {
  margin-top: auto;
  margin-bottom: 12px;
}

.study-action-duo .due-review-actions {
  margin-top: auto;
}

.study-action-duo .btn {
  min-height: 42px;
  padding: 9px 15px;
}

/* Daily Quest Emblem & Compact Study Rhythm */
.daily-quest-title-group h2 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}

.daily-quest-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.daily-quest-step-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.daily-quest-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(8, 127, 109, 0.11);
  border: 1px solid rgba(8, 127, 109, 0.24);
  font-family: 'Noto Serif SC', 'Noto Sans SC', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--jade-deep);
  line-height: 1;
}

.study-sanctum-page .daily-quest-panel {
  margin-bottom: 0;
  padding: 14px 18px;
}

.study-sanctum-page .daily-quest-header {
  margin-bottom: 10px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
}

.study-sanctum-page .daily-quest-title-group {
  flex: 1;
  min-width: 0;
}

.daily-quest-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.quest-mode-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  gap: 2px;
}

.quest-mode-btn {
  min-height: 36px;
  padding: 4px 11px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.quest-mode-btn.is-active {
  background: var(--jade);
  color: #ffffff;
}

.station-boss-ready-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid rgba(238, 189, 91, 0.72);
  color: #7c5310;
  font-size: 11.5px;
  font-weight: 750;
}

.station-boss-ready-link[hidden] {
  display: none;
}

.station-boss-ready-link .icon {
  width: 14px;
  height: 14px;
}

.study-sanctum-page .daily-quest-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.study-sanctum-page .daily-quest-grid[hidden] {
  display: none;
}

.study-sanctum-page .daily-quest-card {
  padding: 12px 13px;
  gap: 5px;
}

.study-sanctum-page .daily-quest-card .roadmap-step-check--sm {
  min-height: 36px;
  padding: 4px 9px;
  font-size: 11px;
}

.study-sanctum-page .daily-quest-card h3 {
  font-size: 13.5px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.study-sanctum-page .daily-quest-card p {
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.study-sanctum-page .daily-quest-card .quiet-link {
  margin-top: auto;
  padding-top: 3px;
  font-size: 12px;
}

/* Compact Right Personal Rail */
.study-compact-rail {
  gap: 12px;
}

.study-compact-rail > .panel {
  padding: 14px 17px;
}

.study-compact-rail .streak-value {
  margin: 10px 0 8px;
}

.study-compact-rail .streak-value strong {
  font-size: 36px;
}

.study-compact-rail .flame-badge {
  width: 44px;
  height: 48px;
  border-radius: 14px;
}

.study-compact-rail .streak-card > p {
  margin-bottom: 10px;
  line-height: 1.5;
}

.study-compact-rail .week-strip {
  margin: 8px 0 10px;
}

.study-compact-rail .goal-number {
  margin: 10px 0 7px;
}

.study-compact-rail .goal-number strong {
  font-size: 26px;
}

.study-compact-rail .progress-track {
  margin-bottom: 9px;
}

.study-compact-rail .goal-card > p:not(.goal-number) {
  margin-bottom: 10px;
  line-height: 1.45;
}

/* Dark Mode for Study Sanctum */
html[data-theme="dark"] .study-sanctum-hero.dragon-realm-card {
  border-color: rgba(130, 207, 168, 0.26);
  background: linear-gradient(132deg, rgba(23, 125, 95, 0.18) 0%, var(--paper) 55%, rgba(238, 189, 91, 0.08) 100%);
}

html[data-theme="dark"] .study-sanctum-watermark {
  color: rgba(130, 207, 168, 0.06);
}

html[data-theme="dark"] .study-sanctum-avatar.dragon-realm-avatar {
  background: linear-gradient(145deg, #243e31, #192e26);
  border-color: rgba(238, 189, 91, 0.55);
}

html[data-theme="dark"] .study-sanctum-stage-pill {
  color: #9bd3b1;
  background: rgba(130, 207, 168, 0.14);
}

html[data-theme="dark"] .study-sanctum-cheer {
  background: rgba(19, 37, 31, 0.72);
  border-color: rgba(130, 207, 168, 0.25);
}

html[data-theme="dark"] .study-sanctum-spin {
  background: linear-gradient(155deg, rgba(55, 51, 35, 0.85), var(--paper));
  border-color: rgba(238, 189, 91, 0.36);
}

html[data-theme="dark"] .study-spin-pill {
  background: rgba(238, 189, 91, 0.18);
  color: #f3d285;
}

html[data-theme="dark"] .daily-quest-emblem {
  color: #9bd3b1;
  background: rgba(130, 207, 168, 0.14);
  border-color: rgba(130, 207, 168, 0.28);
}

html[data-theme="dark"] .study-sanctum-chapter-bar {
  border-top-color: rgba(130, 207, 168, 0.2);
}

html[data-theme="dark"] .study-chapter-chip {
  background: rgba(19, 37, 31, 0.75);
  border-color: rgba(130, 207, 168, 0.22);
  color: var(--text);
}

html[data-theme="dark"] .study-chapter-chip.is-active {
  background: var(--jade);
  border-color: var(--jade);
  color: #ffffff;
}

html[data-theme="dark"] .study-chapter-seal {
  background: rgba(130, 207, 168, 0.16);
  color: #9bd3b1;
}

html[data-theme="dark"] .study-chapter-auto-pill {
  background: rgba(23, 125, 95, 0.18);
  border-color: rgba(130, 207, 168, 0.36);
  color: #9bd3b1;
}

html[data-theme="dark"] .station-boss-ready-link {
  background: rgba(55, 51, 35, 0.88);
  border-color: rgba(238, 189, 91, 0.45);
  color: #f3d285;
}

@media (prefers-reduced-motion: reduce) {
  .study-sanctum-cheer,
  .study-chapter-chip {
    transition: none;
  }
}

@media (max-width: 1220px) {
  .study-sanctum-hero.dragon-realm-card {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
  .study-sanctum-dragon {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1080px) {
  .study-workspace-grid {
    grid-template-columns: 1fr;
  }
  .study-compact-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .study-sanctum-hero.dragon-realm-card,
  .study-action-duo,
  .study-sanctum-page .daily-quest-grid,
  .study-compact-rail {
    grid-template-columns: minmax(0, 1fr);
  }
  .study-sanctum-stats,
  .study-sanctum-spin {
    min-width: 0;
  }
  .study-sanctum-page .daily-quest-header {
    flex-wrap: wrap;
  }
  .daily-quest-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .study-sanctum-dragon {
    align-items: flex-start;
  }
  .study-sanctum-avatar.dragon-realm-avatar {
    width: 68px;
    height: 68px;
    border-radius: 18px;
  }
  .study-sanctum-roadmap-link {
    margin-left: 0;
  }
  .study-sanctum-chapter-bar {
    flex-wrap: wrap;
  }
  .study-chapter-chips {
    order: 3;
    flex-basis: 100%;
  }
  .study-sanctum-cheer {
    border-radius: 14px;
    padding: 7px 12px;
  }
}
