/* ============================================================
   知识塔 · 共用样式
   ============================================================
   教师端预览与学生端学生页共用这一份，保证「预览 = 学生看到的」。
   配色沿用音乐岛的暖纸质风格（--paper / --ink / --gold）。
   ============================================================ */

.tower {
  --t-paper: #efeee3;
  --t-white: #faf9f2;
  --t-ink: #2c4034;
  --t-soft: #7a806d;
  --t-line: #d9dccd;
  --t-gold: #a87c4b;
  --t-green: #526d4e;
  --t-tip: #eaf0e2;
  --t-warn: #f4ead9;
  color: var(--t-ink);
  font-family: 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.85;
}

.tower *,
.tower *::before,
.tower *::after {
  box-sizing: border-box;
}

/* ---------- 面包屑 ---------- */
.tower-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--t-soft);
  margin: 0 0 16px;
}
.tower-crumbs button {
  border: 0;
  background: none;
  padding: 2px 4px;
  color: var(--t-green);
  font-size: 13px;
  cursor: pointer;
  border-radius: 5px;
  font-family: inherit;
}
.tower-crumbs button:hover {
  background: #e7eddf;
}
.tower-crumbs i {
  font-style: normal;
  opacity: 0.5;
}
.tower-crumbs b {
  font-weight: 500;
  color: var(--t-ink);
}

/* ---------- 章节目录 ---------- */
.tower-intro {
  font-size: 14px;
  color: var(--t-soft);
  margin: 0 0 20px;
}
.tower-cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.tower-card {
  position: relative;
  display: flex;
  gap: 14px;
  text-align: left;
  width: 100%;
  border: 1px solid var(--t-line);
  background: #fffff7;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.tower-card:hover {
  border-color: #b9c2a8;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px #2c40340f;
}
.tower-card:focus-visible {
  outline: 2px solid var(--t-gold);
  outline-offset: 2px;
}
.tower-card .cover {
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  border-radius: 9px;
  background: linear-gradient(140deg, #e4ebda, #d3ddc4);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: 'Songti SC', SimSun, serif;
  font-size: 22px;
  color: #7d8a6a;
}
.tower-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tower-card .meta {
  min-width: 0;
  flex: 1;
}
.tower-card .no {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--t-gold);
  margin-bottom: 3px;
}
.tower-card h3 {
  font-family: 'Songti SC', SimSun, serif;
  font-size: 19px;
  font-weight: 400;
  margin: 0 0 6px;
  line-height: 1.35;
}
.tower-card p {
  margin: 0;
  font-size: 13px;
  color: var(--t-soft);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tower-card .count {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: #667356;
  background: #e7eddf;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ---------- 章节详情 ---------- */
.tower-chapter-head {
  border-bottom: 1px solid var(--t-line);
  padding-bottom: 18px;
  margin-bottom: 22px;
}
.tower-chapter-head .no {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--t-gold);
}
.tower-chapter-head h2 {
  font-family: 'Songti SC', SimSun, serif;
  font-size: 27px;
  font-weight: 400;
  margin: 5px 0 10px;
  line-height: 1.3;
}
.tower-chapter-head .intro {
  margin: 0;
  color: #4c5b4c;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  /* 音乐岛 style.css 有一条裸 .intro 规则（absolute 定位，用于岛首页介绍面板），
     知识塔运行在岛页面内会被误命中，这里必须逐属性显式复位 */
  position: static;
  left: auto;
  top: auto;
  width: auto;
  padding: 0;
  pointer-events: auto;
  z-index: auto;
}
.tower-goals {
  margin: 16px 0 0;
  padding: 14px 16px;
  background: var(--t-tip);
  border-radius: 10px;
  border-left: 3px solid #8eab74;
}
.tower-goals h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #5c6b4c;
  font-weight: 500;
}
.tower-goals p {
  margin: 0;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tower-points {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.tower-point-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--t-line);
  background: #fffff7;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
}
.tower-point-row:hover {
  border-color: #b9c2a8;
  background: #fbfbf1;
}
.tower-point-row .idx {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 50%;
  background: #e7eddf;
  color: #526d4e;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.tower-point-row .body {
  flex: 1;
  min-width: 0;
}
.tower-point-row h3 {
  margin: 0 0 3px;
  font-size: 16px;
  font-weight: 500;
}
.tower-point-row p {
  margin: 0;
  font-size: 13px;
  color: var(--t-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tower-point-row .arrow {
  color: #b3bba2;
  font-size: 18px;
}

/* ---------- 知识点详情 ---------- */
.tower-point-head {
  border-bottom: 1px solid var(--t-line);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.tower-point-head h2 {
  font-family: 'Songti SC', SimSun, serif;
  font-size: 24px;
  font-weight: 400;
  margin: 0 0 10px;
  line-height: 1.35;
}
.tower-point-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
}
.tower-point-meta span {
  background: #eef1e6;
  color: #5f6b52;
  padding: 3px 10px;
  border-radius: 20px;
}
.tower-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 0;
}
.tower-detail-grid > div {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f5f6ec;
  border: 1px solid #e4e8d8;
}
.tower-detail-grid h4 {
  margin: 0 0 5px;
  font-size: 12.5px;
  color: #7d8a6a;
  font-weight: 500;
}
.tower-detail-grid p {
  margin: 0;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- 内容块 ---------- */
.tower-blocks {
  margin: 24px 0 0;
  display: grid;
  gap: 22px;
}
.tower-block {
  position: relative;
}
.tower-block > .blk-title {
  font-size: 13px;
  color: var(--t-gold);
  letter-spacing: 0.04em;
  margin: 0 0 8px;
  font-weight: 500;
}

/* 富文本 */
.tower-rich h1,
.tower-rich h2,
.tower-rich h3,
.tower-rich h4 {
  font-family: 'Songti SC', SimSun, serif;
  font-weight: 400;
  line-height: 1.4;
  margin: 1.4em 0 0.5em;
}
.tower-rich h1 {
  font-size: 23px;
}
.tower-rich h2 {
  font-size: 20px;
}
.tower-rich h3 {
  font-size: 18px;
}
.tower-rich h4 {
  font-size: 16px;
}
.tower-rich > :first-child {
  margin-top: 0;
}
.tower-rich p {
  margin: 0.7em 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tower-rich ul,
.tower-rich ol {
  margin: 0.7em 0;
  padding-left: 1.5em;
}
.tower-rich li {
  margin: 0.3em 0;
}
.tower-rich blockquote {
  margin: 0.9em 0;
  padding: 8px 14px;
  border-left: 3px solid #b6c49e;
  background: #f3f5ea;
  color: #4c5b4c;
  border-radius: 0 8px 8px 0;
}
.tower-rich code {
  background: #ecefe2;
  padding: 1px 6px;
  border-radius: 5px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.92em;
}
.tower-rich pre {
  background: #2c4034;
  color: #eef2e5;
  padding: 14px 16px;
  border-radius: 10px;
  overflow: auto;
}
.tower-rich pre code {
  background: none;
  color: inherit;
  padding: 0;
}
.tower-rich a {
  color: #6b7f52;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tower-rich hr {
  border: 0;
  border-top: 1px solid var(--t-line);
  margin: 1.6em 0;
}
.tower-rich strong {
  font-weight: 600;
}
.tower-rich em {
  font-style: italic;
  color: #57614a;
}
.tower-rich .md-music {
  font-family: 'Songti SC', SimSun, serif;
  color: #8a7450;
  background: #f6f2e6;
  padding: 1px 6px;
  border-radius: 5px;
}

/* 图片 */
.tower-figure {
  margin: 0;
}
.tower-figure img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--t-line);
  background: #fff;
  display: block;
}
.tower-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--t-soft);
  text-align: center;
}

/* 音频播放器 */
.tower-audio {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--t-line);
  background: #fffff7;
  border-radius: 12px;
  flex-wrap: wrap;
}
.tower-audio .play {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--t-green);
  color: #fffdf2;
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.tower-audio .play:hover {
  background: #3f5a3b;
}
.tower-audio .track {
  flex: 1 1 200px;
  min-width: 140px;
}
.tower-audio .track .name {
  font-size: 13.5px;
  margin-bottom: 6px;
  color: #4c5b4c;
  overflow-wrap: anywhere;
}
.tower-audio .bar {
  height: 8px;
  border-radius: 6px;
  background: #e3e7d8;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.tower-audio .bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8eab74, #526d4e);
  border-radius: 6px;
}
.tower-audio .time {
  font-size: 12px;
  color: var(--t-soft);
  font-variant-numeric: tabular-nums;
  min-width: 82px;
  text-align: right;
}
.tower-audio .vol {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--t-soft);
}
.tower-audio .vol input {
  width: 82px;
  accent-color: #526d4e;
}

/* 视频 */
.tower-video video {
  width: 100%;
  max-height: 560px;
  border-radius: 12px;
  border: 1px solid var(--t-line);
  background: #000;
  display: block;
}
.tower-video .cap {
  margin-top: 8px;
  font-size: 13px;
  color: var(--t-soft);
  text-align: center;
}

/* iframe 沙箱 */
.tower-iframe {
  border: 1px solid var(--t-line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.tower-iframe iframe {
  width: 100%;
  border: 0;
  display: block;
}
.tower-iframe .note {
  margin: 0;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--t-soft);
  background: #f3f5ea;
  border-top: 1px solid var(--t-line);
}

/* 练习题 */
.tower-quiz {
  border: 1px solid var(--t-line);
  border-radius: 12px;
  padding: 18px;
  background: #fffff7;
}
.tower-quiz .q {
  font-size: 15.5px;
  margin: 0 0 14px;
  font-weight: 500;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tower-quiz .opts {
  display: grid;
  gap: 9px;
}
.tower-quiz .opts button {
  text-align: left;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid var(--t-line);
  background: #fffff7;
  font-size: 14px;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}
.tower-quiz .opts button:hover:not(:disabled) {
  background: #e9efdf;
}
.tower-quiz .opts button.correct {
  background: #ddebd3;
  border-color: #80a765;
}
.tower-quiz .opts button.wrong {
  background: #f1e1d5;
  border-color: #c09476;
}
.tower-quiz .opts button:disabled {
  cursor: default;
}
.tower-quiz .fb {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 9px;
  background: #eaf0e2;
  border-left: 3px solid #8eab74;
  font-size: 14px;
}
.tower-quiz .fb.bad {
  background: #f5ece1;
  border-left-color: #c09476;
}
.tower-quiz .fb p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 提示卡 / 知识总结 */
.tower-tip,
.tower-summary {
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 14.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tower-tip {
  background: var(--t-warn);
  border-left: 4px solid var(--t-gold);
}
.tower-summary {
  background: var(--t-tip);
  border-left: 4px solid #8eab74;
}
.tower-tip::before,
.tower-summary::before {
  display: block;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-weight: 500;
}
.tower-tip::before {
  content: '提示';
  color: var(--t-gold);
}
.tower-summary::before {
  content: '知识总结';
  color: #5c6b4c;
}

/* 文件下载 / 外链 */
.tower-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px dashed #c6cfb4;
  border-radius: 12px;
  background: #fbfbf1;
  text-decoration: none;
  color: inherit;
}
.tower-file:hover {
  background: #f4f6ea;
  border-color: #a8b492;
}
.tower-file .ico {
  font-size: 22px;
}
.tower-file .info {
  flex: 1;
  min-width: 0;
}
.tower-file .info b {
  display: block;
  font-size: 14.5px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.tower-file .info small {
  color: var(--t-soft);
  font-size: 12px;
}
.tower-file .dl {
  font-size: 13px;
  color: #6b7f52;
  white-space: nowrap;
}
.tower-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--t-line);
  border-radius: 12px;
  background: #fffff7;
  text-decoration: none;
  color: inherit;
}
.tower-link:hover {
  border-color: #b9c2a8;
}
.tower-link .ico {
  font-size: 20px;
}
.tower-link .info {
  flex: 1;
  min-width: 0;
}
.tower-link .info b {
  display: block;
  font-size: 14.5px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.tower-link .info small {
  color: var(--t-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.tower-link .go {
  font-size: 13px;
  color: #6b7f52;
  white-space: nowrap;
}

/* 空态 */
.tower-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--t-soft);
  font-size: 14px;
  border: 1px dashed var(--t-line);
  border-radius: 12px;
  background: #fbfbf1;
}
.tower-empty b {
  display: block;
  font-family: 'Songti SC', SimSun, serif;
  font-size: 18px;
  color: #5c6b4c;
  margin-bottom: 6px;
  font-weight: 400;
}

/* 上一篇 / 下一篇 */
.tower-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 34px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--t-line);
}
.tower-pager button {
  border: 1px solid var(--t-line);
  background: #fffff7;
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  max-width: 48%;
  text-align: left;
}
.tower-pager button:hover {
  border-color: #b9c2a8;
}
.tower-pager button:disabled {
  opacity: 0.4;
  cursor: default;
}
.tower-pager button span {
  display: block;
  font-size: 11.5px;
  color: var(--t-soft);
  margin-bottom: 2px;
}

/* ---------- 手机：单栏 ---------- */
@media (max-width: 720px) {
  .tower {
    font-size: 15px;
  }
  .tower-cards {
    grid-template-columns: 1fr;
    gap: 11px;
  }
  .tower-card {
    padding: 13px;
  }
  .tower-card .cover {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
    font-size: 18px;
  }
  .tower-card h3 {
    font-size: 17px;
  }
  .tower-chapter-head h2 {
    font-size: 22px;
  }
  .tower-point-head h2 {
    font-size: 20px;
  }
  .tower-detail-grid {
    grid-template-columns: 1fr;
  }
  .tower-audio {
    gap: 11px;
    padding: 12px;
  }
  .tower-audio .time {
    min-width: 62px;
    font-size: 11.5px;
  }
  .tower-audio .vol {
    display: none;
  }
  .tower-pager {
    flex-direction: column;
  }
  .tower-pager button {
    max-width: 100%;
    width: 100%;
  }
}

/* ---------- 知识塔 ↔ 实验室联动：相关实验 ---------- */
.tower-related-lab {
  margin: 18px 0 6px;
  background: var(--t-tip);
  border: 1px solid var(--t-line);
  border-radius: 12px;
  padding: 12px 14px;
}
.tower-related-lab h4 {
  margin: 0 0 2px;
  font-size: 14px;
  color: var(--t-green);
}
.tower-related-tip {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--t-soft);
}
.tower-related-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--t-line);
  background: var(--t-white);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.tower-related-item:last-child { margin-bottom: 0; }
.tower-related-item:hover { border-color: var(--t-gold); transform: translateX(3px); }
.tower-related-item b { display: block; font-size: 14px; color: var(--t-ink); }
.tower-related-item span { display: block; font-size: 12px; color: var(--t-soft); margin-top: 2px; }
.tower-related-item i {
  font-style: normal;
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--t-green);
  font-weight: 600;
}
