/**
 * 单句 Practice 弹窗 · 样式（doc/15，配 sentence-practice.js）
 * 自带紫色 elearn 调色板，任何页面引入即用（收藏夹 / 句子搜索 / 单词例句）。
 */
.sp-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.sp-overlay[hidden] { display: none; }
body.sp-lock { overflow: hidden; }

.sp-modal {
  width: min(520px, 100%); max-height: 88vh; overflow: auto;
  background: var(--surface, #fff); border-radius: 16px; padding: 18px 18px 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text, #1e1b4b);
}
.sp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sp-title { margin: 0; font-size: 18px; font-weight: 700; }
.sp-close { border: none; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--text-3, #94a3b8); }
.sp-close:hover { color: var(--text-2, #475569); }

.sp-rows { display: flex; flex-direction: column; gap: 10px; }
.sp-row { display: grid; grid-template-columns: 56px 1fr; align-items: start; gap: 10px; }
.sp-label { color: var(--text-3, #64748b); font-size: 13px; padding-top: 4px; }
.sp-enter { min-height: 24px; line-height: 1.7; word-break: break-word; }

/* 对照/原文的空态：橙色斜纹占位（对齐参考图） */
.sp-box { min-height: 40px; border-radius: 8px; padding: 8px 10px; line-height: 1.7; word-break: break-word; }
.sp-box.is-empty {
  background-image: repeating-linear-gradient(45deg, #fde9d6 0, #fde9d6 6px, #fdf2e6 6px, #fdf2e6 12px);
  border: 1px solid #fbd9b8;
}

.sp-zh { margin: 10px 0 0; color: var(--text-3, #64748b); font-size: 13px; line-height: 1.6; }

.sp-input {
  width: 100%; box-sizing: border-box; margin-top: 12px;
  border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 10px 12px;
  font-size: 15px; line-height: 1.6; resize: vertical; outline: none;
  font-family: inherit; color: var(--text, #1e1b4b);
  background: var(--surface, #fff);
}
.sp-input:focus { border-color: #a855f7; box-shadow: 0 0 0 3px rgba(168, 85, 247, .15); }

.sp-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: center; }
.sp-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border, #e2e8f0); background: var(--surface, #fff); color: var(--text-2, #334155);
  border-radius: 9px; padding: 8px 14px; font-size: 14px; cursor: pointer;
  transition: all .15s;
}
.sp-btn:hover { border-color: #a855f7; color: #7c3aed; }
.sp-fav.is-on { border-color: #f43f5e; color: #e11d48; background: #fff1f2; }

/* 逐词着色（与文章页语义一致） */
.sp-tok--ok { color: #16a34a; }
.sp-tok--bad { color: #ea580c; text-decoration: underline; text-underline-offset: 3px; }
.sp-tok--miss { color: #dc2626; font-weight: 700; }
.sp-tok--mask { color: #94a3b8; letter-spacing: .5px; opacity: .75; }
.sp-tok--empty { color: #94a3b8; }

.sp-box .speakable { cursor: pointer; border-radius: 3px; padding: 0 1px; }
.sp-box .speakable:hover {
  color: #4f46e5;
  background: #eef2ff;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

@media (max-width: 560px) {
  .sp-overlay { align-items: flex-end; padding: 0; }
  .sp-modal { width: 100%; max-width: none; border-radius: 16px 16px 0 0; max-height: 90vh; }
  .sp-row { grid-template-columns: 48px 1fr; }
}

html[data-theme="dark"] .sp-box.is-empty {
  background-image: repeating-linear-gradient(45deg, #3a2e22 0, #3a2e22 6px, #2e261d 6px, #2e261d 12px);
  border-color: #6b5340;
}
html[data-theme="dark"] .sp-box .speakable:hover {
  color: #a5b4fc;
  background: rgba(99, 102, 241, .2);
}
html[data-theme="dark"] .sp-input { border-color: var(--border); }
