/* ==================== 语感速成训练 - 多巴胺风格 ==================== */

.memory-workshop-page {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  background: linear-gradient(135deg, #fef3ff 0%, #f0f4ff 50%, #f0fff4 100%);
  font-family: 'Inter', 'Noto Sans SC', -apple-system, system-ui, sans-serif;
  position: relative;
}

/* 背景装饰 */
.memory-workshop-page::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(131, 56, 236, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.memory-workshop-page::after {
  content: '';
  position: fixed;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 214, 160, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* 顶部栏 */
.mem-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mem-back-btn {
  width: 80px;
  padding: 8px 16px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mem-back-btn:hover { background: rgba(0, 0, 0, 0.1); }

.mem-page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #8338EC, #FF4D6D, #FF9F1C);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ====== 词块组件 ====== */
.mem-word-block {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15), 0 6px 16px rgba(0, 0, 0, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.35);
  position: relative;
}

.mem-word-block.draggable {
  cursor: grab;
}
.mem-word-block.draggable:active {
  cursor: grabbing;
}

.mem-word-block.dragging {
  opacity: 0.6;
  transform: scale(1.08) rotate(3deg);
}

.mem-word-block:hover:not(.dragging) {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.15);
}

.mem-word-block.correct-flash {
  animation: mem-correct-pulse 0.4s ease;
}
@keyframes mem-correct-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.mem-word-block.shake {
  animation: mem-shake 0.4s ease;
}
@keyframes mem-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.mem-word-block.fly-in {
  animation: mem-fly-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes mem-fly-in {
  0% { opacity: 0; transform: translateY(20px) scale(0.8); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ====== 输入视图 ====== */
.mem-input-view {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  position: relative;
  z-index: 1;
}

.mem-input-card {
  background: white;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mem-input-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.mem-input-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #8338EC, #FF4D6D);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.mem-input-title {
  margin: 4px 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
}

.mem-input-subtitle {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

.mem-input-textarea {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}
.mem-input-textarea:focus {
  outline: none;
  border-color: #8338EC;
}

/* 三步引导 */
.mem-steps-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(131, 56, 236, 0.06), rgba(255, 77, 109, 0.06));
  border: 1px solid rgba(131, 56, 236, 0.15);
  border-radius: 14px;
}

.mem-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.mem-step-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8338EC, #FF4D6D);
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(131, 56, 236, 0.3);
}

.mem-step-text {
  min-width: 0;
}

.mem-step-label {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.3;
}

.mem-step-desc {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mem-step-arrow {
  color: #c4b5fd;
  font-size: 16px;
  font-weight: 700;
  padding: 0 4px;
  flex-shrink: 0;
}

/* 模式切换 */
.mem-mode-toggle-wrapper {
  margin-bottom: 18px;
}

.mem-mode-toggle-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mem-mode-toggle {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #f3f4f6;
  border-radius: 14px;
  padding: 4px;
  flex-wrap: nowrap;
}

.mem-mode-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  white-space: nowrap;
}
.mem-mode-btn:hover {
  color: #4b5563;
  background: rgba(255, 255, 255, 0.6);
}
.mem-mode-btn.active {
  background: white;
  color: #1f2937;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(131, 56, 236, 0.1);
  font-weight: 600;
}

.mem-mode-btn-icon {
  font-size: 15px;
  line-height: 1;
}

.mem-mode-btn-tag {
  font-size: 10px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #8338EC, #FF4D6D);
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 2px;
  letter-spacing: 0.5px;
}

.mem-mode-btn.active .mem-mode-btn-tag {
  display: none;
}

/* 输入分区 */
.mem-input-section {
  margin-bottom: 16px;
}

.mem-input-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  flex-wrap: wrap;
}

.mem-input-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
}

.mem-input-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: white;
}
.mem-input-lang.en {
  background: linear-gradient(135deg, #3A86FF, #2563eb);
}
.mem-input-lang.zh {
  background: linear-gradient(135deg, #FF4D6D, #e11d48);
}

.mem-input-tip {
  font-size: 12px;
  font-weight: 400;
  color: #9ca3af;
  margin-left: auto;
}

.mem-input-textarea.error {
  border-color: #fca5a5 !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
  animation: mem-input-shake 0.4s ease;
}

@keyframes mem-input-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.mem-input-translation {
  background: #fef7f7;
  border-color: #fecaca;
}
.mem-input-translation:focus {
  border-color: #FF4D6D !important;
  background: white;
}

/* 生成进度条 */
.mem-gen-progress {
  margin-top: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(131, 56, 236, 0.08), rgba(255, 77, 109, 0.08));
  border: 1px solid rgba(131, 56, 236, 0.2);
  border-radius: 12px;
}

.mem-gen-progress-label {
  font-size: 13px;
  color: #6b21a8;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mem-gen-progress-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.mem-gen-progress-bar {
  height: 6px;
  background: rgba(131, 56, 236, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

.mem-gen-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8338EC, #FF4D6D);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.mem-gen-progress-fill.indeterminate {
  width: 40% !important;
  animation: mem-progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes mem-progress-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* AI 分析进度 */
.mem-ai-progress {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(142, 68, 173, 0.08));
  border: 1px solid rgba(52, 152, 219, 0.25);
}

.mem-ai-progress .mem-gen-progress-label {
  color: #2980B9;
}

.mem-gen-progress-batch {
  font-size: 12px;
  opacity: 0.7;
  margin-left: 6px;
}

.mem-ai-current-sentence {
  font-size: 12px;
  color: #5D6D7E;
  margin: 6px 0 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.6);
  border-radius: 8px;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mem-gen-progress-fill.ai-fill {
  background: linear-gradient(90deg, #3498DB, #8E44AD);
}

.mem-ai-progress-hint {
  font-size: 11px;
  color: #7F8C8D;
  margin-top: 8px;
  text-align: center;
}

/* 空译文友好提示 */
.mem-fill-hint {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 4px;
  margin-bottom: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fcd34d;
  border-radius: 12px;
  animation: mem-fill-hint-in 0.3s ease;
}

@keyframes mem-fill-hint-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mem-fill-hint-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.mem-fill-hint-body {
  flex: 1;
  min-width: 0;
}

.mem-fill-hint-title {
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 4px;
}

.mem-fill-hint-desc {
  font-size: 12px;
  color: #a16207;
  line-height: 1.6;
}

.mem-fill-hint-desc strong {
  color: #92400e;
  font-weight: 600;
}

.mem-fill-hint-switch {
  flex-shrink: 0;
  padding: 6px 14px;
  border: none;
  background: #f59e0b;
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}
.mem-fill-hint-switch:hover {
  background: #d97706;
  transform: translateY(-1px);
}

.mem-error-msg {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 10px;
  font-size: 14px;
}

.mem-input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.mem-input-samples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mem-samples-label {
  font-size: 13px;
  color: #9ca3af;
}

.mem-fill-sample-btn {
  padding: 8px 18px;
  border: 2px dashed rgba(131, 56, 236, 0.4);
  background: #faf5ff;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  color: #7c3aed;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}
.mem-fill-sample-btn:hover {
  background: linear-gradient(135deg, #8338EC, #FF4D6D);
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(131, 56, 236, 0.3);
}

.mem-primary-btn {
  padding: 12px 28px;
  border: none;
  background: linear-gradient(135deg, #8338EC, #FF4D6D);
  color: white;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(131, 56, 236, 0.3);
}
.mem-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(131, 56, 236, 0.4);
}
.mem-primary-btn:active {
  transform: translateY(0);
}
.mem-primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.mem-btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

.mem-secondary-btn {
  padding: 12px 24px;
  border: 2px solid #e5e7eb;
  background: white;
  color: #374151;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mem-secondary-btn:hover {
  border-color: #8338EC;
  color: #8338EC;
}

.mem-ghost-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: #6b7280;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mem-ghost-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #374151;
}
.mem-ghost-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mem-outline-btn {
  padding: 10px 18px;
  border: 2px solid #e5e7eb;
  background: white;
  color: #374151;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mem-outline-btn:hover {
  border-color: #8338EC;
  color: #8338EC;
}

/* 历史记录 */
.mem-history-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}

.mem-history-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
}

.mem-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mem-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid #f3f4f6;
  background: #fafafa;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}
.mem-history-item:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.mem-history-item.due {
  border-color: rgba(255, 77, 109, 0.3);
  background: rgba(255, 77, 109, 0.05);
  animation: mem-pulse-bg 2s ease-in-out infinite;
}
@keyframes mem-pulse-bg {
  0%, 100% { background: rgba(255, 77, 109, 0.03); }
  50% { background: rgba(255, 77, 109, 0.08); }
}

.mem-history-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mem-review-badge {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #FF4D6D, #FF9F1C);
  padding: 3px 10px;
  border-radius: 20px;
  animation: mem-bounce-in 0.5s ease;
}

.mem-history-item-title {
  font-size: 14px;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.mem-history-item-date {
  font-size: 12px;
  color: #9ca3af;
  flex-shrink: 0;
}

/* ====== 编辑预览视图 ====== */
.mem-editing-view {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 120px;
  position: relative;
  z-index: 1;
}

.mem-editing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.mem-editing-header h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
}

.mem-edit-desc {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

.mem-difficulty-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  padding: 4px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
}

.mem-diff-label {
  font-size: 13px;
  color: #6b7280;
  margin-right: 4px;
  padding: 0 8px;
}

.mem-diff-btn {
  padding: 8px 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.mem-diff-btn.active {
  background: linear-gradient(135deg, #8338EC, #FF4D6D);
  color: white;
  box-shadow: 0 2px 8px rgba(131, 56, 236, 0.3);
}

/* 句数不一致警告 */
.mem-mismatch-warning {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 2px solid #fbbf24;
  border-radius: 16px;
  margin-bottom: 20px;
  animation: mem-mismatch-in 0.4s ease;
}

@keyframes mem-mismatch-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.mem-mismatch-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  animation: mem-mismatch-pulse 2s ease-in-out infinite;
}

@keyframes mem-mismatch-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.mem-mismatch-body {
  flex: 1;
  min-width: 0;
}

.mem-mismatch-title {
  font-size: 16px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 6px;
}

.mem-mismatch-desc {
  font-size: 13px;
  color: #a16207;
  line-height: 1.6;
}

.mem-mismatch-stats {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.mem-mismatch-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 14px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  min-width: 60px;
}

.mem-mismatch-stat-num {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.mem-mismatch-stat-label {
  font-size: 11px;
  color: #92400e;
  margin-top: 3px;
  font-weight: 500;
}

.mem-edit-sentences-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mem-edit-sentence-card {
  display: flex;
  gap: 16px;
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.mem-edit-sentence-num {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8338EC, #FF4D6D);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.mem-edit-sentence-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.mem-edit-original {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.5;
}

.mem-edit-translation {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  font-family: inherit;
  box-sizing: border-box;
}
.mem-edit-translation:focus {
  outline: none;
  border-color: #8338EC;
}

.mem-edit-chunks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mem-edit-chunk-item {
  display: flex;
  gap: 4px;
  align-items: center;
}

.mem-edit-chunk-text {
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  max-width: 200px;
}
.mem-edit-chunk-text:focus {
  outline: none;
  border-color: #8338EC;
}

.mem-edit-chunk-role {
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 12px;
  background: white;
  cursor: pointer;
}

.mem-editing-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 20;
}

/* ====== 练习视图 ====== */
.mem-practice-view {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 120px;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  box-sizing: border-box;
}

.mem-practice-progress-bar {
  position: sticky;
  top: 61px;
  z-index: 9;
  height: 4px;
  background: rgba(0, 0, 0, 0.05);
  margin: 0 -24px;
  overflow: hidden;
}

.mem-practice-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8338EC, #FF4D6D, #FF9F1C);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 0 4px 4px 0;
}

.mem-practice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.mem-practice-counter {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
}

.mem-practice-diff-tabs {
  display: flex;
  gap: 4px;
  background: white;
  padding: 4px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.mem-diff-tab {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.mem-diff-tab.active {
  background: linear-gradient(135deg, #8338EC, #FF4D6D);
  color: white;
}

/* 题目卡 */
.mem-question-card {
  background: white;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(131, 56, 236, 0.1);
}

.mem-question-label {
  font-size: 13px;
  font-weight: 600;
  color: #8338EC;
  margin-bottom: 8px;
}

.mem-question-text {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.5;
  margin: 0 0 16px;
}

.mem-question-empty {
  font-weight: 500;
  font-size: 16px;
  font-style: italic;
}

.mem-question-actions {
  display: flex;
  gap: 10px;
}

.mem-speak-btn, .mem-hint-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  background: rgba(107, 114, 128, 0.08);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 200ms ease;
}
.mem-speak-btn:hover, .mem-hint-btn:hover {
  background: #8338EC;
  color: white;
  border-color: #8338EC;
}

/* 拖拽区域 */
.mem-drop-area {
  margin-bottom: 16px;
}

.mem-drop-label {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
  padding: 0 4px;
}

.mem-drop-zone {
  min-height: 80px;
  border: 3px dashed #d1d5db;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.5);
}

.mem-drop-zone.drag-over {
  border-color: #8338EC;
  background: rgba(131, 56, 236, 0.05);
}

.sentence-zone {
  min-height: 100px;
  background: white;
  border-color: #e5e7eb;
  border-style: solid;
  border-width: 2px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
}

.pool-zone {
  background: rgba(255, 255, 255, 0.7);
  min-height: 120px;
}

.mem-placeholder {
  width: 100%;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
  margin: 20px 0;
}

/* 反馈 */
.mem-feedback {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  animation: mem-feedback-in 0.3s ease;
}
@keyframes mem-feedback-in {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.mem-feedback.correct {
  background: linear-gradient(135deg, rgba(6, 214, 160, 0.15), rgba(6, 214, 160, 0.05));
  color: #065f46;
  border: 1px solid rgba(6, 214, 160, 0.3);
}

.mem-feedback.wrong {
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.1), rgba(255, 77, 109, 0.03));
  color: #be123c;
  border: 1px solid rgba(255, 77, 109, 0.2);
}

.mem-pool-area {
  margin-bottom: 24px;
}

/* 答案揭示 */
.mem-answer-reveal {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(255, 159, 28, 0.1), rgba(255, 159, 28, 0.03));
  border: 1px solid rgba(255, 159, 28, 0.2);
  border-radius: 16px;
  margin-bottom: 16px;
  animation: mem-feedback-in 0.3s ease;
}

.mem-answer-label {
  font-size: 13px;
  font-weight: 600;
  color: #c2410c;
  margin-bottom: 10px;
}

.mem-answer-chunks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 底部操作区 */
.mem-practice-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 20;
  box-sizing: border-box;
}

/* ====== 结果视图 ====== */
.mem-result-view {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  position: relative;
  z-index: 1;
}

.mem-result-card {
  background: white;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.mem-result-header {
  margin-bottom: 28px;
}

.mem-result-emoji {
  font-size: 64px;
  margin-bottom: 12px;
  animation: mem-bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes mem-bounce-in {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.mem-result-card h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px;
}

.mem-result-subtitle {
  font-size: 15px;
  color: #6b7280;
  margin: 0;
}

.mem-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.mem-stat-item {
  padding: 20px 12px;
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
  border-radius: 16px;
}

.mem-stat-num {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1;
  margin-bottom: 6px;
}
.mem-stat-num.correct { color: #06D6A0; }
.mem-stat-num.wrong { color: #FF4D6D; }

.mem-stat-label {
  font-size: 13px;
  color: #6b7280;
}

.mem-wrong-list {
  text-align: left;
  margin-bottom: 28px;
}

.mem-wrong-title {
  font-size: 15px;
  font-weight: 600;
  color: #be123c;
  margin-bottom: 12px;
}

.mem-wrong-item {
  padding: 14px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  margin-bottom: 8px;
}

.mem-wrong-sentence {
  font-size: 14px;
  font-weight: 600;
  color: #881337;
  margin-bottom: 4px;
  line-height: 1.4;
}

.mem-wrong-translation {
  font-size: 13px;
  color: #9f1239;
  margin-bottom: 4px;
}

.mem-wrong-meta {
  font-size: 12px;
  color: #f472b6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mem-result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mem-result-actions .mem-primary-btn,
.mem-result-actions .mem-secondary-btn {
  width: 100%;
}

/* ====== 整篇复述视图 ====== */
.mem-recall-view {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 80px;
  position: relative;
  z-index: 1;
}

.mem-recall-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  background: linear-gradient(180deg, rgba(254, 243, 255, 0.98), rgba(254, 243, 255, 0.9));
  backdrop-filter: blur(8px);
}

.mem-recall-header h2 {
  flex: 1;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  text-align: center;
}

.mem-recall-mode-switch {
  display: flex;
  background: white;
  padding: 4px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.mem-recall-mode-switch .mem-mode-btn {
  padding: 8px 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.mem-recall-mode-switch .mem-mode-btn.active {
  background: linear-gradient(135deg, #8338EC, #FF4D6D);
  color: white;
}

.mem-recall-toolbar {
  display: flex;
  gap: 10px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.mem-recall-content {
  padding: 16px 0;
}

.mem-recall-sentence {
  padding: 20px;
  background: white;
  border-radius: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
}
.mem-recall-sentence:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.mem-recall-chunks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.mem-recall-blur-hint {
  width: 100%;
  padding: 12px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
  font-style: italic;
  background: #f9fafb;
  border-radius: 10px;
}

.mem-recall-translation {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

.mem-recall-sentence.chinese-mode {
  padding: 20px;
  cursor: default;
}

.mem-recall-cn-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mem-recall-cn {
  font-size: 18px;
  font-weight: 500;
  color: #1a1a2e;
  line-height: 1.6;
  flex: 1;
}

.mem-recall-toggle-btn {
  flex-shrink: 0;
  border: none;
  background: none;
  color: #8338EC;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
  border-radius: 6px;
  white-space: nowrap;
  margin-top: 2px;
}

.mem-recall-toggle-btn:hover {
  background: #f5f3ff;
  text-decoration: none;
}

.mem-recall-en {
  font-size: 15px;
  color: #065f46;
  padding: 12px 16px;
  background: #ecfdf5;
  border-radius: 10px;
  line-height: 1.5;
  margin-top: 12px;
  animation: mem-feedback-in 0.3s ease;
}

.mem-paragraph-break {
  height: 16px;
}

/* ====== 响应式 ====== */
@media (max-width: 768px) {
  .mem-input-card { padding: 20px; }
  .mem-input-title { font-size: 18px; }
  .mem-question-text { font-size: 18px; }
  .mem-stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mem-stat-num { font-size: 24px; }
  .mem-editing-footer { padding: 12px 16px; }
  .mem-practice-footer { padding: 12px 16px; }
  .mem-difficulty-selector { width: 100%; justify-content: center; }
  .mem-recall-header { flex-wrap: wrap; }
  .mem-recall-mode-switch { order: 3; width: 100%; justify-content: center; }
}

/* ===== 语块管理模态面板 ===== */
.chunk-manager-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: chunk-modal-fade 0.2s ease;
}

@keyframes chunk-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.chunk-manager-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  animation: chunk-modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chunk-modal-pop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.chunk-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: linear-gradient(135deg, #667eea10, #764ba210);
}

.chunk-manager-title {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1, #111);
}

.chunk-manager-subtitle {
  font-size: 13px;
  color: var(--text-3, #6b7280);
  font-weight: 500;
}

.chunk-manager-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-2, #f3f4f6);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2, #374151);
  transition: all 0.2s;
}
.chunk-manager-close:hover {
  background: var(--bg-3, #e5e7eb);
  transform: rotate(90deg);
}

.chunk-manager-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.chunk-manager-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-3, #6b7280);
  border-bottom: 2px solid transparent;
  font-family: inherit;
  transition: all 0.2s;
  margin-bottom: -1px;
}
.chunk-manager-tab.active {
  color: var(--adj, #667eea);
  border-bottom-color: var(--adj, #667eea);
}
.chunk-manager-tab:hover {
  color: var(--text-2, #374151);
}

.chunk-manager-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
}

.chunk-manager-empty {
  text-align: center;
  padding: 40px 20px;
}

.chunk-manager-group {
  margin-bottom: 20px;
}
.chunk-manager-group:last-child {
  margin-bottom: 0;
}

.chunk-manager-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2, #374151);
  margin-bottom: 8px;
  padding-left: 4px;
  letter-spacing: 0.3px;
}

.chunk-manager-chunk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chunk-card {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border, #e5e7eb);
  background: #fff;
  transition: all 0.2s ease;
}
.chunk-card.selected {
  border-color: #10b981;
  background: #ecfdf5;
}
.chunk-card.deselected {
  opacity: 0.55;
  background: #f9fafb;
}
.chunk-card:hover {
  transform: translateX(2px);
}

.chunk-card-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #10b981;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.15s;
}
.chunk-card.selected .chunk-card-checkbox {
  background: #10b981;
}

.chunk-card-content {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.chunk-card-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-1, #111);
  margin-bottom: 4px;
  word-break: break-word;
  font-family: 'Patrick Hand', cursive;
}

.chunk-card-meta {
  font-size: 11px;
  color: var(--text-3, #6b7280);
  font-weight: 500;
}

.chunk-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.chunk-card-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: var(--bg-2, #f3f4f6);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.chunk-card-action-btn:hover {
  background: var(--bg-3, #e5e7eb);
  transform: scale(1.1);
}
.chunk-card-action-btn.delete:hover {
  background: #fee2e2;
}

/* ===== 从课程导入 ===== */
.chunk-import-panel {
  display: flex;
  flex-direction: column;
}

.chunk-import-course-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.chunk-import-course-btn {
  padding: 6px 12px;
  border-radius: 16px;
  border: 1.5px solid var(--border, #e5e7eb);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-2, #374151);
  font-family: inherit;
  transition: all 0.2s;
}
.chunk-import-course-btn:hover {
  border-color: #667eea80;
}
.chunk-import-course-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-color: transparent;
  color: #fff;
}

.chunk-import-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.chunk-import-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border, #e5e7eb);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}
.chunk-import-item:hover {
  border-color: #667eea80;
}
.chunk-import-item.selected {
  border-color: #10b981;
  background: #ecfdf5;
}

.chunk-import-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid #10b981;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  flex-shrink: 0;
}
.chunk-import-item.selected .chunk-import-checkbox {
  background: #10b981;
}

.chunk-import-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-1, #111);
  font-family: 'Patrick Hand', cursive;
  word-break: break-word;
}

@media (max-width: 640px) {
  .chunk-manager-modal { max-height: 85vh; }
  .chunk-manager-header { padding: 16px 18px 12px; }
  .chunk-manager-body { padding: 12px 18px 18px; }
  .chunk-manager-tabs { padding: 10px 18px 0; }
  .chunk-manager-title { font-size: 17px; }
  .chunk-card-text { font-size: 13px; }
}
