TopicDiscussionConfig.vue 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054
  1. <template>
  2. <div class="topic-discussion-config">
  3. <!-- 滚动内容区域 -->
  4. <div class="config-scroll">
  5. <!-- 主配置卡片 -->
  6. <div class="config-card">
  7. <!-- 1. 讨论话题 -->
  8. <div class="form-group">
  9. <label class="form-label">{{ lang.ssDiscussionTopic }}</label>
  10. <input
  11. type="text"
  12. :value="store.config.topic"
  13. @input="store.updateTopic(($event.target as HTMLInputElement).value)"
  14. class="form-input"
  15. :placeholder="lang.ssEnterTopic as string"
  16. />
  17. </div>
  18. <!-- 2. 学习目标 -->
  19. <div class="form-group">
  20. <button class="section-toggle" @click="learningGoalsExpanded = !learningGoalsExpanded">
  21. <span class="section-toggle-label">{{ lang.ssLearningGoals }}</span>
  22. <svg
  23. class="section-toggle-arrow"
  24. :class="{ collapsed: !learningGoalsExpanded }"
  25. width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
  26. >
  27. <path d="M6 9l6 6 6-6" />
  28. </svg>
  29. </button>
  30. <div v-if="learningGoalsExpanded" class="learning-goals-body">
  31. <!-- 练习词汇 -->
  32. <div class="sub-section">
  33. <div class="sub-section-header">
  34. <span class="sub-label">{{ lang.ssPracticeVocabulary }}</span>
  35. <div v-if="!isAddingVocab" class="sub-actions">
  36. <button class="icon-btn" @click="isAddingVocab = true" title="添加词汇">
  37. <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
  38. <line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" />
  39. </svg>
  40. </button>
  41. <button class="icon-btn" @click="showBatchPaste = true" :title="lang.ssBatchPaste as string">
  42. <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
  43. <path d="M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" />
  44. <rect x="8" y="2" width="8" height="4" rx="1" ry="1" />
  45. </svg>
  46. </button>
  47. </div>
  48. </div>
  49. <div class="vocab-tags">
  50. <span
  51. v-for="(word, index) in store.config.learningGoals.vocabulary"
  52. :key="index"
  53. class="vocab-tag"
  54. >
  55. {{ word }}
  56. <button class="tag-remove" @click="store.removeVocabulary(index)">
  57. <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
  58. <line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
  59. </svg>
  60. </button>
  61. </span>
  62. <input
  63. v-if="isAddingVocab"
  64. ref="vocabInputRef"
  65. v-model="newVocab"
  66. class="vocab-inline-input"
  67. :placeholder="lang.ssAddWord as string"
  68. @keydown.enter="handleAddVocab"
  69. @keydown.escape="cancelAddVocab"
  70. @blur="handleAddVocabBlur"
  71. />
  72. </div>
  73. </div>
  74. <!-- 练习句型 -->
  75. <div class="sub-section">
  76. <div class="sub-section-header">
  77. <span class="sub-label">{{ lang.ssPracticeSentences }}</span>
  78. <div v-if="!isAddingSentence" class="sub-actions">
  79. <button class="icon-btn" @click="isAddingSentence = true" title="添加句型">
  80. <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
  81. <line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" />
  82. </svg>
  83. </button>
  84. <button class="icon-btn" @click="showBatchPaste = true" :title="lang.ssBatchPaste as string">
  85. <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
  86. <path d="M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" />
  87. <rect x="8" y="2" width="8" height="4" rx="1" ry="1" />
  88. </svg>
  89. </button>
  90. </div>
  91. </div>
  92. <div class="sentence-list">
  93. <div
  94. v-for="(sentence, index) in store.config.learningGoals.sentences"
  95. :key="index"
  96. >
  97. <!-- 编辑模式 -->
  98. <input
  99. v-if="editingSentenceIndex === index"
  100. v-model="editingSentenceValue"
  101. class="sentence-edit-input"
  102. @keydown.enter="handleSaveEditSentence"
  103. @keydown.escape="cancelEditSentence"
  104. @blur="handleSaveEditSentenceBlur"
  105. />
  106. <!-- 展示模式 -->
  107. <div v-else class="sentence-item" @dblclick="handleEditSentence(index)">
  108. <span class="sentence-text">{{ sentence }}</span>
  109. <button class="sentence-remove" @click="store.removeSentence(index)">
  110. <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
  111. <line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
  112. </svg>
  113. </button>
  114. </div>
  115. </div>
  116. <input
  117. v-if="isAddingSentence"
  118. ref="sentenceInputRef"
  119. v-model="newSentence"
  120. class="sentence-edit-input"
  121. :placeholder="lang.ssAddSentence as string"
  122. @keydown.enter="handleAddSentence"
  123. @keydown.escape="cancelAddSentence"
  124. @blur="handleAddSentenceBlur"
  125. />
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. <!-- 分割线 -->
  131. <div class="config-divider"></div>
  132. <!-- 3. 练习方式 -->
  133. <div class="form-group">
  134. <label class="sub-label">{{ lang.ssPracticeMode }}</label>
  135. <div class="mode-tabs">
  136. <button
  137. class="mode-tab"
  138. :class="{ active: store.config.practice.mode === 'time' }"
  139. @click="store.updatePracticeMode('time')"
  140. >
  141. {{ lang.ssTimeLimit }}
  142. </button>
  143. <button
  144. class="mode-tab"
  145. :class="{ active: store.config.practice.mode === 'rounds' }"
  146. @click="store.updatePracticeMode('rounds')"
  147. >
  148. {{ lang.ssRoundLimit }}
  149. </button>
  150. </div>
  151. </div>
  152. <!-- 滑块 -->
  153. <div class="form-group slider-group">
  154. <template v-if="store.config.practice.mode === 'time'">
  155. <input
  156. type="range"
  157. :value="store.config.practice.duration"
  158. min="1" max="60" step="1"
  159. class="config-slider"
  160. @input="store.updateDuration(Number(($event.target as HTMLInputElement).value))"
  161. />
  162. <div class="slider-labels">
  163. <span class="slider-min">1 {{ lang.ssMinute }}</span>
  164. <span class="slider-value">{{ store.config.practice.duration }} {{ lang.ssMinute }}</span>
  165. <span class="slider-max">60 {{ lang.ssMinute }}</span>
  166. </div>
  167. </template>
  168. <template v-else>
  169. <input
  170. type="range"
  171. :value="store.config.practice.rounds"
  172. min="1" max="60" step="1"
  173. class="config-slider"
  174. @input="store.updateRounds(Number(($event.target as HTMLInputElement).value))"
  175. />
  176. <div class="slider-labels">
  177. <span class="slider-min">1 {{ lang.ssRound }}</span>
  178. <span class="slider-value">{{ store.config.practice.rounds }} {{ lang.ssRound }}</span>
  179. <span class="slider-max">60 {{ lang.ssRound }}</span>
  180. </div>
  181. </template>
  182. </div>
  183. <!-- 展示学习报告 -->
  184. <div class="toggle-row">
  185. <span class="toggle-label">{{ lang.ssShowReport }}</span>
  186. <button
  187. class="toggle-switch"
  188. :class="{ on: store.config.evaluation.showReport }"
  189. @click="store.toggleShowReport()"
  190. >
  191. <span class="toggle-knob"></span>
  192. </button>
  193. </div>
  194. </div>
  195. <!-- 分割线 -->
  196. <div class="section-spacer"></div>
  197. <!-- 4. 高级配置 -->
  198. <div class="advanced-section">
  199. <button class="section-toggle" @click="advancedExpanded = !advancedExpanded">
  200. <span class="section-toggle-label">{{ lang.ssAdvancedConfig }}</span>
  201. <svg
  202. class="section-toggle-arrow"
  203. :class="{ collapsed: !advancedExpanded }"
  204. width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
  205. >
  206. <path d="M6 9l6 6 6-6" />
  207. </svg>
  208. </button>
  209. <div v-if="advancedExpanded" class="advanced-body">
  210. <!-- 辅助功能 -->
  211. <div class="config-card sub-card">
  212. <div class="sub-card-title">{{ lang.ssAssistance }}</div>
  213. <div class="checkbox-group">
  214. <label class="checkbox-item">
  215. <input type="checkbox" :checked="store.config.practice.showEnglish" @change="store.togglePracticeSetting('showEnglish')" />
  216. <span>{{ lang.ssShowEnglish }}</span>
  217. </label>
  218. <label class="checkbox-item">
  219. <input type="checkbox" :checked="store.config.practice.taskHint" @change="store.togglePracticeSetting('taskHint')" />
  220. <span>{{ lang.ssTaskHint }}</span>
  221. </label>
  222. <label class="checkbox-item">
  223. <input type="checkbox" :checked="store.config.practice.stutterHint" @change="store.togglePracticeSetting('stutterHint')" />
  224. <span>{{ lang.ssStutterHint }}</span>
  225. </label>
  226. </div>
  227. </div>
  228. <!-- 评估详情 -->
  229. <div class="config-card sub-card">
  230. <div class="sub-card-title">{{ lang.ssEvalDetails }}</div>
  231. <!-- 评估维度 -->
  232. <div class="eval-group">
  233. <div class="sub-label">{{ lang.ssEvalDimensions }}</div>
  234. <div class="checkbox-group">
  235. <label class="checkbox-item">
  236. <input type="checkbox" :checked="store.config.evaluation.dimensions.accuracy" @change="store.toggleEvalDimension('accuracy')" />
  237. <span>{{ lang.ssAccuracy }}</span>
  238. </label>
  239. <label class="checkbox-item">
  240. <input type="checkbox" :checked="store.config.evaluation.dimensions.fluency" @change="store.toggleEvalDimension('fluency')" />
  241. <span>{{ lang.ssFluency }}</span>
  242. </label>
  243. <label class="checkbox-item">
  244. <input type="checkbox" :checked="store.config.evaluation.dimensions.completeness" @change="store.toggleEvalDimension('completeness')" />
  245. <span>{{ lang.ssCompleteness }}</span>
  246. </label>
  247. <label class="checkbox-item">
  248. <input type="checkbox" :checked="store.config.evaluation.dimensions.rhythm" @change="store.toggleEvalDimension('rhythm')" />
  249. <span>{{ lang.ssRhythm }}</span>
  250. </label>
  251. </div>
  252. </div>
  253. <!-- 评分方式 -->
  254. <div class="eval-group">
  255. <div class="sub-label">{{ lang.ssScoreMode }}</div>
  256. <div class="radio-group">
  257. <label class="radio-item" @click="store.updateScoreMode('letter')">
  258. <span class="radio-circle" :class="{ active: store.config.evaluation.scoreMode === 'letter' }">
  259. <span v-if="store.config.evaluation.scoreMode === 'letter'" class="radio-dot"></span>
  260. </span>
  261. <span>{{ lang.ssLetterScore }}</span>
  262. </label>
  263. <label class="radio-item" @click="store.updateScoreMode('numeric')">
  264. <span class="radio-circle" :class="{ active: store.config.evaluation.scoreMode === 'numeric' }">
  265. <span v-if="store.config.evaluation.scoreMode === 'numeric'" class="radio-dot"></span>
  266. </span>
  267. <span>{{ lang.ssNumericScore }}</span>
  268. </label>
  269. <label class="radio-item" @click="store.updateScoreMode('comment_only')">
  270. <span class="radio-circle" :class="{ active: store.config.evaluation.scoreMode === 'comment_only' }">
  271. <span v-if="store.config.evaluation.scoreMode === 'comment_only'" class="radio-dot"></span>
  272. </span>
  273. <span>{{ lang.ssCommentOnly }}</span>
  274. </label>
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. </div>
  280. <!-- 底部留白 -->
  281. <div class="bottom-spacer"></div>
  282. </div>
  283. <!-- 底部操作栏 -->
  284. <div class="config-footer">
  285. <button class="btn-apply" @click="handleApply">
  286. {{ lang.ssApplyConfig }}
  287. </button>
  288. </div>
  289. <!-- 批量粘贴弹窗 -->
  290. <div v-if="showBatchPaste" class="batch-paste-overlay" @click.self="showBatchPaste = false">
  291. <div class="batch-paste-dialog">
  292. <h3 class="dialog-title">{{ lang.ssBatchPasteTitle }}</h3>
  293. <div class="dialog-body">
  294. <div class="dialog-field">
  295. <label class="dialog-label">{{ lang.ssBatchPasteVocab }}</label>
  296. <textarea v-model="batchVocab" class="dialog-textarea" rows="4"></textarea>
  297. </div>
  298. <div class="dialog-field">
  299. <label class="dialog-label">{{ lang.ssBatchPasteSentences }}</label>
  300. <textarea v-model="batchSentences" class="dialog-textarea" rows="4"></textarea>
  301. </div>
  302. </div>
  303. <div class="dialog-footer">
  304. <button class="btn-cancel" @click="showBatchPaste = false">{{ lang.ssCancel }}</button>
  305. <button class="btn-confirm" @click="handleBatchPasteConfirm">{{ lang.ssConfirm }}</button>
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. </template>
  311. <script lang="ts" setup>
  312. import { ref, nextTick } from 'vue'
  313. import { lang } from '@/main'
  314. import { useSpeakingStore } from '@/store/speaking'
  315. import useCreateElement from '@/hooks/useCreateElement'
  316. const emit = defineEmits<{
  317. (e: 'back'): void
  318. }>()
  319. const store = useSpeakingStore()
  320. // UI 状态
  321. const learningGoalsExpanded = ref(true)
  322. const advancedExpanded = ref(false)
  323. // 词汇新增
  324. const isAddingVocab = ref(false)
  325. const newVocab = ref('')
  326. const vocabInputRef = ref<HTMLInputElement | null>(null)
  327. // 句型新增 / 编辑
  328. const isAddingSentence = ref(false)
  329. const newSentence = ref('')
  330. const sentenceInputRef = ref<HTMLInputElement | null>(null)
  331. const editingSentenceIndex = ref<number | null>(null)
  332. const editingSentenceValue = ref('')
  333. // 批量粘贴
  334. const showBatchPaste = ref(false)
  335. const batchVocab = ref('')
  336. const batchSentences = ref('')
  337. // 词汇操作
  338. const handleAddVocab = () => {
  339. if (newVocab.value.trim()) {
  340. store.addVocabulary(newVocab.value.trim())
  341. newVocab.value = ''
  342. }
  343. }
  344. const handleAddVocabBlur = () => {
  345. if (newVocab.value.trim()) {
  346. handleAddVocab()
  347. }
  348. isAddingVocab.value = false
  349. }
  350. const cancelAddVocab = () => {
  351. isAddingVocab.value = false
  352. newVocab.value = ''
  353. }
  354. // 句型操作
  355. const handleAddSentence = () => {
  356. if (newSentence.value.trim()) {
  357. store.addSentence(newSentence.value.trim())
  358. newSentence.value = ''
  359. }
  360. }
  361. const handleAddSentenceBlur = () => {
  362. if (newSentence.value.trim()) {
  363. handleAddSentence()
  364. }
  365. isAddingSentence.value = false
  366. }
  367. const cancelAddSentence = () => {
  368. isAddingSentence.value = false
  369. newSentence.value = ''
  370. }
  371. const handleEditSentence = (index: number) => {
  372. editingSentenceIndex.value = index
  373. editingSentenceValue.value = store.config.learningGoals.sentences[index]
  374. }
  375. const handleSaveEditSentence = () => {
  376. if (editingSentenceIndex.value !== null && editingSentenceValue.value.trim()) {
  377. store.updateSentence(editingSentenceIndex.value, editingSentenceValue.value.trim())
  378. editingSentenceIndex.value = null
  379. editingSentenceValue.value = ''
  380. }
  381. }
  382. const handleSaveEditSentenceBlur = () => {
  383. if (editingSentenceValue.value.trim()) {
  384. handleSaveEditSentence()
  385. } else {
  386. cancelEditSentence()
  387. }
  388. }
  389. const cancelEditSentence = () => {
  390. editingSentenceIndex.value = null
  391. editingSentenceValue.value = ''
  392. }
  393. // 批量粘贴
  394. const handleBatchPasteConfirm = () => {
  395. const vocabItems = batchVocab.value.split('\n').map(s => s.trim()).filter(Boolean)
  396. const sentenceItems = batchSentences.value.split('\n').map(s => s.trim()).filter(Boolean)
  397. vocabItems.forEach(item => store.addVocabulary(item))
  398. sentenceItems.forEach(item => store.addSentence(item))
  399. batchVocab.value = ''
  400. batchSentences.value = ''
  401. showBatchPaste.value = false
  402. }
  403. // 应用配置 → 往画布添加预览元素
  404. const { createFrameElement } = useCreateElement()
  405. const handleApply = () => {
  406. createFrameElement('', 77)
  407. }
  408. </script>
  409. <style lang="scss" scoped>
  410. .topic-discussion-config {
  411. display: flex;
  412. flex-direction: column;
  413. height: 100%;
  414. }
  415. .config-scroll {
  416. flex: 1;
  417. overflow-y: auto;
  418. padding: 16px;
  419. }
  420. // 配置卡片
  421. .config-card {
  422. background: #fff;
  423. border: 1px solid #e5e7eb;
  424. border-radius: 12px;
  425. padding: 16px;
  426. }
  427. .config-divider {
  428. height: 1px;
  429. background: #f3f4f6;
  430. margin: 16px 0;
  431. }
  432. .section-spacer {
  433. height: 1px;
  434. background: #f3f4f6;
  435. margin: 16px 0;
  436. }
  437. .bottom-spacer {
  438. height: 24px;
  439. }
  440. // 表单元素
  441. .form-group {
  442. margin-bottom: 12px;
  443. &:last-child {
  444. margin-bottom: 0;
  445. }
  446. }
  447. .form-label {
  448. display: block;
  449. font-size: 12px;
  450. font-weight: 600;
  451. color: #374151;
  452. margin-bottom: 6px;
  453. }
  454. .form-input {
  455. width: 100%;
  456. height: 36px;
  457. padding: 0 12px;
  458. border: 1px solid #e5e7eb;
  459. border-radius: 8px;
  460. font-size: 13px;
  461. color: #374151;
  462. background: #fff;
  463. transition: all 0.2s;
  464. box-sizing: border-box;
  465. &:focus {
  466. outline: none;
  467. border-color: #f97316;
  468. }
  469. &::placeholder {
  470. color: #9ca3af;
  471. }
  472. }
  473. // 折叠切换
  474. .section-toggle {
  475. width: 100%;
  476. display: flex;
  477. align-items: center;
  478. justify-content: space-between;
  479. padding: 4px 0;
  480. background: none;
  481. border: none;
  482. cursor: pointer;
  483. transition: color 0.2s;
  484. &:hover {
  485. .section-toggle-label {
  486. color: #111827;
  487. }
  488. }
  489. }
  490. .section-toggle-label {
  491. font-size: 12px;
  492. font-weight: 600;
  493. color: #374151;
  494. }
  495. .section-toggle-arrow {
  496. color: #9ca3af;
  497. transition: transform 0.2s;
  498. &.collapsed {
  499. transform: rotate(-90deg);
  500. }
  501. }
  502. // 学习目标
  503. .learning-goals-body {
  504. margin-top: 12px;
  505. display: flex;
  506. flex-direction: column;
  507. gap: 12px;
  508. }
  509. .sub-section {
  510. display: flex;
  511. flex-direction: column;
  512. gap: 6px;
  513. }
  514. .sub-section-header {
  515. display: flex;
  516. align-items: center;
  517. justify-content: space-between;
  518. }
  519. .sub-label {
  520. font-size: 12px;
  521. color: #6b7280;
  522. }
  523. .sub-actions {
  524. display: flex;
  525. gap: 6px;
  526. }
  527. .icon-btn {
  528. width: 24px;
  529. height: 24px;
  530. display: flex;
  531. align-items: center;
  532. justify-content: center;
  533. border: 1px dashed #d1d5db;
  534. border-radius: 4px;
  535. background: none;
  536. color: #9ca3af;
  537. cursor: pointer;
  538. transition: all 0.2s;
  539. &:hover {
  540. border-color: #f97316;
  541. color: #f97316;
  542. background: #fff7ed;
  543. }
  544. }
  545. // 词汇标签
  546. .vocab-tags {
  547. display: flex;
  548. flex-wrap: wrap;
  549. gap: 6px;
  550. }
  551. .vocab-tag {
  552. display: inline-flex;
  553. align-items: center;
  554. gap: 4px;
  555. padding: 4px 10px;
  556. background: #f9fafb;
  557. border-radius: 6px;
  558. font-size: 12px;
  559. color: #374151;
  560. transition: background 0.2s;
  561. &:hover {
  562. background: #f3f4f6;
  563. .tag-remove {
  564. opacity: 1;
  565. }
  566. }
  567. }
  568. .tag-remove {
  569. display: flex;
  570. background: none;
  571. border: none;
  572. padding: 0;
  573. color: #9ca3af;
  574. cursor: pointer;
  575. opacity: 0;
  576. transition: all 0.2s;
  577. &:hover {
  578. color: #6b7280;
  579. }
  580. }
  581. .vocab-inline-input {
  582. padding: 4px 10px;
  583. border: 1px solid #d1d5db;
  584. border-radius: 6px;
  585. font-size: 12px;
  586. color: #374151;
  587. width: 96px;
  588. &:focus {
  589. outline: none;
  590. border-color: #9ca3af;
  591. }
  592. }
  593. // 句型列表
  594. .sentence-list {
  595. display: flex;
  596. flex-direction: column;
  597. gap: 6px;
  598. }
  599. .sentence-item {
  600. display: flex;
  601. align-items: center;
  602. justify-content: space-between;
  603. padding: 6px 10px;
  604. background: #f9fafb;
  605. border-radius: 8px;
  606. cursor: pointer;
  607. transition: background 0.2s;
  608. &:hover {
  609. background: #f3f4f6;
  610. .sentence-remove {
  611. opacity: 1;
  612. }
  613. }
  614. }
  615. .sentence-text {
  616. font-size: 12px;
  617. color: #374151;
  618. }
  619. .sentence-remove {
  620. display: flex;
  621. background: none;
  622. border: none;
  623. padding: 0;
  624. color: #9ca3af;
  625. cursor: pointer;
  626. opacity: 0;
  627. transition: all 0.2s;
  628. &:hover {
  629. color: #6b7280;
  630. }
  631. }
  632. .sentence-edit-input {
  633. width: 100%;
  634. padding: 6px 10px;
  635. border: 1px solid #d1d5db;
  636. border-radius: 8px;
  637. font-size: 12px;
  638. color: #374151;
  639. box-sizing: border-box;
  640. &:focus {
  641. outline: none;
  642. border-color: #9ca3af;
  643. }
  644. }
  645. // 练习方式 Tab
  646. .mode-tabs {
  647. display: flex;
  648. gap: 8px;
  649. }
  650. .mode-tab {
  651. flex: 1;
  652. height: 32px;
  653. border-radius: 8px;
  654. border: none;
  655. font-size: 13px;
  656. font-weight: 500;
  657. cursor: pointer;
  658. transition: all 0.2s;
  659. background: #f9fafb;
  660. color: #4b5563;
  661. &:hover:not(.active) {
  662. background: #f3f4f6;
  663. }
  664. &.active {
  665. background: #f97316;
  666. color: #fff;
  667. }
  668. }
  669. // 滑块
  670. .slider-group {
  671. margin-top: 4px;
  672. }
  673. .config-slider {
  674. width: 100%;
  675. height: 6px;
  676. border-radius: 3px;
  677. appearance: none;
  678. background: #e5e7eb;
  679. cursor: pointer;
  680. accent-color: #f97316;
  681. &::-webkit-slider-thumb {
  682. appearance: none;
  683. width: 16px;
  684. height: 16px;
  685. border-radius: 50%;
  686. background: #f97316;
  687. cursor: pointer;
  688. border: 2px solid #fff;
  689. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  690. }
  691. }
  692. .slider-labels {
  693. display: flex;
  694. justify-content: space-between;
  695. align-items: center;
  696. margin-top: 6px;
  697. font-size: 12px;
  698. }
  699. .slider-min, .slider-max {
  700. color: #9ca3af;
  701. }
  702. .slider-value {
  703. font-weight: 500;
  704. color: #374151;
  705. }
  706. // Toggle 开关
  707. .toggle-row {
  708. display: flex;
  709. align-items: center;
  710. justify-content: space-between;
  711. margin-top: 12px;
  712. }
  713. .toggle-label {
  714. font-size: 12px;
  715. color: #4b5563;
  716. }
  717. .toggle-switch {
  718. position: relative;
  719. width: 44px;
  720. height: 24px;
  721. border-radius: 12px;
  722. border: none;
  723. cursor: pointer;
  724. transition: background 0.2s;
  725. background: #d1d5db;
  726. &.on {
  727. background: #f97316;
  728. .toggle-knob {
  729. left: 22px;
  730. }
  731. }
  732. }
  733. .toggle-knob {
  734. position: absolute;
  735. top: 4px;
  736. left: 4px;
  737. width: 16px;
  738. height: 16px;
  739. border-radius: 50%;
  740. background: #fff;
  741. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  742. transition: left 0.2s;
  743. }
  744. // 高级配置
  745. .advanced-section {
  746. // 外层无需额外样式
  747. }
  748. .advanced-body {
  749. margin-top: 12px;
  750. display: flex;
  751. flex-direction: column;
  752. gap: 12px;
  753. }
  754. .sub-card {
  755. padding: 12px;
  756. }
  757. .sub-card-title {
  758. font-size: 12px;
  759. font-weight: 600;
  760. color: #374151;
  761. margin-bottom: 10px;
  762. }
  763. .checkbox-group {
  764. display: flex;
  765. flex-wrap: wrap;
  766. gap: 12px 16px;
  767. }
  768. .checkbox-item {
  769. display: flex;
  770. align-items: center;
  771. gap: 6px;
  772. cursor: pointer;
  773. font-size: 12px;
  774. color: #4b5563;
  775. input[type="checkbox"] {
  776. width: 14px;
  777. height: 14px;
  778. accent-color: #f97316;
  779. }
  780. }
  781. .eval-group {
  782. margin-top: 10px;
  783. }
  784. .radio-group {
  785. display: flex;
  786. flex-direction: column;
  787. gap: 4px;
  788. margin-top: 4px;
  789. }
  790. .radio-item {
  791. display: flex;
  792. align-items: center;
  793. gap: 8px;
  794. cursor: pointer;
  795. font-size: 12px;
  796. color: #374151;
  797. padding: 2px 0;
  798. user-select: none;
  799. }
  800. .radio-circle {
  801. width: 16px;
  802. height: 16px;
  803. border-radius: 50%;
  804. border: 2px solid #d1d5db;
  805. display: flex;
  806. align-items: center;
  807. justify-content: center;
  808. transition: border-color 0.2s;
  809. &.active {
  810. border-color: #f97316;
  811. }
  812. }
  813. .radio-dot {
  814. width: 8px;
  815. height: 8px;
  816. border-radius: 50%;
  817. background: #f97316;
  818. }
  819. // 底部操作栏
  820. .config-footer {
  821. border-top: 1px solid #f3f4f6;
  822. padding: 12px 16px;
  823. background: #fff;
  824. flex-shrink: 0;
  825. }
  826. .btn-apply {
  827. width: 100%;
  828. height: 36px;
  829. border: none;
  830. border-radius: 8px;
  831. background: #f97316;
  832. color: #fff;
  833. font-size: 13px;
  834. font-weight: 500;
  835. cursor: pointer;
  836. transition: background 0.2s;
  837. &:hover {
  838. background: #ea580c;
  839. }
  840. }
  841. // 批量粘贴弹窗
  842. .batch-paste-overlay {
  843. position: fixed;
  844. inset: 0;
  845. background: rgba(0, 0, 0, 0.3);
  846. display: flex;
  847. align-items: center;
  848. justify-content: center;
  849. z-index: 1000;
  850. }
  851. .batch-paste-dialog {
  852. width: 360px;
  853. background: #fff;
  854. border-radius: 16px;
  855. box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  856. overflow: hidden;
  857. }
  858. .dialog-title {
  859. font-size: 15px;
  860. font-weight: 600;
  861. color: #111827;
  862. padding: 16px 20px;
  863. border-bottom: 1px solid #f3f4f6;
  864. margin: 0;
  865. }
  866. .dialog-body {
  867. padding: 16px 20px;
  868. display: flex;
  869. flex-direction: column;
  870. gap: 12px;
  871. }
  872. .dialog-field {
  873. display: flex;
  874. flex-direction: column;
  875. gap: 6px;
  876. }
  877. .dialog-label {
  878. font-size: 12px;
  879. font-weight: 500;
  880. color: #374151;
  881. }
  882. .dialog-textarea {
  883. width: 100%;
  884. padding: 8px 12px;
  885. border: 1px solid #e5e7eb;
  886. border-radius: 8px;
  887. font-size: 13px;
  888. color: #374151;
  889. resize: vertical;
  890. font-family: inherit;
  891. box-sizing: border-box;
  892. &:focus {
  893. outline: none;
  894. border-color: #f97316;
  895. }
  896. }
  897. .dialog-footer {
  898. display: flex;
  899. justify-content: flex-end;
  900. gap: 8px;
  901. padding: 12px 20px;
  902. border-top: 1px solid #f3f4f6;
  903. }
  904. .btn-cancel {
  905. padding: 6px 16px;
  906. border: 1px solid #e5e7eb;
  907. border-radius: 8px;
  908. background: #fff;
  909. font-size: 13px;
  910. color: #4b5563;
  911. cursor: pointer;
  912. transition: all 0.2s;
  913. &:hover {
  914. background: #f9fafb;
  915. }
  916. }
  917. .btn-confirm {
  918. padding: 6px 16px;
  919. border: none;
  920. border-radius: 8px;
  921. background: #f97316;
  922. font-size: 13px;
  923. color: #fff;
  924. cursor: pointer;
  925. transition: all 0.2s;
  926. &:hover {
  927. background: #ea580c;
  928. }
  929. }
  930. </style>