/* Product-level navigation and learning hubs. */
.page-course,
.page-random {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 12px calc(86px + env(safe-area-inset-bottom));
}

.product-page-shell,
.random-learning-shell {
  max-width: 1120px;
  margin: 0 auto;
}

.product-page-hero,
.random-learning-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 14px;
  color: #17345c;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, .9) 0 7%, transparent 8%),
    radial-gradient(circle at 8% 88%, rgba(255, 255, 255, .6) 0 10%, transparent 11%),
    linear-gradient(135deg, #e6f4ff 0%, #f6fbff 52%, #fff6dc 100%);
  border: 1px solid #cfe2f6;
  box-shadow: 0 16px 34px rgba(31, 83, 140, .1);
}

.product-page-hero::after,
.random-learning-hero::after {
  content: '';
  position: absolute;
  width: 160px;
  height: 160px;
  right: -40px;
  bottom: -72px;
  border-radius: 50%;
  background: rgba(255, 201, 91, .28);
}

.product-kicker,
.random-hero-kicker,
.random-panel-kicker,
.random-detail-kicker {
  color: #2472d8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.product-page-hero h1,
.random-learning-hero h1 {
  position: relative;
  z-index: 1;
  margin: 6px 0 8px;
  font-size: clamp(28px, 6vw, 46px);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.product-page-hero p,
.random-learning-hero p {
  position: relative;
  z-index: 1;
  max-width: 680px;
  color: #58708e;
  line-height: 1.75;
}

.product-section {
  margin-bottom: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid #d9e7f7;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(32, 83, 140, .07);
}

.product-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.product-section-head h2 {
  margin-top: 4px;
  color: #1f2a44;
  font-size: 20px;
}

.product-muted {
  color: #7b8da7;
  font-size: 12px;
}

.product-link-btn,
.random-refresh {
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  color: #1769c2;
  background: #edf6ff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.course-subject-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.course-subject-card {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  text-align: left;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}

.course-subject-card:active,
.course-extra-grid button:active,
.random-learning-card button:active,
.random-detail-actions button:active {
  transform: translateY(1px) scale(.99);
}

.course-subject-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(31, 83, 140, .1);
}

.course-chinese { background: linear-gradient(135deg, #fff1eb, #fffaf6); border-color: #ffd8c9; }
.course-math { background: linear-gradient(135deg, #eaf4ff, #f8fbff); border-color: #cfe2ff; }
.course-english { background: linear-gradient(135deg, #eafbf5, #fbfffd); border-color: #c8efdf; }

.course-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: #ef8354;
  font-size: 20px;
  font-weight: 900;
}
.course-math .course-card-icon { background: #3c8ce7; }
.course-english .course-card-icon { background: #22aa78; }
.course-subject-card b { color: #1f2a44; font-size: 17px; }
.course-subject-card em { min-height: 38px; color: #667085; font-size: 12px; font-style: normal; line-height: 1.6; }
.course-subject-card i { margin-top: auto; color: #2472d8; font-size: 12px; font-style: normal; font-weight: 800; }

.course-extra-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.course-extra-grid button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 108px;
  padding: 14px;
  border: 1px solid #e2eaf3;
  border-radius: 16px;
  background: #f9fbfe;
  text-align: left;
  cursor: pointer;
}
.course-extra-grid span { font-size: 22px; }
.course-extra-grid b { color: #1f2a44; }
.course-extra-grid em { color: #7b8da7; font-size: 11px; font-style: normal; }

.product-tip-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px dashed #b7d5f4;
  border-radius: 18px;
  background: #f4f9ff;
}
.product-tip-icon { font-size: 24px; }
.product-tip-card b { color: #22598f; }
.product-tip-card p { margin-top: 4px; color: #667085; line-height: 1.6; font-size: 12px; }

.random-home-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #f3d79f;
  border-radius: 20px;
  background: linear-gradient(105deg, #fff9e9 0%, #fff 55%, #eef8ff 100%);
}
.random-home-teaser-copy { min-width: 0; }
.random-home-teaser-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 4px;
}
.random-home-teaser-title b {
  overflow: hidden;
  color: #1f2a44;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.random-home-teaser-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.random-home-teaser-meta span,
.random-core-meta span,
.random-detail-meta span,
.random-card-meta span {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 999px;
  color: #5e6e82;
  background: #f4f8fc;
  font-size: 10px;
  font-weight: 800;
}
.random-home-teaser-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  padding: 11px 14px;
  color: #fff;
  background: #2472d8;
  font-weight: 800;
  cursor: pointer;
}
.random-home-teaser-btn span { margin-left: 5px; font-size: 16px; }

.random-learning-hero { background: linear-gradient(135deg, #fff4d8 0%, #f5fbff 54%, #e8f5ff 100%); }
.random-hero-meta {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.random-hero-meta span {
  padding: 6px 9px;
  border-radius: 999px;
  color: #5e6e82;
  background: rgba(255, 255, 255, .78);
  font-size: 11px;
  font-weight: 700;
}

.random-learning-toolbar {
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid #d9e7f7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(32, 83, 140, .05);
}
.random-category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.random-category-tabs::-webkit-scrollbar { display: none; }
.random-category-tab {
  flex: 0 0 auto;
  border: 1px solid #dce7f3;
  border-radius: 999px;
  padding: 8px 11px;
  color: #667085;
  background: #f8fbfe;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.random-category-tab.active { color: #fff; background: #2472d8; border-color: #2472d8; }

.random-core-panel {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 20px;
  border: 1px solid #f1d59b;
  border-radius: 20px;
  background: linear-gradient(110deg, #fff8e7 0%, #fff 62%, #eef8ff 100%);
  box-shadow: 0 10px 28px rgba(150, 112, 35, .08);
}
.random-core-copy { min-width: 0; }
.random-core-copy h2 { margin-top: 5px; color: #1f2a44; font-size: 23px; }
.random-core-copy p { max-width: 710px; margin-top: 7px; color: #667085; line-height: 1.7; }
.random-core-meta,
.random-detail-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.random-core-meta span { background: rgba(255, 255, 255, .78); }
.random-core-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.random-today-panel,
.random-learning-detail {
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid #d9e7f7;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(32, 83, 140, .07);
}
.random-panel-head,
.random-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.random-panel-head h2,
.random-detail-head h2 { margin-top: 5px; color: #1f2a44; font-size: 20px; }
.random-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.random-learning-card {
  display: flex;
  flex-direction: column;
  min-height: 205px;
  padding: 16px;
  border: 1px solid #e0e9f3;
  border-radius: 18px;
  background: #fbfdff;
}
.random-learning-card.featured { border-color: #9fc7f4; background: linear-gradient(145deg, #f7fbff, #fffdf3); box-shadow: inset 0 0 0 2px rgba(36, 114, 216, .08); }
.random-learning-card.learned { opacity: .78; }
.random-card-top { display: flex; align-items: center; gap: 7px; }
.random-card-icon { font-size: 24px; }
.random-card-category { color: #2472d8; font-size: 11px; font-weight: 900; }
.random-card-level { margin-left: auto; color: #7b8da7; font-size: 10px; }
.random-learning-card h3 { margin: 12px 0 7px; color: #1f2a44; font-size: 17px; }
.random-card-intro { color: #667085; font-size: 12px; line-height: 1.7; }
.random-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.random-card-actions,
.random-detail-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; }
.random-primary,
.random-secondary {
  border: 0;
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.random-primary { color: #fff; background: #2472d8; }
.random-secondary { color: #2472d8; background: #edf6ff; }
.random-detail-tag { padding: 6px 9px; border-radius: 999px; color: #2472d8; background: #edf6ff; font-size: 11px; font-weight: 800; white-space: nowrap; }
.random-detail-intro { color: #52657e; line-height: 1.8; }
.random-detail-section,
.random-detail-talk,
.random-detail-answer { margin-top: 14px; padding: 14px; border-radius: 15px; line-height: 1.8; }
.random-detail-section { background: #f7fbff; }
.random-detail-talk { background: #fff9e9; }
.random-detail-answer { background: #effbf4; }
.random-detail-follow { margin-top: 14px; padding: 14px; border-radius: 15px; background: #fff1eb; line-height: 1.8; }
.random-detail-section b,
.random-detail-talk b,
.random-detail-answer b,
.random-detail-follow b { color: #22598f; font-size: 12px; }
.random-detail-section ol { padding-left: 22px; margin-top: 5px; color: #53657d; font-size: 13px; }
.random-detail-talk p,
.random-detail-answer p,
.random-detail-follow p { margin-top: 4px; color: #53657d; font-size: 13px; }
.random-empty { padding: 28px; border-radius: 18px; text-align: center; color: #7b8da7; background: #fff; }

@media (max-width: 680px) {
  .page-course, .page-random { padding-left: 10px; padding-right: 10px; }
  .product-page-hero, .random-learning-hero { padding: 20px; border-radius: 20px; }
  .product-section, .random-today-panel, .random-learning-detail { padding: 14px; border-radius: 18px; }
  .course-subject-grid, .random-card-grid { grid-template-columns: 1fr; }
  .course-subject-card { min-height: 145px; }
  .course-extra-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .random-home-teaser { align-items: flex-start; flex-direction: column; }
  .random-home-teaser-btn { width: 100%; }
  .random-core-panel { align-items: stretch; flex-direction: column; padding: 16px; }
  .random-core-copy h2 { font-size: 20px; }
  .random-core-actions { width: 100%; }
  .random-core-actions button { flex: 1; }
  .random-detail-head { flex-direction: column; }
}
