/* 學員端（手機） */
body { padding: 0 16px 40px; }
.top, #app { max-width: 560px; margin: 0 auto; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0; border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.top .brand { font-size: 22px; }
.session-name { margin: 0; color: var(--muted); font-size: 13px; text-align: right; overflow-wrap: anywhere; }

.view { display: grid; gap: 16px; }
.meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meta .tag { font-size: 14px; }
.multi-hint { font-size: 16px; font-weight: 700; color: var(--multi); }
.meta .pos { margin-left: auto; font-size: 14px; }
.q-title { margin: 0; font-size: 21px; line-height: 1.5; font-weight: 700; overflow-wrap: anywhere; }

/* 作答畫面：內容區底部留出底部按鈕列的高度 */
body[data-screen="question"], body[data-screen="done"], body[data-screen="paused"],
body[data-screen="none"], body[data-screen="error"] { padding-bottom: calc(var(--bar-h, 220px) + var(--bar-lift, 0px) + 16px); }

form { display: grid; gap: 14px; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 56px; padding: 12px 16px;
  background: var(--panel); color: var(--text);
  border: 1.5px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 17px; text-align: left; cursor: pointer;
  overflow-wrap: anywhere;
}
.option .mark {
  flex: none; width: 22px; height: 22px;
  border: 2px solid var(--muted); border-radius: 50%;
  display: grid; place-items: center;
}
.option.multi .mark { border-radius: 6px; }
.option[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.option[aria-checked="true"] .mark { border-color: var(--accent); background: var(--accent); }
.option[aria-checked="true"] .mark::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-accent);
}
.option.multi[aria-checked="true"] .mark::after { border-radius: 2px; }
.option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 手機點擊：不用瀏覽器預設的藍色點擊底色，改成按下時稍微變亮 */
button { -webkit-tap-highlight-color: transparent; }
.option:active, .btn:active:not(:disabled) { filter: brightness(1.2); }

.text-answer textarea { font-size: 17px; min-height: 120px; }
.text-answer textarea:disabled { opacity: 0.55; cursor: not-allowed; }

/* 留言題與提問題：送出後的提示、我的留言／大家的提問 */
.sent-note { margin: 0; font-size: 15px; font-weight: 700; color: var(--ok); }
.thread { display: grid; gap: 10px; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.thread-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.thread-head h2 { margin: 0; font-size: 17px; }
.like-quota { font-size: 14px; color: var(--muted); }
.refresh-btn { margin-left: auto; min-height: 44px; padding: 0 14px; font-size: 15px; }
.refresh-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.thread-hint { margin: 0; font-size: 15px; color: var(--accent); }
.thread-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.thread-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
}
.thread-item.mine { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.thread-text { flex: 1; margin: 0; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.thread-meta { flex: none; display: flex; align-items: center; gap: 8px; }
.mine-badge { font-size: 13px; font-weight: 700; color: var(--ok); }
.like-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 64px; min-height: 48px; padding: 0 12px; border-radius: 12px;
  background: transparent; color: var(--muted); border: 1.5px solid var(--line);
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.like-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.like-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.like-btn[aria-pressed="true"] svg { fill: currentColor; }
.like-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.thread-empty { margin: 0; font-size: 15px; }
.counter { margin: 6px 0 0; text-align: right; font-size: 13px; }

.btn.big { min-height: 56px; width: 100%; font-size: 18px; border-radius: 12px; }
.error { margin: 0; color: var(--danger); font-size: 15px; text-align: center; }
.error:empty { display: none; }

/* 底部按鈕列（拇指區）：送出 64px，與「看新題目」相距 20px；考慮 iPhone 底部安全區 */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: var(--bar-lift, 0px); z-index: 5;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.action-inner { max-width: 560px; margin: 0 auto; display: grid; gap: 8px; }
.action-inner .notice { padding: 10px 14px; font-size: 15px; }
.submit-hint { margin: 0; font-size: 15px; color: var(--muted); text-align: center; }
.submit-hint:empty { display: none; }
.submit-btn { min-height: 64px; width: 100%; font-size: 19px; font-weight: 700; border-radius: 14px; }
/* 停用：中性灰，不用橘色系 */
.btn.primary.submit-btn:disabled { opacity: 1; background: #2B2F37; border-color: #2B2F37; color: #7C828D; }
/* 只有一顆按鈕的畫面（已送出、暫停、沒有題目、連線問題）：按鈕放在與作答畫面「送出」相同的位置
   （下方保留「看新題目」56px＋間距 20px 的高度），送出後不用移動手指就能按「看新題目」 */
.action-bar.single .action-inner { padding-bottom: 76px; }
.btn.secondary { min-height: 56px; width: 100%; margin-top: 12px; font-size: 17px; border-radius: 12px; background: transparent; color: var(--text); border: 1.5px solid var(--line); }

/* 未送出就離開的確認 */
.leave-dialog {
  width: min(400px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 16px;
  background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / 0.6);
}
.leave-dialog::backdrop { background: rgb(0 0 0 / 0.65); }
.leave-dialog form { display: grid; gap: 12px; padding: 22px 20px 20px; }
.leave-dialog h2 { margin: 0; font-size: 20px; }
.leave-dialog p { margin: 0 0 6px; font-size: 15px; }

.notice {
  margin: 0; padding: 14px 16px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text); font-size: 16px; text-align: center;
}

[data-view="done"], [data-view="none"], [data-view="closed"], [data-view="error"] { text-align: center; padding-top: 6vh; }
.done-mark {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent);
}
.done-title, .state-title { margin: 0; font-size: 26px; }
.done-q { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
