/* 语文 · 古诗词：诗词页（听整首 / 点句听）+ 诵读页（逐句跟读） */

/* .screen 本身已经是 flex 列、padding 由 .app 统一给，这里只补间距 */
.shi-screen,
.shi-read {
  gap: clamp(10px, 1.8vh, 18px);
}

.shi-screen .math-top,
.shi-read .math-top {
  flex: none;
}
.shi-screen .math-top .chip,
.shi-read .math-top .chip {
  flex: none;
  margin-left: auto;
  white-space: nowrap;
}

/* ---------------- 诗词卡片 ---------------- */
.shi-stage,
.shi-read__stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

.shi-card {
  width: min(920px, 100%);
  max-height: 100%;
  display: grid;
  justify-items: center;
  gap: clamp(8px, 1.4vh, 16px);
  padding: clamp(16px, 2.6vh, 30px) clamp(20px, 3vw, 46px);
  background: var(--surface);
  border-radius: clamp(24px, 3.4vw, 38px);
  box-shadow: var(--shadow-m);
  box-sizing: border-box;
}

.shi-scene {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 26px);
  line-height: 1;
}
.shi-scene__em {
  font-size: clamp(34px, 6.2vh, 62px);
  filter: drop-shadow(0 6px 10px rgba(120, 96, 70, 0.16));
}
.shi-scene--small .shi-scene__em {
  font-size: clamp(26px, 4.4vh, 44px);
}

/* ---------------- 诗句 ---------------- */
.shi-lines {
  display: grid;
  gap: clamp(2px, 0.6vh, 8px);
  width: 100%;
  justify-items: center;
}

.shi-line {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: clamp(6px, 1.1vh, 12px) clamp(12px, 1.6vw, 22px);
  border-radius: clamp(14px, 1.6vw, 20px);
  line-height: 1.34;
  transition: background 0.18s var(--ease), transform 0.18s var(--ease),
    color 0.18s var(--ease);
  position: relative;
}
.shi-line__text {
  font-size: clamp(24px, 4vh, 42px);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.shi-line__ico {
  display: inline-flex;
  width: clamp(16px, 2.2vh, 22px);
  height: clamp(16px, 2.2vh, 22px);
  color: var(--muted);
  opacity: 0.42;
  flex: none;
  transition: opacity 0.18s var(--ease);
}
.shi-line__ico svg {
  width: 100%;
  height: 100%;
}

.shi-line.is-heard .shi-line__ico {
  color: var(--brand, #5fbe96);
  opacity: 0.9;
}

.shi-line.is-now {
  background: var(--unit-soft, var(--soft));
  transform: translateY(-1px);
}
.shi-line.is-now .shi-line__text {
  color: var(--unit-deep, var(--ink));
}
.shi-line.is-now .shi-line__ico {
  opacity: 1;
  color: var(--unit-main, var(--brand));
}

.shi-line:active {
  transform: scale(0.99);
}

.shi-note {
  margin: 0;
  text-align: center;
  font-size: clamp(12px, 1.7vh, 15px);
  font-weight: 700;
  color: var(--muted);
  line-height: 1.5;
  max-width: 46ch;
}

.shi-actions {
  flex: none;
  display: flex;
  gap: 12px;
}
.shi-actions .btn {
  flex: 1;
}
.shi-actions .btn.is-busy {
  opacity: 0.6;
}

/* ---------------- 诵读页 ---------------- */
.shi-card--read {
  width: min(880px, 100%);
  gap: clamp(6px, 1.2vh, 14px);
}
.shi-lines--read .shi-line {
  cursor: pointer;
  background: transparent;
}
.shi-lines--read .shi-line.is-past .shi-line__text {
  opacity: 0.45;
}
.shi-lines--read .shi-line.is-next .shi-line__text {
  opacity: 0.45;
}
.shi-lines--read .shi-line.is-now {
  background: var(--unit-soft, var(--soft));
}
.shi-lines--read .shi-line.is-now .shi-line__text {
  opacity: 1;
  transform: scale(1.02);
}
.shi-lines--read .shi-line.is-heard .shi-line__ico {
  opacity: 0.9;
}

.shi-read__bottom {
  flex: none;
  min-height: clamp(96px, 16vh, 132px);
  display: grid;
  align-items: center;
}
.shi-read__bottom .learn__actions {
  display: flex;
  gap: 12px;
}
.shi-read__bottom .learn__actions .btn {
  flex: 1 1 0;
  max-width: none;
}
.shi-read__bottom .mic-panel {
  width: 100%;
}

/* ---------------- 首页古诗卡 ---------------- */
.shi-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.shi-card-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-s, var(--shadow-m));
  text-align: left;
  transition: transform 0.16s var(--ease);
}
.shi-card-btn:active {
  transform: scale(0.985);
}
.shi-card-btn__scene {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(54px, 7.6vh, 70px);
  height: clamp(54px, 7.6vh, 70px);
  border-radius: 20px;
  background: var(--unit-soft, var(--soft));
  font-size: clamp(26px, 3.9vh, 36px);
  line-height: 1;
}
.shi-card-btn__body {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.shi-card-btn__body b {
  font-size: clamp(16px, 2.3vh, 19px);
  color: var(--ink);
}
.shi-card-btn__body span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shi-card-btn__done {
  margin-left: auto;
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--unit-soft, var(--soft));
  color: var(--unit-deep, var(--brand));
}
.shi-card-btn__done svg {
  width: 15px;
  height: 15px;
}

/* ---------------- 竖屏 ---------------- */
@media (orientation: portrait) {
  .shi-line__text {
    font-size: clamp(28px, 3.6vh, 44px);
  }
  .shi-scene__em {
    font-size: clamp(38px, 5.4vh, 64px);
  }
  .shi-card {
    padding: clamp(20px, 3vh, 34px) clamp(18px, 4vw, 40px);
  }
  .shi-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 横屏但很矮（分屏、小窗）时收紧一点 */
@media (max-height: 700px) and (orientation: landscape) {
  .shi-line__text {
    font-size: clamp(22px, 3.4vh, 32px);
  }
  .shi-scene__em {
    font-size: clamp(28px, 4.6vh, 42px);
  }
  .shi-card {
    gap: 6px;
    padding: 14px 26px;
  }
  .shi-note {
    display: none;
  }
}

/* 竖屏且很高时，注释可以舒服展开 */
@media (orientation: portrait) and (min-height: 1000px) {
  .shi-note {
    font-size: 15px;
  }
}
