/* === 西班牙语课程站点样式 === */
:root {
  --primary: #1f4e79;
  --accent: #c0392b;
  --bg: #f7f9fc;
  --card-bg: #fff;
  --text: #222;
  --text-light: #666;
  --border: #e0e6ed;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 180px; /* 给底部播放器留空间 */
}

.site-header {
  background: linear-gradient(135deg, var(--primary), #2c6ca8);
  color: #fff;
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.site-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.site-header .subtitle {
  font-size: 1.05rem;
  opacity: 0.92;
}

main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.intro {
  background: var(--card-bg);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.intro h2 {
  color: var(--primary);
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.lesson-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border-left: 4px solid var(--primary);
  text-decoration: none;
  color: inherit;
  display: block;
}

.lesson-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.lesson-card .num {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 0.6rem;
  letter-spacing: 0.5px;
}

.lesson-card .title-es {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.lesson-card .title-cn {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 0.8rem;
}

.lesson-card .meta {
  display: flex;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: var(--text-light);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.lesson-card .meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* === 课程详情页 === */
.lesson-detail {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow);
}

.lesson-detail h1 {
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
}

.lesson-detail .subtitle {
  color: var(--text-light);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.goals {
  background: linear-gradient(135deg, #f4f7fa, #e9f0f7);
  padding: 1rem 1.3rem;
  border-radius: 8px;
  margin-bottom: 1.8rem;
  border-left: 4px solid var(--accent);
}

.goals h3 {
  color: var(--accent);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.goals ul {
  list-style: none;
  padding: 0;
}

.goals li {
  padding: 0.2rem 0 0.2rem 1.2rem;
  position: relative;
}

.goals li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.section {
  margin-bottom: 2rem;
}

.section h2 {
  color: var(--primary);
  font-size: 1.3rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

.frase-table, .dialog-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.frase-table th, .frase-table td,
.dialog-table th, .dialog-table td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.frase-table th, .dialog-table th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.frase-table tr:nth-child(even),
.dialog-table tr:nth-child(even) {
  background: #f9fbfd;
}

.frase-table .es {
  font-family: "DejaVu Sans", "Liberation Sans", sans-serif;
  color: var(--primary);
  font-weight: 500;
}

.frase-table .es em {
  background: #fff9e6;
  padding: 0 3px;
  font-style: normal;
  border-radius: 3px;
}

.audio-section {
  background: linear-gradient(135deg, #1f4e79, #2c6ca8);
  color: #fff;
  padding: 1.3rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  box-shadow: var(--shadow);
}

.audio-section .play-big {
  background: #fff;
  color: var(--primary);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s;
}

.audio-section .play-big:hover { transform: scale(1.08); }
.audio-section .play-big:disabled { opacity: 0.5; cursor: not-allowed; }

.audio-section .info {
  flex-grow: 1;
}

.audio-section .info .title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.audio-section .info .meta {
  font-size: 0.85rem;
  opacity: 0.9;
}

.audio-section audio {
  display: none;
}

.pdf-pages {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: center;
}

.pdf-pages img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #fff;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.2rem;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  transition: transform 0.1s;
}

.back-link:hover { transform: translateX(-3px); }

/* === 底部播放器 === */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 100;
}

.player-info {
  min-width: 180px;
  max-width: 250px;
}

.player-info .player-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-info .player-time {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

.player-controls {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.play-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.play-btn:hover { background: #2c6ca8; }
.play-btn:disabled { opacity: 0.4; cursor: not-allowed; }

#seekBar {
  flex-grow: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

#seekBar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

#seekBar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

@media (max-width: 640px) {
  .site-header h1 { font-size: 1.6rem; }
  .lesson-grid { grid-template-columns: 1fr; }
  .lesson-detail { padding: 1.3rem 1.2rem; }
  .audio-section { flex-direction: column; align-items: flex-start; }
  .player-info { min-width: 0; }
}
