/* 風格 A：考卷 — 明體印刷、紅筆批改、釘書針 */
:root {
  --desk: #d8d3c8;
  --paper: #fbf9f2;
  --ink: #1f1f1f;
  --muted: #6a665e;
  --line: #2a2a2a;
  --red: #d0312d;
  --pen: 'Caveat', 'LXGW WenKai TC', cursive;
  --kai: 'LXGW WenKai TC', 'Noto Serif TC', serif;
}

body {
  background: var(--desk);
  color: var(--ink);
  font-family: 'Noto Serif TC', serif;
}

.q-screen {
  position: relative;
  background: var(--paper);
  padding: 34px 22px 30px;
  box-shadow: 0 1px 0 #cfc9bb, 0 12px 24px -12px rgba(0, 0, 0, 0.35);
  transform: rotate(-0.4deg);
}
/* 釘書針 */
.q-screen::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 10px;
  width: 26px;
  height: 3px;
  background: linear-gradient(#bbb, #888);
  border-radius: 1px;
  transform: rotate(-38deg);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
.q-intro,
.q-result {
  text-align: left;
  align-items: stretch;
}

/* 卷頭 */
.q-kicker {
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.2em;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}
.q-intro .q-kicker::after {
  content: '班級＿＿＿　座號＿＿　姓名＿＿＿＿＿';
  display: block;
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.q-intro .q-mark {
  display: none;
}
.q-title {
  font-weight: 900;
  font-size: 30px;
  text-align: center;
  letter-spacing: 0.12em;
  margin: 26px 0 6px;
}
.q-subtitle {
  text-align: center;
  font-family: var(--kai);
  color: var(--muted);
  margin-bottom: 22px;
}
.q-desc {
  font-size: 15px;
  line-height: 1.9;
  padding: 12px 14px;
  border: 1px solid var(--line);
  margin-bottom: 26px;
}
.q-desc::before {
  content: '作答說明：';
  font-weight: 700;
}
.q-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.q-btn {
  font-family: var(--kai);
  font-size: 17px;
  padding: 12px 24px;
  border: 1.5px solid var(--ink);
  background: transparent;
  transition: background 0.15s;
}
.q-btn:hover {
  background: #efece2;
}
.q-btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.q-btn-primary:hover {
  background: #000;
}

/* 題目 */
.q-progress {
  justify-content: flex-end;
  margin-bottom: 18px;
}
.q-progress-track {
  display: none;
}
.q-progress-text {
  font-size: 12px;
  color: var(--muted);
}
.q-progress-text::before {
  content: '第 ';
}
.q-progress-text::after {
  content: ' 題';
}
.q-qnum {
  counter-reset: q var(--n);
  font-weight: 900;
  font-size: 18px;
}
.q-qnum::before {
  content: counter(q, trad-chinese-informal) '、選擇題';
}
.q-qnum span {
  display: none;
}
.q-qtext {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.7;
  margin: 6px 0 18px;
}
.q-options {
  gap: 4px;
}
.q-option {
  position: relative;
  padding: 10px 6px;
  font-size: 16px;
}
.q-option-key {
  position: relative;
  width: 2.4em;
  font-weight: 700;
}
.q-option-key::before {
  content: '（';
}
.q-option-key::after {
  content: '）';
}
.q-option:hover .q-option-text {
  text-decoration: underline 1px var(--muted);
  text-underline-offset: 5px;
}
/* 紅筆圈選 */
.q-option.is-selected .q-option-key {
  color: var(--red);
}
.q-option.is-selected .q-option-key::before {
  content: '（';
}
.q-option.is-selected::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  width: 44px;
  height: 34px;
  border: 2px solid var(--red);
  border-radius: 52% 48% 55% 45% / 60% 50% 50% 40%;
  transform: translateY(-50%) rotate(-8deg);
  animation: exam-draw 0.25s ease-out;
}
.q-option.is-selected::after {
  content: '✓';
  margin-left: auto;
  font-family: var(--pen);
  font-size: 30px;
  line-height: 0;
  color: var(--red);
}
.q-back {
  align-self: flex-start;
  margin-top: 18px;
  font-family: var(--kai);
  color: var(--muted);
  font-size: 14px;
}

/* 結果：成績單 */
.q-score {
  position: absolute;
  top: 14px;
  right: 22px;
  font-family: var(--pen);
  font-size: 64px;
  line-height: 1;
  color: var(--red);
  transform: rotate(-10deg);
  border-bottom: 3px double var(--red);
  animation: exam-draw 0.6s 0.3s ease-out both;
}
.q-score::after {
  content: '分';
  font-family: var(--kai);
  font-size: 20px;
  margin-left: 2px;
}
.q-result .q-kicker {
  text-align: left;
  border: 0;
  padding: 0;
  font-family: var(--kai);
  color: var(--muted);
  margin-top: 6px;
}
.q-result .q-mark {
  position: absolute;
  top: 120px;
  right: 26px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-family: var(--kai);
  font-size: 40px;
  color: var(--red);
  border: 3px solid var(--red);
  border-radius: 6px;
  transform: rotate(8deg);
  opacity: 0.85;
  mix-blend-mode: multiply;
}
.q-result-name {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin: 4px 0 6px;
}
/* 讓出右側印章的位置 */
.q-result-tagline {
  padding-right: 76px;
  font-family: var(--kai);
  font-size: 17px;
  color: var(--muted);
}
.q-card {
  margin: 22px 0 24px;
  border-top: 2px solid var(--line);
  padding-top: 16px;
}
.q-result-desc {
  font-size: 15px;
  line-height: 1.95;
}
.q-traits {
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
}
.q-traits li {
  font-family: var(--kai);
  color: var(--red);
  font-size: 17px;
}
.q-traits li::before {
  content: '✓ ';
  font-family: var(--pen);
}
.q-meta {
  gap: 0;
  border: 1px solid var(--line);
}
.q-meta-item {
  padding: 8px 10px;
}
.q-meta-item + .q-meta-item {
  border-left: 1px solid var(--line);
}
.q-meta dt {
  font-size: 12px;
  color: var(--muted);
}
.q-meta dd {
  font-weight: 700;
}
.q-section-title {
  font-size: 15px;
  font-weight: 900;
}
.q-section-title::before {
  content: '附表　';
  color: var(--muted);
  font-weight: 400;
}
.q-bar-label {
  font-size: 14px;
}
.q-bar-track {
  height: 12px;
  border: 1px solid var(--line);
}
.q-bar-fill {
  background: repeating-linear-gradient(-55deg, var(--ink) 0 1.5px, transparent 1.5px 3.5px);
}
.q-bar-row.is-top .q-bar-fill {
  background: repeating-linear-gradient(-55deg, var(--red) 0 2px, transparent 2px 3.5px);
}
.q-bar-value {
  font-size: 13px;
}

/* 各科成績 */
.q-dims {
  border-top: 2px solid var(--line);
}
.q-dims .q-section-title {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.q-dims .q-section-title::before {
  content: none;
}
.q-dim {
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--rule, #d6d1c4);
}
.q-dim-name {
  font-weight: 700;
  font-size: 16px;
}
.q-dim-value {
  font-family: var(--pen);
  font-size: 30px;
  line-height: 1;
  color: var(--red);
}
.q-dim .q-bar-track {
  height: 8px;
  margin: 6px 0 8px;
}
.q-dim-comment {
  font-family: var(--kai);
  font-size: 15px;
  color: var(--red);
}
.q-dim-badge {
  margin-left: 8px;
  padding: 0 6px;
  font-family: var(--kai);
  font-size: 12px;
  font-weight: 400;
  color: var(--red);
  border: 1px solid var(--red);
  vertical-align: 2px;
}

.q-sharebox-panel {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Serif TC', serif;
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.5);
}
.q-sharebox-title {
  font-weight: 700;
}
.q-sharebox-text {
  border: 1px solid var(--line);
  background: #fff;
}

.q-toast {
  border-radius: 0;
  background: var(--ink);
  font-family: var(--kai);
}

@keyframes q-in {
  from {
    opacity: 0;
    transform: translateY(24px) rotate(1.5deg);
  }
}
@keyframes exam-draw {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0);
  }
}
