/* 英文字帖（2026-11-10 R2）
   四线三格的实现：**背景是 SVG data URI**，四条线按 12.5% / 37.5% / 62.5% / 87.5% 分布。
   为什么不用 CSS 渐变画线：渐变画不出「中间两条实线、上下两条虚线」这种组合，
   而四线三格的辨识度全靠这个 —— 孩子要知道哪条是基线。
   为什么不用 canvas：SVG 在任意缩放下都是清晰 1px，打印不会糊。 */

.en-main { padding-bottom: 48px; }
.en-grid { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .en-grid { grid-template-columns: 1fr; } }

.en-preview-card { padding: 16px 18px 20px; }
.preview-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; font-size: var(--font-xs); color: var(--text-aux);
}

.en-paper {
  background: #FFFDF9;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px 22px 30px;
  box-shadow: var(--shadow-card);
  min-height: 380px;
}
.en-paper-title {
  font-size: 15px; font-weight: 700; color: #6B6B6B;
  text-align: center; margin-bottom: 18px; letter-spacing: .5px;
}
.en-body { display: flex; flex-direction: column; gap: 8px; }
.en-empty { color: var(--text-aux); font-size: var(--font-sm); text-align: center; padding: 40px 0; }

.en-row { display: flex; align-items: stretch; }
.en-cell {
  position: relative; flex: 1 1 0; min-width: 0;
  aspect-ratio: 3 / 2;
  /* 四条线：上/下虚线，中间两条实线（第二条是中线上沿，第三条是基线） */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M0 12.5H100M0 87.5H100' stroke='%23cfcfcf' stroke-width='1' stroke-dasharray='4 3'/><path d='M0 37.5H100M0 62.5H100' stroke='%23b9b9b9' stroke-width='1'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
/* 基线（62.5%）对齐字母底边：字母"坐"在第三条线上 */
.en-glyph {
  position: absolute; left: 0; right: 0; bottom: 37.5%;
  text-align: center; line-height: 1;
  color: #C7433B;                 /* 范字墨色，与汉字字帖同色 */
  font-family: "Times New Roman", "Georgia", serif;
  letter-spacing: .5px;
  user-select: none;
}
.en-cell.is-trace .en-glyph { color: #E8A8A8; }

/* ---------------- 打印：只留纸，纵向 ----------------
   2026-11-12：A4 是 JS 未加载时的兜底；/static/print-page.js 会按 #paperSel
   （或 [data-print-paper]）注入 A4/A5/B5 的真实毫米尺寸覆盖它。 */
@media print {
  @page { size: A4 portrait; margin: 0; }
  body { background: #fff; }
  .topbar, .page-head, .card:not(.en-preview-card), .pk-note, .preview-bar { display: none !important; }
  .en-main { padding: 0 !important; max-width: none !important; }
  .en-grid { display: block !important; }
  .en-preview-card { padding: 0 !important; border: 0 !important; box-shadow: none !important; background: #fff !important; }
  .en-paper {
    border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
    padding: 18mm 16mm !important; min-height: 0 !important;
  }
  .en-cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------- 教材选词（P2-3） ----------------
   折叠面板：不展开时只占一行按钮，不挤占手工输入的位置（手输仍是主路径）。 */
.en-book-toggle { width: 100%; justify-content: flex-start; }
.en-book {
  margin-top: 10px; padding: 12px;
  background: var(--bg-soft); border: 1px solid var(--border-light);
  border-radius: var(--radius-input);
  display: flex; flex-direction: column; gap: 10px;
}
.en-book[hidden] { display: none; }
/* 版本 / 册次两个下拉沿用 app.css 里 .row2 的自适应栅格（够宽才并排），
   这里只把间距收紧一点 —— 面板本身还套了一层内边距。 */
.en-book .row2 { gap: 8px; }
.en-book .select-wrap { position: relative; }
.en-book .select { width: 100%; }

.en-words {
  max-height: 260px; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-input); padding: 6px 8px;
}
.en-words-bar {
  display: flex; gap: 6px; justify-content: flex-end;
  padding: 2px 0 6px; border-bottom: 1px dashed var(--border-light); margin-bottom: 4px;
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.en-word {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 4px; cursor: pointer; border-radius: var(--radius-xs);
}
.en-word:hover { background: var(--primary-light); }
.en-word-pick { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); flex: 0 0 auto; }
.en-word-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.en-word-text { font-size: var(--font-sm); font-weight: 700; color: var(--text-h1); }
.en-word-ph { font-size: var(--font-xs); color: var(--text-aux); font-style: normal; }
.en-word-zh { font-size: var(--font-xs); color: var(--text-aux); }
/* 短语标出来：它会被拆成几个词练，不标用户会以为少印了。 */
.en-word-tag {
  display: inline-block; margin-top: 2px;
  font-size: var(--font-xs); font-style: normal; color: var(--reward-text);
}
