/* 教師投票端 */
body { background: var(--bg); }
.vote-loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 80px 16px; color: var(--muted); }

.vote-header { background: var(--primary); color: #fff; }
.vote-header-inner { max-width: 800px; margin: 0 auto; padding: 22px 16px 26px; }
.vote-org { font-size: 14px; opacity: .88; letter-spacing: .02em; }
.vote-title { font-size: 26px; margin-top: 4px; letter-spacing: .02em; }
.vote-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 12px; font-size: 14px; }
.vote-meta .badge { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.35); }
.vote-meta .badge-live { background: #e6f4ec; color: var(--ok); border-color: #e6f4ec; }

.vote-main { max-width: 800px; margin: 0 auto; padding: 18px 16px 140px; display: grid; gap: 16px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); font-size: 14px; font-weight: 700; flex: none;
}
.step-no.done { background: var(--ok); color: #fff; }
.section-need { font-size: 14px; color: var(--text-2); }
.section-body { padding: 16px 20px 20px; }

.counter { font-weight: 700; font-size: 14px; padding: 3px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.counter.full { background: var(--ok-soft); border-color: #bfe3cf; color: var(--ok); }

.desc { color: var(--text-2); }

/* 投票人搜尋 */
.search-box { position: relative; }
.search-box .input { min-height: 46px; font-size: 16px; padding-left: 40px; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.voter-results { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.voter-results:empty { display: none; }
.voter-item {
  display: grid; grid-template-columns: 90px 1fr; gap: 2px 12px; width: 100%;
  padding: 10px 14px; text-align: left; background: var(--surface); border: 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.voter-item:last-child { border-bottom: 0; }
.voter-item:hover, .voter-item:focus-visible { background: var(--primary-soft); outline: none; }
.voter-emp { color: var(--muted); font-variant-numeric: tabular-nums; grid-row: span 2; align-self: center; }
.voter-name { font-weight: 700; }
.voter-sub { font-size: 13px; color: var(--text-2); }
.voter-empty { padding: 12px 14px; color: var(--muted); font-size: 14px; }

.voter-chosen {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--primary-line); background: var(--primary-soft);
}
.voter-chosen .who { font-size: 18px; font-weight: 700; }
.voter-chosen .sub { color: var(--text-2); font-size: 14px; }

/* 候選人 */
.cand-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cand {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; min-height: 58px;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  cursor: pointer; user-select: none;
}
.cand:hover { border-color: var(--primary-line); background: #fbfdff; }
.cand input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex: none; cursor: inherit; }
.cand.checked { border-color: var(--primary); background: var(--primary-soft); }
.cand.disabled { opacity: .45; cursor: not-allowed; }
.cand.disabled:hover { border-color: var(--border-strong); background: var(--surface); }
.cand-name { font-weight: 700; font-size: 16px; }
.cand-dept { font-size: 13px; color: var(--text-2); }
.cand:has(input:focus-visible) { outline: 3px solid var(--primary-line); outline-offset: 1px; }

.hint-line { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* 底部送出列 */
.submit-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(16,24,40,.08);
}
.submit-inner { max-width: 800px; margin: 0 auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 16px; }
.progress-wrap { flex: 1; min-width: 0; }
.progress-text { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.progress-text b { font-size: 15px; }
.progress-missing { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 8px; border-radius: 999px; background: #e9edf2; overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .2s; }
.progress.full > span { background: var(--ok); }

/* 確認畫面 */
.confirm-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.confirm-list li { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.confirm-cat { font-size: 13px; color: var(--text-2); font-weight: 600; }
.confirm-names { font-size: 16px; font-weight: 700; }
.confirm-warn { margin-top: 12px; }

/* 狀態頁與完成頁 */
.state-card { text-align: center; padding: 40px 24px; }
.state-icon {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.state-icon.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cf; }
.state-card h2 { font-size: 22px; }
.state-card p { margin-top: 10px; color: var(--text-2); }

@media (max-width: 640px) {
  .vote-title { font-size: 21px; }
  .cand-grid { grid-template-columns: 1fr; }
  .section-head, .section-body, .card-pad { padding-left: 16px; padding-right: 16px; }
  .submit-inner { gap: 10px; }
  .submit-inner .btn-lg { padding: 10px 16px; }
}
