/* ====== 学习小工具统一组件层（学成语 / 学古诗 / 学歇后语）======
 * 面向初中 / 小学生 · 手机紧凑布局 · 在 common.css + kids.css 之后加载
 * 页面须 <body class="theme-kids">；统一用 .learn-* 组件类，页面私有样式只写功能布局
 */

.learn-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 12px 28px;
}

/* ===== 标题 ===== */
.learn-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  color: var(--text);
}
.learn-sub {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 2px 0 10px;
}

/* ===== 分段标题 ===== */
.learn-sec {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 10px 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== 选项卡 ===== */
.learn-tabs {
  display: flex;
  gap: 0;
  background: #F2F3F5;
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 10px;
}
.learn-tab {
  flex: 1;
  text-align: center;
  padding: 9px 4px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  min-height: 42px;
  font-family: inherit;
  border: none;
  background: none;
}
.learn-tab.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

/* ===== 卡片 ===== */
.learn-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

/* ===== 进度条 ===== */
.learn-progress {
  height: 8px;
  background: #F0F1F3;
  border-radius: 999px;
  overflow: hidden;
}
.learn-progress .fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .3s var(--ease-out);
}

/* ===== AI 按钮 + 结果框 ===== */
.learn-ai-btn {
  width: 100%;
  min-height: 44px;
  margin: 8px 0 0;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.learn-ai-btn:active { opacity: .8; }
.learn-ai-btn:disabled { opacity: .5; }
.learn-ai-result {
  margin-top: 8px;
  padding: 12px;
  background: #f5f3ff;
  border-radius: 12px;
  font-size: 13px;
  color: #4c1d95;
  line-height: 1.7;
  border: 1px solid #ddd6fe;
  display: none;
  text-align: left;
}
.learn-ai-result.show { display: block; }

/* ===== 统计（星星 / 进度文案）===== */
.learn-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 4px 0 8px;
}
.learn-stat .stars { color: #F1C40F; font-weight: 700; }

/* ===== 搜索框 ===== */
.learn-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F2F3F5;
  border-radius: 999px;
  padding: 0 14px;
  margin-bottom: 10px;
  min-height: 44px;
}
.learn-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  color: var(--text);
}

/* ===== 选项网格（选择题）===== */
.learn-opt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}
.learn-opt {
  min-height: 56px;
  padding: 12px 10px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  word-break: break-word;
  font-family: inherit;
  transition: all .15s;
}
.learn-opt:active { transform: scale(.96); }
.learn-opt.correct { background: #e8f8ee; border-color: #2ECC71; color: #2ECC71; }
.learn-opt.wrong   { background: #fdecec; border-color: #FF4757; color: #FF4757; }
.learn-opt.disabled { pointer-events: none; opacity: .7; }

/* ===== 列表（浏览模式）===== */
.learn-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.learn-list-item:active { background: #fafafa; transform: scale(.98); }
.learn-list-item .li-idx { color: var(--text-muted); font-size: 12px; width: 26px; text-align: center; flex-shrink: 0; }
.learn-list-item .li-body { flex: 1; min-width: 0; }
.learn-list-item .li-title { font-size: 14px; font-weight: 600; color: var(--text); }
.learn-list-item .li-sub { font-size: 12px; color: var(--primary); margin-top: 2px; }

/* ===== 内容大字符（成语 / 诗句 / 谜面）===== */
.learn-display {
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", "Source Han Serif SC", serif;
  color: var(--text);
  text-align: center;
}
