/* ============================================================
   羡曦吾语AI · 功能组件样式（二）
   词汇卡 / 错题本 / AI对话 / 社区 / 日历 / 复盘 / 雷达图 / 勋章墙
   ============================================================ */

/* ---------- 词汇卡 ---------- */
.qh-flashcard {
  background: linear-gradient(135deg, #fef9c3, #fef08a);
  border-radius: var(--r-m);
  padding: 16px;
  margin: 12px 0;
  text-align: center;
}
.qh-flashcard h4 { margin: 0 0 12px; color: #854d0e; }
.qh-fc-card {
  background: #fff;
  border-radius: var(--r-m);
  padding: 28px 16px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform .2s;
  user-select: none;
}
.qh-fc-card:hover { transform: translateY(-2px); }
.qh-fc-term {
  font-size: 22px;
  font-weight: 800;
  color: var(--lake);
}
.qh-fc-def {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}
.qh-fc-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}
.qh-fc-btn {
  background: var(--lake);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.qh-fc-btn:hover { background: var(--lake-deep); }
.qh-fc-progress {
  margin-top: 10px;
  font-size: 12px;
  color: #854d0e;
}

/* ---------- 错题本 ---------- */
.qh-mistakes { padding: 8px 0; }
.qh-mistakes h4 { margin: 0 0 10px; color: #374151; }
.qh-mistakes-list { display: flex; flex-direction: column; gap: 10px; }
.qh-mistake-item {
  background: #fff7f7;
  border: 1px solid #fecaca;
  border-radius: var(--r-s);
  padding: 10px 12px;
}
.qh-m-q { font-size: 13px; font-weight: 600; color: #1f2937; margin-bottom: 6px; }
.qh-m-wrong { font-size: 12px; color: #dc2626; }
.qh-m-right { font-size: 12px; color: #16a34a; margin-top: 2px; }
.qh-m-note { font-size: 12px; color: #6b7280; margin-top: 4px; font-style: italic; }
.qh-m-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 11px;
  color: #9ca3af;
}
.qh-m-del {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 11px;
  cursor: pointer;
}

/* ---------- AI 对话练习 ---------- */
.qh-chat-practice {
  background: #f0f9ff;
  border-radius: var(--r-m);
  padding: 14px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
}
.qh-chat-practice h4 { margin: 0 0 10px; color: #0369a1; }
.qh-chat-messages {
  height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  padding: 4px;
}
.qh-chat-msg { display: flex; }
.qh-chat-msg.user { justify-content: flex-end; }
.qh-chat-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: var(--r-m);
  font-size: 13px;
  line-height: 1.5;
}
.qh-chat-msg.user .qh-chat-bubble {
  background: var(--lake);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.qh-chat-msg.bot .qh-chat-bubble {
  background: #fff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}
.qh-chat-input-box {
  display: flex;
  gap: 6px;
}
.qh-chat-input {
  flex: 1;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.qh-chat-input:focus { border-color: #0ea5e9; }
.qh-chat-send {
  background: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 13px;
  cursor: pointer;
}
.qh-chat-send:hover { background: #0284c7; }

/* ---------- 学习社区 ---------- */
.qh-community { padding: 8px 0; }
.qh-community h4 { margin: 0 0 10px; color: #374151; }
.qh-post {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--r-m);
  padding: 12px;
  margin-bottom: 10px;
}
.qh-post-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.qh-post-avatar { font-size: 20px; }
.qh-post-user { font-size: 13px; font-weight: 600; color: #1f2937; }
.qh-post-time { font-size: 11px; color: #9ca3af; margin-left: auto; }
.qh-post-text { font-size: 13px; color: #374151; line-height: 1.5; margin-bottom: 8px; }
.qh-post-actions {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #6b7280;
}

/* ---------- 学习日历 ---------- */
.qh-calendar {
  background: #fff;
  border-radius: var(--r-m);
  padding: 14px;
  margin: 12px 0;
}
.qh-calendar h4 { margin: 0 0 12px; color: #374151; }
.qh-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 6px;
}
.qh-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.qh-cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #6b7280;
}
.qh-cal-empty { background: transparent; }
.qh-cal-learned {
  background: linear-gradient(135deg, #86efac, #4ade80);
  color: #14532d;
  font-weight: 600;
}
.qh-cal-today {
  border: 2px solid var(--lake);
}

/* ---------- 每日复盘 ---------- */
.qh-review {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-radius: var(--r-m);
  padding: 14px;
  margin: 12px 0;
}
.qh-review h4 { margin: 0 0 10px; color: #5b21b6; }
.qh-review-done {
  background: #dcfce7;
  color: #166534;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.qh-review-content { display: flex; flex-direction: column; gap: 10px; }
.qh-review-q {
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
}
.qh-review-form { display: flex; flex-direction: column; gap: 10px; }
.qh-review-item { display: flex; flex-direction: column; gap: 4px; }
.qh-review-item label { font-size: 12px; color: #5b21b6; font-weight: 600; }
.qh-review-input {
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
}
.qh-review-input:focus { border-color: #8b5cf6; }
.qh-review-submit {
  background: #8b5cf6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-end;
  min-width: 100px;
}
.qh-review-submit:hover { background: #7c3aed; }

/* ---------- 能力雷达图 ---------- */
.qh-radar {
  background: #fff;
  border-radius: var(--r-m);
  padding: 14px;
  margin: 12px 0;
  text-align: center;
}
.qh-radar h4 { margin: 0 0 10px; color: #374151; text-align: left; }
.qh-radar-svg { width: 100%; max-width: 300px; height: auto; }
.qh-radar-axis { stroke: #e5e7eb; stroke-width: 1; }

/* ---------- 勋章墙 ---------- */
.qh-medal-wall {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: var(--r-m);
  padding: 14px;
  margin: 12px 0;
}
.qh-medal-wall h4 { margin: 0 0 8px; color: #92400e; }
.qh-medal-progress {
  font-size: 12px;
  color: #92400e;
  margin-bottom: 10px;
}
.qh-medal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.qh-medal {
  background: #fff;
  border-radius: var(--r-s);
  padding: 10px 6px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}
.qh-medal-emoji { font-size: 24px; }
.qh-medal-name {
  font-size: 11px;
  color: #92400e;
  font-weight: 600;
  margin-top: 2px;
}

/* ---------- 学习中心页面布局 ---------- */
.qh-study-center {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
body { padding-bottom: 0; }

/* 折叠规则 */
[data-collapsed] { display: none !important; }
body.qh-expanded [data-collapsed] { display: block !important; }
body.qh-expanded [data-collapsed].qh-sc-grid-2 { display: grid !important; }

/* 展开提示条 */
.qh-expand-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f0fdfa, #eff6ff);
  border: 1px solid #bae6fd;
  border-radius: var(--r-m);
  padding: 12px 18px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--lake-deep);
  cursor: pointer;
  transition: all .2s;
}
.qh-expand-bar:hover { box-shadow: var(--shadow-m); }
.qh-expand-bar b { color: var(--lake); }
.qh-expand-bar .qh-fc-btn { background: var(--grad-main); color: #fff; font-size: 13px; padding: 6px 14px; border: none; border-radius: var(--r-s); cursor: pointer; }

body.qh-expanded .qh-expand-bar {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #6b7280;
}
body.qh-expanded .qh-expand-bar .qh-fc-btn { background: #9ca3af; }
.qh-sc-header {
  text-align: center;
  padding: 36px 20px 32px;
  background: var(--grad-main);
  color: #fff;
  border-radius: var(--r-l);
  margin-bottom: 24px;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}
.qh-sc-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 200px at 80% 0%, rgba(255,255,255,.18), transparent 60%);
  pointer-events: none;
}
.qh-sc-header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  position: relative;
}
.qh-sc-header p {
  margin: 10px 0 0;
  font-size: 14px;
  opacity: .9;
  position: relative;
}
.qh-sc-section {
  background: #fff;
  border-radius: var(--r-m);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-s);
  border: 1px solid var(--line-soft);
  transition: box-shadow .2s, transform .2s;
}
.qh-sc-section:hover {
  box-shadow: var(--shadow-m);
  transform: translateY(-1px);
}
.qh-sc-section h2 {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.qh-sc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.qh-sc-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 768px) {
  .qh-sc-grid-2, .qh-sc-grid-3 { grid-template-columns: 1fr; }
}

/* ---------- 功能入口卡片 ---------- */
.qh-feature-entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.qh-feat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--r-m);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.qh-feat-card:hover {
  border-color: var(--lake);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.15);
}
.qh-feat-emoji { font-size: 32px; margin-bottom: 6px; }
.qh-feat-name { font-size: 13px; font-weight: 600; color: #1f2937; }
.qh-feat-desc { font-size: 11px; color: #9ca3af; margin-top: 2px; }
