/* ============================================================
   共用樣式（手機填答頁 / 講者頁）
   跟著系統深淺色主題走（這兩頁是個人裝置，不是投影用）
   ============================================================ */

:root {
  --bg: #f7f7f9;
  --surface: #ffffff;
  --text: #1c1c1f;
  --text-muted: #5b5b63;
  --border: #d9d9e0;
  --primary: #2f5fd6;
  --primary-text: #ffffff;
  --danger: #c62828;
  --danger-bg: #fdecea;
  --success: #1e7d32;
  --success-bg: #e8f5e9;
  --radius: 12px;
  --focus-ring: #2f5fd6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181c;
    --surface: #232429;
    --text: #f0f0f2;
    --text-muted: #b5b5bd;
    --border: #3a3b42;
    --primary: #6f96f0;
    --primary-text: #101114;
    --danger: #ff8a80;
    --danger-bg: #3a1f1f;
    --success: #7ed08a;
    --success-bg: #1c2e1f;
    --focus-ring: #6f96f0;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.6;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

header.page-header {
  padding: 8px 0 20px;
}

header.page-header h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

header.page-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.q-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
}

.q-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.option input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

.option span {
  font-size: 15px;
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

label.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin: 14px 0 6px;
}

.name-field {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.name-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

button.primary {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.icon {
  width: 1.2em;
  height: 1.2em;
  fill: currentColor;
  flex: 0 0 auto;
}

.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

.banner.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.banner.success {
  background: var(--success-bg);
  color: var(--success);
}

.banner ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.done-screen {
  text-align: center;
  padding: 60px 16px;
}

.done-screen .icon-lg {
  width: 64px;
  height: 64px;
  fill: var(--success);
  margin-bottom: 12px;
}

.done-screen h2 {
  margin: 0 0 8px;
}

.done-screen p {
  color: var(--text-muted);
}

[hidden] {
  display: none !important;
}

/* ---- 講者頁（/admin）專用 ---- */

.login-box {
  max-width: 360px;
  margin: 80px auto;
  text-align: center;
  padding: 32px 24px;
}

.login-box .icon-lg {
  width: 40px;
  height: 40px;
  fill: var(--text-muted);
  margin-bottom: 8px;
}

.response-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.response-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.response-item .meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.response-item .body-text {
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-hint {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 0;
}

/* 講者頁「這裡不對」匯出區的區塊間隔（純新增，不影響既有元素） */
/* ★ 用 class 而不是 style="" 屬性：CSP 是 style-src 'self'，
   inline style 屬性會被瀏覽器直接擋掉（實測 headless Chrome 的
   Log.entryAdded 有噴出 CSP 違規），這裡直接用 class 才會真的生效。 */
.wrong-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  border-top: 1px dashed var(--border);
  padding-top: 20px;
}

.wrong-admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ★ 特異性要贏過 button.primary（0-1-1），單一 class 選不到，
   所以這裡用 button.btn-compact（0-1-1 打平時看來源順序，
   為求保險直接用兩個 class 疊上去）。 */
button.primary.btn-compact {
  width: auto;
  padding: 10px 16px;
}

.wrong-admin-item .rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 700;
  margin-right: 6px;
}
