/* ========================================================
   光敏印章工作坊 ‧ 學員手機專用版樣式 (student.css)
   視覺規範：奶油紙底、朱紅邊框、深灰墨黑文字
   字型庫：由共用 fonts.css 載入專案內本地 WOFF2 字型
   ======================================================== */

:root {
  --color-primary: #D93025;
  --color-primary-dark: #B31412;
  --color-primary-light: #FCE8E6;
  --color-bg-paper: #FFFDF8;
  --color-bg-warm: #FAF5EE;
  --color-text-main: #2B2B2B;
  --color-text-muted: #7A6A5E;
  --color-border: #E6D8C8;
  --font-main: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-en: "Fredoka", sans-serif;
}

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

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--color-bg-warm);
  color: var(--color-text-main);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

.student-app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-warm);
}

/* 頂部固定雙分頁導航 */
.student-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 253, 248, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--color-border);
  padding: 8px 12px;
}

.student-nav {
  display: flex;
  gap: 8px;
  background: #EFE4D6;
  padding: 4px;
  border-radius: 12px;
}

.student-nav-btn {
  flex: 1;
  min-height: 44px;
  font-size: 1rem;
  font-weight: 800;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  background: transparent;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.student-nav-btn.active {
  background: var(--color-bg-paper);
  color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(217, 48, 37, 0.12);
  border: 1px solid rgba(217, 48, 37, 0.2);
}

/* 主內容區 */
.student-main {
  flex: 1;
  width: 100%;
  padding-bottom: 20px;
}

.student-panel {
  display: none;
  width: 100%;
}

.student-panel.active {
  display: block;
}

/* ========================================================
   分頁 1：提示詞專區 (極簡實用)
   ======================================================== */
.prompts-box {
  padding: 14px 12px;
  width: 100%;
}

.stamp-pill-title {
  text-align: center;
  margin-bottom: 12px;
}

.pill-title-text {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--color-primary);
  letter-spacing: 0.5px;
}

.pill-subtitle-text {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* 第一層大類切換列 (≥44px) */
.prompt-cat-bar {
  display: flex;
  gap: 6px;
  background: #EFE4D6;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.cat-pill {
  flex: 1;
  min-height: 44px;
  font-size: 0.92rem;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.cat-pill.active {
  background: var(--color-bg-paper);
  color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* 第二層風格切換列 (≥44px) */
.prompt-sub-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.sub-pill {
  flex: 1;
  min-height: 44px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  background: var(--color-bg-paper);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sub-pill.active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-color: var(--color-primary);
  font-weight: 800;
}

/* 醒目一鍵複製大按鈕 (52px) */
.main-copy-wrap {
  margin-bottom: 14px;
}

.btn-copy-hero {
  width: 100%;
  min-height: 52px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #FFFFFF;
  font-size: 1.05rem;
  font-weight: 900;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(217, 48, 37, 0.3);
  transition: transform 0.1s ease;
}

.btn-copy-hero:active {
  transform: scale(0.98);
}

/* 提示詞預覽卡片 (唯讀正文) */
.prompt-card {
  background: var(--color-bg-paper);
  border: 1.5px solid var(--color-border);
  border-radius: 14px;
  padding: 14px 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.card-top-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--color-border);
}

.info-badge {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--color-primary-dark);
}

.spec-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  padding: 2px 8px;
  border-radius: 6px;
}

.prompt-text-display {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--color-text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 分段輔助複製按鈕組 (≥44px) */
.part-actions-grid {
  display: flex;
  gap: 8px;
}

.btn-part-copy {
  flex: 1;
  min-height: 44px;
  background: var(--color-bg-paper);
  border: 1.5px solid var(--color-border);
  color: var(--color-text-main);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-part-copy:active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ========================================================
   分頁 2：排版神器 (手機全功能 App 佈局)
   ======================================================== */
.line-camera-app-frame {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #FFFFFF !important;
  position: relative;
  width: 100%;
  min-height: calc(100vh - 120px);
  margin: 0 auto;
}

/* 頂部操作列 (48px) */
.lc-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  min-height: 48px;
}

.lc-top-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--color-text-main);
}

.lc-top-actions {
  display: flex;
  gap: 6px;
}

.lc-top-actions button {
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1.5px solid transparent;
  transition: all 0.2s;
}

.lc-btn-clear-top {
  background: #F1F5F9;
  border-color: #CBD5E1 !important;
  color: #475569;
}

.lc-btn-gallery-top {
  background: linear-gradient(135deg, #D93025, #B31412);
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(217, 48, 37, 0.25);
}

.lc-btn-save-top {
  background: #F0FDF4;
  border-color: #86EFAC !important;
  color: #15803D;
}

/* 舞台與畫布 (7:3) */
.lc-stage-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  gap: 8px;
  background: #F8FAFC;
  touch-action: none;
}

.lc-guide-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.9);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #E2E8F0;
}

.canvas-wrapper {
  width: 96%;
  max-width: 374px;
  aspect-ratio: 1024 / 438;
  background: #FFFFFF;
  border: 2px solid #2B2B2B;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: relative;
  touch-action: none;
}

#stampCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  background: #FFFFFF;
  touch-action: none;
}

/* 底部操作欄與抽屜 */
.lc-bottom-bar {
  position: relative;
  background: #FFFFFF;
  border-top: 1px solid #CBD5E1;
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.lc-drawer {
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  padding: 10px 10px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  max-height: 180px;
  overflow-y: auto;
}

.lc-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.lc-drawer-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lc-btn-thick-toggle {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  color: #334155;
  cursor: pointer;
  min-height: 32px;
}

.lc-btn-thick-toggle.active {
  background: #FEF3C7;
  color: #B45309;
  border-color: #F59E0B;
  font-weight: 800;
}

.lc-drawer-close-btn {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #475569;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  min-height: 32px;
  cursor: pointer;
}

/* 抽屜內部排版 */
.lc-photo-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.lc-photo-pill {
  min-height: 44px;
  padding: 0 12px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  background: #FFFFFF;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.upload-pill {
  background: #F0FDF4;
  border-color: #86EFAC;
  color: #15803D;
}

.remove-pill {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: #BE123C;
}

.lc-text-subtab-row {
  display: flex;
  gap: 6px;
}

.lc-text-subtab-btn {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  background: #F8FAFC;
  color: #64748B;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.lc-text-subtab-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #FFFFFF;
}

.lc-phrase-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.lc-phrase-pill {
  min-height: 44px;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  background: #FFFFFF;
  color: #1E293B;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.lc-custom-input-group {
  display: flex;
  gap: 6px;
}

.lc-custom-textarea {
  flex: 1;
  min-height: 48px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.88rem;
  font-family: inherit;
  resize: none;
}

.lc-btn-add-custom-text {
  min-width: 68px;
  min-height: 48px;
  background: var(--color-primary);
  color: #FFFFFF;
  font-size: 0.88rem;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.lc-font-style-toggles {
  display: flex;
  gap: 8px;
}

.lc-btn-italic {
  min-height: 36px;
  padding: 0 12px;
  border: 1.5px solid #CBD5E1;
  border-radius: 6px;
  background: #FFFFFF;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.lc-btn-italic.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.lc-font-grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.lc-font-tile {
  min-height: 44px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
  color: #1E293B;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.lc-font-tile.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 900;
}

.lc-sticker-grid,
.lc-stk-grid {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 8px !important;
  max-height: 145px;
  overflow-y: auto;
  padding: 6px 4px;
}

.lc-stk-btn {
  min-height: 44px;
  height: 44px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  background: #FFFFFF;
  font-size: 1.35rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, border-color 0.2s;
}

.lc-stk-btn:active {
  transform: scale(0.92);
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

/* 底部五大導覽按鈕列 (高 ≥ 44px，全載具無死角) */
.lc-nav-row {
  display: flex;
  background: #FFFFFF;
  padding: 4px;
  min-height: 52px;
}

.lc-nav-btn {
  flex: 1;
  min-height: 44px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.2s;
}

.lc-nav-btn.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ========================================================
   💎 粘粘老師標準組件：微透黑晶膠囊 ＋ 八色流光 ＋ 連續連珠炮煙火
   ======================================================== */
.glass-footer-container {
  padding: 14px 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
}

.glass-footer {
  padding: 0.5rem 1.4rem;
  background: rgba(18, 24, 38, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.2s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.glass-footer:hover {
  transform: translateY(-2px);
}

.iridescent-text {
  background: linear-gradient(90deg, #ff0055, #ff00ff, #7f00ff, #0000ff, #00d4ff, #00ff66, #ffff00, #ff0055);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: iridescent-glow 4s linear infinite;
  font-weight: 800;
  font-size: 0.82rem;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.5;
}

@keyframes iridescent-glow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.epic-rainbow-particle {
  position: fixed;
  pointer-events: none;
  z-index: 99999999;
  box-shadow: 0 0 16px currentColor, 0 0 32px currentColor;
  animation: epic-firework-burst 1.5s cubic-bezier(0.08, 0.92, 0.2, 1) forwards;
}

@keyframes epic-firework-burst {
  0% { transform: translate3d(0, 0, 0) scale(1.6) rotate(0deg); opacity: 1; filter: brightness(1.6); }
  55% { opacity: 1; filter: brightness(1.3); }
  100% { transform: translate3d(var(--tx), var(--ty), 0) scale(0.2) rotate(var(--rot)); opacity: 0; }
}

/* Toast 浮動氣泡提示 */
.student-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(30, 20, 15, 0.94);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  border: 1px solid rgba(217, 48, 37, 0.4);
  backdrop-filter: blur(8px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.student-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
