/* 英语站附加样式（继承 ../style.css 主样式） */

.topbar-english {
  background: linear-gradient(135deg, #1f7d5e, #2c8a6b);
}

/* 题型 chip */
.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.type-chip {
  border: 1.5px solid #d0d4da;
  background: #fff;
  border-radius: 16px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  color: #444;
  transition: all 0.12s;
}
.type-chip:hover { border-color: #2c8a6b; }
.type-chip.selected {
  background: #2c8a6b;
  border-color: #2c8a6b;
  color: #fff;
}

/* 试卷预览 */
.paper {
  background: #fff;
  padding: 2rem 2.2rem;
  margin-top: 1rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-family: "Songti SC", "STSong", "SimSun", serif;
  color: #1a1a1a;
  font-size: 14px;
}
.paper-title {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.paper-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  font-size: 0.95rem;
  border-bottom: 1.5px solid #444;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* 题型分块 */
.q-sec {
  margin-top: 0.9rem;
  break-inside: avoid;
}
.q-sec:first-child { margin-top: 0; }
.q-sec h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  border-left: 4px solid #1f7d5e;
  padding-left: 0.5rem;
}
.q-no {
  font-weight: 600;
  margin-right: 0.35rem;
  color: #333;
  min-width: 1.6rem;
  display: inline-block;
}
.q-content {
  line-height: 1.7;
}

/* 单词题：3 列「中文 → ____」 */
.grid-vocab {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 1.4rem;
  row-gap: 0.6rem;
}
.q-vocab {
  break-inside: avoid;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.q-vocab .vocab-prompt { min-width: 5em; }
.q-vocab .vocab-blank {
  flex: 1;
  border-bottom: 1px solid #555;
  display: inline-block;
  min-width: 6em;
  height: 1.2em;
}

/* 选择题（单选 / 对话）：1 列连续 */
.list-choice .q-block {
  break-inside: avoid;
  margin-bottom: 0.55rem;
  display: flex;
  align-items: flex-start;
}
.list-choice .q-body { flex: 1; }
.list-choice .q-stem {
  line-height: 1.6;
  margin-bottom: 0.15rem;
}
.list-choice .q-options {
  margin-left: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  font-size: 0.95em;
  color: #333;
}
.list-choice .opt-letter { font-weight: 600; margin-right: 0.25rem; }

/* 填空题：2 列 */
.grid-fill {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 1.6rem;
  row-gap: 0.65rem;
}
.q-fill {
  break-inside: avoid;
  line-height: 1.7;
}

/* 连词成句：1 列，词块用边框包裹 */
.list-order .q-block {
  break-inside: avoid;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: flex-start;
}
.list-order .q-body { flex: 1; }
.list-order .word-bricks {
  margin: 0.1rem 0 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  font-family: -apple-system, "Segoe UI", "PingFang SC", sans-serif;
}
.list-order .word-brick {
  border: 1px solid #999;
  border-radius: 4px;
  padding: 0.05rem 0.5rem;
  background: #fafafa;
  font-size: 0.95em;
}
.list-order .order-blank {
  display: block;
  margin-top: 0.25rem;
  border-bottom: 1px solid #555;
  height: 1.4em;
}

/* 答案页 */
.answer-paper {
  page-break-before: always;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.ans-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
  row-gap: 0.4rem;
  font-size: 0.92rem;
}
.ans-item {
  break-inside: avoid;
  padding: 0.2rem 0;
  border-bottom: 1px dotted #ddd;
}
.ans-num { font-weight: 600; margin-right: 0.4rem; }
.ans-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0 0.4rem;
  background: #eaf5ef;
  color: #2c8a6b;
  font-size: 0.76rem;
  border-radius: 3px;
}

/* 打印 */
@media print {
  .site-nav, .topbar, header, .actions, .intro-card, .lightbox,
  .card:not(#result-card),
  #result-card .card-hd { display: none !important; }

  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  .container { max-width: none !important; padding: 0 !important; gap: 0 !important; display: block !important; }
  #result-card {
    box-shadow: none !important; background: #fff !important;
    border: none !important; padding: 0 !important; margin: 0 !important;
    display: block !important;
  }
  .paper, .answer-paper {
    box-shadow: none !important; margin: 0 !important;
    border-radius: 0 !important; padding: 0 !important;
    background: #fff !important; display: block !important;
    width: auto !important;
  }
  .answer-paper { page-break-before: always; break-before: page; }

  @page { size: A4; margin: 1.5cm 1.4cm 1.4cm 1.4cm; }

  .paper-title { break-after: avoid; page-break-after: avoid; }
  .paper-header { break-inside: avoid; page-break-inside: avoid; break-after: avoid; page-break-after: avoid; }
  .q-sec { break-inside: auto; }
  .q-sec h3 {
    break-inside: avoid; page-break-inside: avoid;
    break-after: avoid; page-break-after: avoid;
  }
  .q-vocab, .q-fill, .list-choice .q-block, .list-order .q-block, .ans-item {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  .grid-vocab, .grid-fill, .list-choice, .list-order, .ans-list {
    break-inside: auto;
  }
}

#aiPanel { margin-top: 0.6rem; padding: 0.6rem; background: #ecf6f1; border-radius: 6px; border: 1px solid #b8dac9; }
#aiPanel a { color: #1f7d5e; text-decoration: underline; }
