/* Locofy 750px 画布缩放容器 */
.locofy-page.app-shell {
  background: #fcf6eb;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.locofy-page .locofy-viewport {
  width: 100%;
  max-width: var(--phone-w);
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}

.locofy-stage {
  width: 750px;
  transform-origin: top left;
  transform: scale(var(--locofy-scale, 1));
  will-change: transform;
}

.courses-page .locofy-course-intro {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  word-break: break-word;
  max-height: 56px;
}

/* 课程一览：顶栏 + 列表滚动 + 底栏固定于 shell 内 */
.courses-page.app-shell {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fcf6eb;
  height: min(100dvh, var(--portal-max-h));
}

@media (min-width: 600px) {
  .courses-page.app-shell {
    height: min(109dvh, var(--portal-max-h));
  }
}

.courses-page .locofy-top-bar {
  flex-shrink: 0;
}

.courses-page .locofy-courses-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: #fcf6eb;
}

.courses-page .locofy-courses-list {
  padding: 10px 0 16px;
  max-width: var(--phone-w);
  margin: 0 auto;
  box-sizing: border-box;
}

.courses-page .locofy-course-card {
  position: relative;
  display: block;
  width: calc(100% - 40px);
  max-width: 710px;
  height: 108px;
  margin: 0 auto 19px;
  background: #fff;
  border-radius: 30px;
  box-shadow: 0 2px 8px rgba(120, 80, 20, 0.06);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.courses-page .locofy-course-card__cover {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 152px;
  height: 87px;
  border-radius: 12px;
  background: #d8d8d8 center/cover no-repeat;
  overflow: hidden;
}

.courses-page .locofy-course-card__brand {
  position: absolute;
  left: 26%;
  top: 19%;
  width: 88%;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #d55500;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.courses-page .locofy-course-card__ribbon {
  position: absolute;
  left: 70%;
  top: 48%;
  transform: translate(-50%, -50%);
  max-width: 82%;
  min-width: 40px;
  padding: 1px 10px 2px;
  box-sizing: border-box;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(120, 20, 0, 0.12);
}

.courses-page .locofy-course-card__ribbon.tag-ribbon-mask {
  display: block;
}

.courses-page .locofy-course-card__cover-brief {
  position: absolute;
  left: 26%;
  bottom: 28%;
  width: 88%;
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  color: #dc451b;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.courses-page .locofy-course-card__body {
  position: absolute;
  left: 169px;
  top: 0;
  right: 0;
  bottom: 0;
  padding: 12px 14px 12px 4px;
  box-sizing: border-box;
}

.courses-page .locofy-course-card__name {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  color: #2f2f2f;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.courses-page .locofy-course-card__intro {
  margin: 1px 0 0;
  font-size: 13px;
  font-weight: 350;
  color: #888888;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  word-break: break-word;
}

.courses-page .locofy-course-card__footer {
  position: absolute;
  left: 4px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.courses-page .locofy-course-card__duration {
  font-size: 13px;
  font-weight: 350;
  color: #888888;
  white-space: nowrap;
  margin-top: -10px;
}

.courses-page .locofy-course-card__duration .fa {
  margin-right: 4px;
}

.courses-page .locofy-course-card__start {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 31px;
  background: #feaf05;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.courses-page .locofy-courses-empty {
  padding: 48px 16px;
  text-align: center;
  color: #8a7355;
  font-size: 14px;
}

.courses-page .tab-bar {
  flex-shrink: 0;
}

.locofy-page .tab-bar {
  position: relative;
  z-index: 100;
}

.locofy-top-bar {
  position: relative;
  z-index: 20;
  background: #fcf6eb;
}

html,
body.detail-page-active {
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
}

@media (min-width: 600px) {
  html,
  body.detail-page-active {
    min-height: 109dvh;
  }
}

body.detail-page-active {
  align-items: center;
}

body.detail-page-loading {
  background: #fcf6eb;
}

body.detail-page-loading .detail-page {
  visibility: hidden;
}

.detail-page.app-shell {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  position: relative;
  height: min(100dvh, var(--portal-max-h));
  max-height: var(--portal-max-h);
}

@media (min-width: 600px) {
  .detail-page.app-shell {
    height: min(109dvh, var(--portal-max-h));
  }
}

.detail-page .locofy-top-bar {
  flex-shrink: 0;
}

.detail-page .locofy-viewport {
  flex: 1;
  min-height: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  background: linear-gradient(180deg, #fcf6eb 0%, #fdf6e6 55%, #feefc9 100%);
}

.locofy-detail-scroll-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.locofy-detail-scroll-inner .locofy-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
}

@media (max-width: 599px) {
  .locofy-detail-ai-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 14px;
  }

  .locofy-detail-ai-messages {
    flex: 1;
    min-height: 0;
  }
}

.detail-page .locofy-stage {
  position: relative;
  transform-origin: top left;
}

.locofy-detail-video-zone {
  position: absolute;
  left: 10px;
  top: 37px;
  width: 730px;
  height: 400px;
  border-radius: 36px;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
  background: #d8d8d8;
}

.locofy-detail-video-zone.locofy-video-started:not(.locofy-video-paused) {
  z-index: 100;
}

.locofy-detail-video-zone video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: auto;
  background: #000;
}

.locofy-detail-video-zone img.locofy-cover-moved {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.locofy-video-hero {
  z-index: 8;
  transition: opacity 0.2s;
}

/* 详情封面：课程大标题下方丝带装饰（与首页 tag-ribbon 同色） */
img.locofy-detail-hero-ribbon-legacy {
  display: none !important;
}

.locofy-detail-hero-ribbon-deco,
#locofyDetailHeroRibbon {
  position: absolute;
  left: 462px;
  top: 492px;
  width: 152px;
  height: 31px;
  box-sizing: border-box;
  border: none;
  z-index: 8;
  pointer-events: none;
  background-color: #ff8f0f;
  background-image: none;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

#locofyDetailHeroBrief {
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: normal;
  overflow-wrap: normal;
}

.locofy-detail-center-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 125px;
  height: 125px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 8px rgba(246, 194, 104, 0.45);
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  border: none;
  padding: 0;
}

.locofy-detail-video-zone.locofy-video-started:not(.locofy-video-paused) .locofy-detail-center-play {
  display: none;
}

.locofy-detail-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: none;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 18px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  pointer-events: auto;
  box-sizing: border-box;
}

.locofy-detail-video-zone.locofy-video-started .locofy-detail-controls {
  display: flex;
}

.locofy-detail-play-inline {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.locofy-detail-time {
  flex-shrink: 0;
  color: #fff;
  font-size: 18px;
  font-family: "Source Han Sans CN", "PingFang SC", sans-serif;
  font-weight: 600;
  min-width: 56px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.locofy-detail-track {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 5px;
  position: relative;
  cursor: pointer;
  touch-action: none;
}

.locofy-detail-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  bottom: -18px;
}

.locofy-detail-fill {
  height: 100%;
  width: 0;
  background: #fcebca;
  border-radius: 5px;
  position: relative;
  pointer-events: none;
}

.locofy-detail-fill::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background: #feb029;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.locofy-detail-fullscreen {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.locofy-detail-fullscreen:active {
  opacity: 0.75;
}

.locofy-detail-video-zone:fullscreen,
.locofy-detail-video-zone:-webkit-full-screen {
  position: fixed !important;
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0;
  z-index: 99999;
  background: #000;
}

.locofy-detail-video-zone:fullscreen video,
.locofy-detail-video-zone:-webkit-full-screen video {
  object-fit: contain;
}

.locofy-detail-video-zone:fullscreen .locofy-detail-controls,
.locofy-detail-video-zone:-webkit-full-screen .locofy-detail-controls {
  padding: 18px 20px 24px;
}

.locofy-detail-video-zone:fullscreen .locofy-detail-time,
.locofy-detail-video-zone:-webkit-full-screen .locofy-detail-time {
  font-size: 20px;
  min-width: 64px;
}

.locofy-detail-video-zone:fullscreen .locofy-detail-track,
.locofy-detail-video-zone:-webkit-full-screen .locofy-detail-track {
  height: 12px;
}

.locofy-play-icon {
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 18px 0 18px 32px;
  border-color: transparent transparent transparent #f56320;
  margin-left: 8px;
}

.locofy-play-icon-sm {
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #feb029;
  margin-left: 4px;
}

.locofy-pause-icon {
  display: block;
  width: 16px;
  height: 18px;
  position: relative;
}

.locofy-pause-icon::before,
.locofy-pause-icon::after {
  content: '';
  position: absolute;
  top: 0;
  width: 5px;
  height: 18px;
  background: #feb029;
  border-radius: 1px;
}

.locofy-pause-icon::before {
  left: 2px;
}

.locofy-pause-icon::after {
  right: 2px;
}

.locofy-pause-icon-sm {
  display: block;
  width: 20px;
  height: 22px;
  position: relative;
}

.locofy-pause-icon-sm::before,
.locofy-pause-icon-sm::after {
  content: '';
  position: absolute;
  top: 0;
  width: 6px;
  height: 22px;
  background: #feb029;
  border-radius: 1px;
}

.locofy-pause-icon-sm::before {
  left: 2px;
}

.locofy-pause-icon-sm::after {
  right: 2px;
}

.locofy-hidden {
  display: none !important;
}

.locofy-chat-hidden {
  display: none !important;
}

.locofy-detail-ai-box {
  position: absolute;
  z-index: 25;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 0;
  pointer-events: auto;
  overflow: hidden;
}

.locofy-detail-ai-head {
  position: relative;
  flex-shrink: 0;
  height: 200px;
  z-index: 1;
  pointer-events: none;
}

.locofy-detail-ai-robot {
  width: 106px;
  height: 120px;
  object-fit: contain;
  z-index: 2;
}

.locofy-detail-ai-title-text {
  color: #854d1b;
  font-size: 32px;
  font-family: "Source Han Sans CN", "PingFang SC", sans-serif;
  font-weight: 700;
  line-height: 1.2;
  z-index: 2;
}

.locofy-detail-ai-bubble {
  z-index: 1;
  pointer-events: none;
}

.locofy-detail-ai-bubble svg {
  display: block;
  width: 514px;
  height: 110px;
}

.locofy-detail-ai-body {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 18px 14px;
  box-sizing: border-box;
}

.locofy-detail-ai-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.locofy-detail-ai-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.locofy-detail-ai-title {
  font-size: 34px;
  font-weight: 700;
  color: #895009;
  font-family: "Source Han Sans CN", "PingFang SC", sans-serif;
}

.locofy-detail-ai-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}

.locofy-detail-ai-opening {
  position: absolute;
  left: 182px;
  top: 85px;
  width: 449px;
  text-align: justify;
  color: #854d1b;
  font-size: 28px;
  line-height: 42px;
  font-weight: 350;
  font-family: "Source Han Sans CN", "PingFang SC", sans-serif;
  z-index: 3;
  pointer-events: none;
}

.locofy-detail-ai-opening[hidden] {
  display: none !important;
}

.locofy-detail-ai-messages .msg-row {
  display: flex;
  margin-bottom: 14px;
}

.locofy-detail-ai-messages .msg-row.user {
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 8px;
}

.locofy-detail-ai-messages .msg-row.user .msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(145deg, #ffd08a, #feaf05);
}

.locofy-detail-ai-messages .msg-row.user .msg-avatar--photo {
  background: transparent;
}

.locofy-detail-ai-messages .msg-avatar-img--user {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.locofy-detail-ai-messages .msg-row.ai {
  justify-content: flex-start;
}

.locofy-detail-ai-messages .msg-bubble {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 26px;
  line-height: 1.5;
  word-break: break-word;
  font-family: "Source Han Sans CN", "PingFang SC", sans-serif;
}

.locofy-detail-ai-messages .msg-row.ai .msg-bubble {
  background: #fff8ee;
  border: 1px solid #f3e4cc;
  color: #854d1b;
  border-top-left-radius: 6px;
}

.locofy-detail-ai-messages .msg-row.user .msg-bubble {
  background: linear-gradient(135deg, #ffeccc, #ffd08a);
  color: #854d1b;
  border-top-right-radius: 6px;
}

.locofy-detail-ai-messages .msg-bubble img,
.locofy-detail-ai-messages .msg-bubble .ai-chat-image {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  margin-top: 6px;
}

.locofy-detail-ai-messages .locofy-detail-ai-chips {
  pointer-events: auto;
  margin-top: 4px;
}

.locofy-detail-ai-chips {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0 10px;
}

.locofy-detail-ai-chips[hidden] {
  display: none !important;
}

.locofy-ai-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 40px;
  background: #fff9e8;
  box-shadow: 0 2px 6px rgba(246, 194, 104, 0.2);
  cursor: pointer;
  text-align: left;
}

.locofy-ai-chip-text {
  flex: 1;
  font-size: 26px;
  color: #915615;
  font-weight: 500;
  font-family: "Source Han Sans CN", "PingFang SC", sans-serif;
  line-height: 1.35;
}

.locofy-ai-chip-arrow {
  flex-shrink: 0;
  color: #915615;
  font-size: 28px;
  margin-left: 8px;
}

.locofy-detail-ai-input-row {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 40px;
  padding: 8px 10px 8px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-top: auto;
  margin-bottom: 22px;
}

.locofy-detail-ai-input-row input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 26px;
  color: #854d1b;
  background: transparent;
  font-family: "Source Han Sans CN", "PingFang SC", sans-serif;
}

.locofy-detail-ai-input-row input::placeholder {
  color: #b8956a;
}

.locofy-detail-ai-send {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff9a3d, #f56320);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.locofy-detail-intro {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  text-overflow: ellipsis;
  word-break: break-word;
}

.locofy-detail-intro p {
  margin: 0;
  display: inline;
}

.locofy-detail-intro p:last-child {
  margin-bottom: 0;
}

.locofy-detail-intro h1,
.locofy-detail-intro h2,
.locofy-detail-intro h3,
.locofy-detail-intro h4 {
  font-size: 1.05em;
  font-weight: 700;
  line-height: 1.4;
  margin: 0.6em 0 0.4em;
  color: #854d1b;
}

.locofy-detail-intro ul,
.locofy-detail-intro ol {
  margin: 0 0 0.75em;
  padding-left: 1.35em;
}

.locofy-detail-intro li {
  margin-bottom: 0.35em;
}

.locofy-detail-intro img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.5em 0;
  border-radius: 8px;
}

.locofy-detail-intro a {
  color: #c45a28;
  text-decoration: underline;
}
