/* Youther · 学习工坊 / 词汇自检 / 笔记本批处理 */
.ws-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ws-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .7fr);
  gap: 22px;
  padding: 26px;
  overflow: hidden;
  border-radius: calc(var(--radius-lg, 18px) + 6px);
  color: var(--primary-ink, #fff);
  background:
    radial-gradient(circle at 88% 12%, rgba(255,255,255,.24), transparent 26%),
    radial-gradient(circle at 12% 100%, rgba(255,255,255,.14), transparent 34%),
    linear-gradient(135deg, var(--primary, #0e7a5a), var(--accent, #12aecb));
  box-shadow: 0 18px 48px -26px rgba(14, 122, 90, .7);
}
.ws-hero::after {
  content: '';
  position: absolute;
  right: -48px;
  bottom: -88px;
  width: 250px;
  height: 250px;
  border: 34px solid rgba(255,255,255,.10);
  border-radius: 50%;
  pointer-events: none;
}
.ws-hero-main { position: relative; z-index: 1; min-width: 0; }
.ws-kicker {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}
.ws-hero h1 {
  margin: 12px 0 6px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.04;
  letter-spacing: -.035em;
}
.ws-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255,255,255,.88);
  font-size: 14px;
  line-height: 1.7;
}
.ws-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}
.ws-hero-chip {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 999px;
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.10);
  font-size: 12px;
  white-space: nowrap;
}
.ws-hero-chip:hover, .ws-hero-chip.on { color: var(--primary); background: #fff; text-decoration: none; }
.ws-hero-links { margin-top: 18px; }
.ws-hero .btn.soft, .ws-hero .btn.ghost {
  border-color: rgba(255,255,255,.38);
  color: #fff;
  background: rgba(255,255,255,.12);
}
.ws-hero .btn.soft:hover, .ws-hero .btn.ghost:hover { background: rgba(255,255,255,.22); }
.ws-hero-side {
  position: relative;
  z-index: 1;
  align-self: stretch;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 18px;
  background: rgba(255,255,255,.13);
  backdrop-filter: blur(8px);
}
.ws-hero-side-title { margin-bottom: 10px; font-size: 12px; font-weight: 700; opacity: .9; }
.ws-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ws-stat {
  padding: 11px;
  border-radius: 13px;
  background: rgba(255,255,255,.13);
}
.ws-stat b { display: block; font-size: 21px; line-height: 1.15; }
.ws-stat span { display: block; margin-top: 3px; font-size: 11px; opacity: .8; }
.ws-hero-side .tiny { color: rgba(255,255,255,.65); margin-top: 10px; }

.ws-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.ws-tab-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm, 0 2px 6px rgba(18,38,33,.08));
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.ws-tab-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow, 0 12px 28px -16px rgba(18,38,33,.34));
  text-decoration: none;
}
.ws-tab-card.active {
  border-color: transparent;
  color: var(--primary-ink, #fff);
  background: linear-gradient(135deg, var(--primary), var(--accent, var(--primary)));
  box-shadow: 0 14px 30px -20px var(--primary);
}
.ws-tab-icon {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 19px;
}
.ws-tab-card.active .ws-tab-icon { background: rgba(255,255,255,.18); }
.ws-tab-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ws-tab-copy b { font-size: 14px; }
.ws-tab-copy span {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 10.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-tab-card.active .ws-tab-copy span { color: rgba(255,255,255,.72); }
.ws-tab-arrow { opacity: .45; font-size: 17px; }
.ws-tab-card.active .ws-tab-arrow { opacity: .9; }

.ws-content { min-width: 0; }
.ws-panel { gap: 14px; }
.ws-controls { align-items: center; gap: 8px; }
.ws-submit-row { margin-top: 16px; }
.ws-submit-row .btn { min-width: 132px; }
.ws-photo-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
}
.ws-photo-preview img {
  width: 86px;
  height: 66px;
  border-radius: 9px;
  object-fit: cover;
}
.ws-loading, .ws-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px;
}
.ws-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ws-spin .8s linear infinite;
}
@keyframes ws-spin { to { transform: rotate(360deg); } }

.ws-result-head .tag { white-space: nowrap; }
.ws-question { padding: 15px; }
.ws-question-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.ws-number {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 9px;
  color: var(--primary);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 800;
}
.ws-qtag { color: var(--text-faint); font-size: 11px; }
.ws-question-text { font-size: 15px; line-height: 1.7; white-space: pre-wrap; }
.ws-answer { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 9px; }
.ws-answer summary { cursor: pointer; color: var(--primary); font-size: 12px; font-weight: 650; }
.ws-answer-row { display: flex; gap: 8px; margin-top: 8px; }
.ws-answer-label { flex: 0 0 auto; color: var(--text-faint); font-size: 11px; }
.ws-answer-text { white-space: pre-wrap; line-height: 1.65; }
.ws-card-actions { margin-top: 11px; }
.ws-note-group { padding: 14px; }
.ws-note-list { display: flex; flex-direction: column; gap: 8px; margin-top: 9px; }
.ws-note-item { padding: 10px 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.ws-note-item + .ws-note-item { margin-top: 6px; }
.ws-example { margin-top: 4px; color: var(--text-dim); font-size: 12px; line-height: 1.55; }
.ws-login { align-items: flex-start; padding: 30px; }
.ws-login-icon { font-size: 34px; }
.ws-login h2 { margin: 4px 0 0; }
.ws-login p { max-width: 620px; margin: 0; }

/* 听默写 */
.ws-dictation-form .chips { margin: 2px 0; }
.ws-voice-btn.recording { color: #fff; background: #d94343; border-color: transparent; }
.ws-result { overflow: hidden; }
.ws-mode-switch {
  display: inline-flex;
  gap: 4px;
  width: fit-content;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
}
.ws-mode-tab {
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--text-dim);
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.ws-mode-tab.active { color: var(--primary-ink); background: var(--primary); }
.ws-dictation-player {
  padding: 18px;
  border-radius: 16px;
  color: var(--primary-ink);
  background:
    radial-gradient(circle at 90% 0, rgba(255,255,255,.2), transparent 28%),
    linear-gradient(135deg, var(--primary), var(--accent, var(--primary)));
}
.ws-player-prompt { margin-top: 14px; font-size: clamp(20px, 3vw, 32px); font-weight: 750; line-height: 1.35; }
.ws-progress { height: 6px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.22); }
.ws-progress i { display: block; height: 100%; border-radius: inherit; background: #fff; transition: width .3s ease; }
.ws-answer-card { padding: 16px; }
.ws-answer-photo { width: 120px; max-height: 150px; border-radius: 10px; object-fit: cover; }
.ws-grade-card { padding: 16px; }
.ws-result-row, .ws-text-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ws-result-row:last-child, .ws-text-item:last-child { border-bottom: 0; }
.ws-result-row.bad { border-left: 3px solid #d94343; padding-left: 9px; }
.ws-result-row.ok { border-left: 3px solid var(--primary); padding-left: 9px; }
.ws-text-dictation .ws-text-item { padding: 9px 0; }

/* 识图 / 语音识别确认 */
.ws-recognition-confirm { gap: 10px; }
.ws-recognition-meta { align-items: center; gap: 8px; }
.ws-recognition-text {
  min-height: 190px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.ws-recognition-warning {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, #d97706 38%, var(--border));
  border-radius: 11px;
  color: #8a5200;
  background: color-mix(in srgb, #f59e0b 10%, var(--surface));
  font-size: 12px;
  line-height: 1.6;
}
.ws-correction-details { margin-top: 0; }
.ws-correction-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 170px;
  margin-top: 8px;
  overflow: auto;
}

/* 白板 */
.ws-board-head { padding: 16px; }
.ws-board-title { max-width: 460px; }
.ws-save-hint.dirty { color: #b86b00; }
.ws-save-hint.error { color: #c43737; }
.ws-board-toolbar { padding: 10px 12px; }
.ws-board-colors { align-items: center; gap: 5px; }
.ws-color-dot {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border-strong);
  cursor: pointer;
}
.ws-color-dot.active { box-shadow: 0 0 0 2px var(--primary); }
.ws-color-input { width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; }
.ws-width-range { width: 90px; }
.ws-page-row { align-items: center; gap: 8px; }
.ws-page-tabs { display: flex; flex: 1; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ws-page-tabs::-webkit-scrollbar { display: none; }
.ws-page-tab {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  background: var(--surface);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.ws-page-tab.active { color: var(--primary-ink); background: var(--primary); border-color: transparent; }
.ws-board-surface {
  position: relative;
  width: 100%;
  min-height: 360px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background-color: #fff;
  background-image:
    linear-gradient(rgba(21, 82, 66, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 82, 66, .055) 1px, transparent 1px);
  background-size: 28px 28px;
  box-shadow: inset 0 2px 12px rgba(18, 38, 33, .04);
}
.ws-board-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.ws-text-layer { position: absolute; inset: 0; pointer-events: none; }
.ws-board-text {
  position: absolute;
  max-width: 76%;
  padding: 2px 4px;
  border-radius: 5px;
  pointer-events: auto;
  line-height: 1.3;
  white-space: pre-wrap;
  word-break: break-word;
}
.ws-board-text:hover { background: rgba(255,255,255,.72); outline: 1px dashed var(--border-strong); }
.ws-text-del {
  display: inline-grid;
  width: 17px;
  height: 17px;
  margin-left: 5px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #d94343;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: .2;
  vertical-align: super;
}
.ws-board-text:hover .ws-text-del, .ws-text-del:focus { opacity: 1; }

/* 笔记本：批量选择与标注 */
.nb-select-wrap { display: none; align-items: center; justify-content: center; flex: 0 0 auto; cursor: pointer; }
.nb-grid.select-mode .nb-select-wrap { display: inline-flex; }
.nb-select { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.nb-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft), 0 8px 20px -16px var(--primary); }
.nb-batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background: var(--surface-2);
}
.nb-batch-bar .card-title { margin: 0; }
.nb-batch-bar .btn[disabled] { opacity: .45; cursor: not-allowed; }
.nb-select-mode .nb-canvas { pointer-events: none; }
.rank-progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.rank-progress-mini {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius, 14px);
  background: var(--surface-2);
}
.rank-progress-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.rank-progress-row:last-child { border-bottom: 0; }

/* 词汇学习 · 自检 */
.ws-vocab-page { gap: 14px; }
.ws-vocab-intro {
  background:
    radial-gradient(120% 150% at 0 0, var(--primary-soft), transparent 58%),
    var(--surface);
}
.ws-vocab-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.ws-vocab-stat {
  padding: 11px 12px; border: 1px solid var(--border); border-radius: 13px;
  background: var(--surface-2);
}
.ws-vocab-stat b { display: block; color: var(--primary-strong); font-size: 20px; line-height: 1.2; }
.ws-vocab-stat span { display: block; margin-top: 3px; color: var(--text-dim); font-size: 11px; }
.ws-vocab-controls { align-items: center; margin-top: 4px; }
.ws-vocab-controls input[type="range"] { accent-color: var(--primary); }
.ws-vocab-quiz { padding: 15px 16px; }
.ws-vocab-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; border: 1px solid var(--border); border-radius: 13px;
  background: var(--surface-2);
}
.ws-vocab-input { max-width: 360px; }
.ws-vocab-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.ws-vocab-option {
  min-height: 38px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); background: var(--surface);
  font: inherit; font-size: 12.5px; line-height: 1.45; text-align: left; cursor: pointer;
}
.ws-vocab-option:hover { border-color: var(--primary); }
.ws-vocab-option.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.ws-vocab-result { padding: 15px 16px; }
.ws-mistake-book { margin-top: 2px; }
.ws-mistake-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ws-mistake-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 11px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2);
}

@media (max-width: 720px) {
  .nb-batch-bar .row { gap: 6px; }
  .nb-batch-bar .btn { padding: 5px 8px; font-size: 11px; }
  .rank-progress-grid { grid-template-columns: minmax(0, 1fr); }
  .ws-vocab-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-vocab-options { grid-template-columns: 1fr; }
}

@media (max-width: 1000px) {
  .ws-hero { grid-template-columns: minmax(0, 1fr); }
  .ws-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .ws-hero { padding: 20px 16px; border-radius: var(--radius-lg); }
  .ws-hero h1 { font-size: 32px; }
  .ws-hero-side { padding: 12px; }
  .ws-tabs { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ws-tab-card { padding: 10px; gap: 7px; }
  .ws-tab-icon { flex-basis: 30px; width: 30px; height: 30px; font-size: 16px; }
  .ws-tab-copy span, .ws-tab-arrow { display: none; }
  .ws-board-surface { min-height: 300px; aspect-ratio: 4 / 5; }
  .ws-board-toolbar .spacer { display: none; }
  .ws-page-row { align-items: stretch; }
  .ws-player-prompt { font-size: 21px; }
}
