/* ============================================
   拍题讲解 - 单题
   ============================================ */

*[hidden] { display: none !important; }

.solve-page {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--background);
  padding-bottom: calc(176px + env(safe-area-inset-bottom, 0px));
  position: relative;
}

.solve-page :focus-visible {
  outline: 2px solid #7C3AED;
  outline-offset: 2px;
}

/* ===== 顶部导航 ===== */
.solve-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.solve-nav-inner {
  max-width: 430px;
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  padding-top: env(safe-area-inset-top, 0px);
}
.nav-icon-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 12px;
  background: var(--background);
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, background 0.15s;
}
.nav-icon-btn:active { transform: scale(0.94); }
.nav-icon-btn:hover { background: var(--primary); }
.nav-icon-btn svg { width: 20px; height: 20px; }
.solve-nav-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}
.nav-spacer { width: 38px; flex: 0 0 38px; }

/* ===== 页面主体 ===== */
.solve-main {
  padding: 14px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== 题目卡片 ===== */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.question-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.question-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--primary);
  border-radius: 999px;
  padding: 3px 10px;
  letter-spacing: 0.3px;
}
.question-chips {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.q-chip {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 8px;
}
.question-text {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.75;
  letter-spacing: 0.2px;
  color: var(--text-primary);
}
.question-extra { padding-top: 12px; }
.question-photo {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 1.5px dashed #C7C2DE;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(14, 165, 233, 0.06)),
    var(--background);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.3px;
}
.question-photo svg { width: 26px; height: 26px; opacity: 0.6; }
.question-photo small { font-size: 10.5px; opacity: 0.75; }
.question-toggle {
  margin-top: 12px;
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 11px;
  background: var(--background);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.question-toggle:active { background: var(--primary); }
.question-toggle svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s;
}
.question-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ===== AI 回答卡片 ===== */
.answer-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 14px 6px;
  box-shadow: var(--shadow);
}
.answer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ai-mark {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ai-mark svg { width: 14px; height: 14px; }
.answer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.answer-step {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #047857;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 999px;
  padding: 1px 7px;
}
.answer-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 6px;
}
.answer-head-spacer { flex: 1; }
.more-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.more-btn:active { background: var(--background); }
.more-menu {
  position: absolute;
  top: 44px;
  right: 10px;
  z-index: 30;
  min-width: 196px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
}
.more-menu button {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  text-align: left;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
}
.more-menu button:hover { background: var(--background); }

.answer-content p {
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.answer-content p:last-child { margin-bottom: 0; }

/* 生成中 */
.answer-loading { padding: 4px 0 10px; }
.skl {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #F1F0F7 25%, #E9E7F3 37%, #F1F0F7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
}
.skl.w90 { width: 90%; }
.skl.w75 { width: 75%; }
.skl.w60 { width: 60%; }
.loading-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}

/* 生成失败 */
.answer-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
}
.error-mark {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  background: #FEE2E2;
  color: #DC2626;
  font-size: 13px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.error-copy { flex: 1; min-width: 0; }
.error-title {
  font-size: 13px;
  font-weight: 700;
  color: #B91C1C;
}
.error-sub {
  font-size: 11px;
  color: #B91C1C;
  opacity: 0.7;
  margin-top: 2px;
}
.retry-inline {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #FCA5A5;
  border-radius: 10px;
  background: #fff;
  color: #DC2626;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.retry-inline:active { transform: scale(0.96); }

/* 朗读进度 */
.read-progress {
  height: 38px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding-bottom: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.read-progress.is-visible { opacity: 1; }
.progress-track {
  height: 4px;
  border-radius: 999px;
  background: #EEEDF5;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7C3AED, #A855F7);
  transition: width 0.2s linear;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* 回答操作区 */
.answer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid #F5F3FA;
}
.actions-spacer { flex: 1; }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: var(--background);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.12s;
}
.action-btn:active:not(:disabled) { transform: scale(0.96); }
.action-btn.primary {
  background: var(--primary);
  color: var(--accent-dark);
}
.action-btn:disabled { opacity: 0.5; cursor: default; }
.action-btn.icon-only {
  width: 44px;
  flex: 0 0 44px;
  justify-content: center;
  padding: 0;
}
.action-btn svg { width: 17px; height: 17px; flex: 0 0 17px; }
.action-btn .i-pause { display: none; }
.action-btn[data-play-status="playing"] .i-play { display: none; }
.action-btn[data-play-status="playing"] .i-pause { display: block; }

.vote-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-placeholder);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.vote-btn svg { width: 19px; height: 19px; }
.vote-btn:active:not(:disabled) { transform: scale(0.9); }
.vote-btn:disabled { opacity: 0.45; cursor: default; }
.vote-btn[data-like].is-active { background: #ECFDF5; color: #059669; }
.vote-btn[data-dislike].is-active { background: #FEF2F2; color: #DC2626; }

