/* 27級送舊互動 — 共用樣式
   色票：清大紫 #7B2682 / 金 #D4AF37 / 牛皮 #F5F5DC */
:root {
  --nthu-purple: #7B2682;
  --nthu-purple-dark: #4d1854;
  --nthu-purple-light: #a64dad;
  --gold: #D4AF37;
  --gold-light: #e8c95c;
  --kraft: #F5F5DC;
  --kraft-dark: #e8e8c0;
  --ink: #2a1a2e;
  --muted: #7a6a7c;
  --danger: #c0392b;
  --success: #27ae60;
  --shadow: 0 4px 20px rgba(75, 24, 84, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  background: var(--kraft);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  overscroll-behavior: none;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 80px;
  min-height: 100vh;
}

.page-wide { max-width: 720px; }

.brand-bar {
  text-align: center;
  padding: 16px 0 24px;
  border-bottom: 2px dashed var(--nthu-purple-light);
  margin-bottom: 24px;
}
.brand-bar h1 {
  font-size: 1.6em;
  color: var(--nthu-purple);
  letter-spacing: 2px;
}
.brand-bar p {
  font-size: 0.85em;
  color: var(--muted);
  margin-top: 4px;
}

/* 卡片 / 容器 */
.card {
  background: #fffdf5;
  border: 1px solid var(--kraft-dark);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card h2 {
  color: var(--nthu-purple);
  font-size: 1.15em;
  margin-bottom: 12px;
}

/* 表單 */
label {
  display: block;
  font-size: 0.85em;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 12px;
}

input[type="text"], input[type="tel"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--kraft-dark);
  border-radius: 10px;
  font-size: 1em;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--nthu-purple);
}

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

/* 按鈕 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--nthu-purple);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  font-family: inherit;
}
.btn:hover, .btn:active { background: var(--nthu-purple-dark); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-gold {
  background: var(--gold);
  color: var(--nthu-purple-dark);
}
.btn-gold:hover, .btn-gold:active { background: var(--gold-light); }

.btn-outline {
  background: transparent;
  color: var(--nthu-purple);
  border: 1.5px solid var(--nthu-purple);
}
.btn-outline:hover { background: rgba(123, 38, 130, 0.08); }

/* 狀態提示 */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--nthu-purple-dark);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 0.9em;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s;
  max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* 載入 spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(123, 38, 130, 0.2);
  border-top-color: var(--nthu-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 學號登入框 */
.identity-gate {
  position: fixed;
  inset: 0;
  background: rgba(245, 245, 220, 0.97);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
}
.identity-gate-box {
  background: #fffdf5;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.identity-gate-box .logo {
  font-size: 2.4em;
  color: var(--gold);
  margin-bottom: 4px;
}
.identity-gate-box h2 {
  color: var(--nthu-purple);
  margin-bottom: 8px;
}
.identity-gate-box p {
  font-size: 0.85em;
  color: var(--muted);
  margin-bottom: 16px;
}
.identity-gate-box .err {
  font-size: 0.8em;
  color: var(--danger);
  margin-top: 8px;
  min-height: 1.2em;
}

/* Stage 模式（全螢幕投影） */
body.stage {
  background: linear-gradient(135deg, var(--nthu-purple-dark) 0%, var(--nthu-purple) 100%);
  color: var(--kraft);
  overflow: hidden;
}
body.stage .page {
  max-width: 100vw;
  min-height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

/* 工具 */
.muted { color: var(--muted); font-size: 0.85em; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.hidden { display: none !important; }

@media (min-width: 720px) {
  .page { padding: 32px 24px 80px; }
}

/* Demo 橫幅（whisper/quiz/passport/moderator 共用） */
.demo-banner-mini {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #78350f;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.78em;
  margin-bottom: 12px;
  text-align: center;
  border: 1px dashed #92400e;
}
.demo-banner-mini a {
  color: #78350f;
  text-decoration: underline;
}
