/* ===== 全域設定 ===== */
:root {
  --bg-dark: #0a0e1a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.09);
  --primary: #6c63ff;
  --primary-light: #9d96ff;
  --accent: #ff6b6b;
  --gold: #ffd700;
  --teal: #00d4aa;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a8c0;
  --text-muted: #6b7494;
  --border: rgba(255, 255, 255, 0.1);
  --glow: rgba(108, 99, 255, 0.3);
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===== 背景粒子 ===== */
#particles-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 20% 20%, rgba(108,99,255,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(0,212,170,0.1) 0%, transparent 60%),
              linear-gradient(135deg, #0a0e1a 0%, #0f1629 50%, #0a0e1a 100%);
}

/* ===== 導覽列 ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 5%;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo .logo-icon {
  font-size: 1.4rem;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-links a.nav-active {
  color: var(--primary-light);
  background: rgba(108,99,255,0.15);
}

/* ===== 主要內容容器 ===== */
main {
  position: relative;
  z-index: 1;
  padding-top: 64px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}

/* ===== Hero 區塊 ===== */
#hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: 80px 5%;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 700px;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.3);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--primary-light);
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(135deg, #6c63ff, #00d4aa, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 560px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat .num {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6c63ff, #00d4aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat .label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, #6c63ff, #9d96ff);
  color: white;
  padding: 14px 32px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108,99,255,0.5);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  padding: 14px 32px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid var(--border);
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  color: var(--primary-light);
}

.hero-visual {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  width: 420px;
  height: 420px;
  opacity: 0.6;
  z-index: 1;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(108,99,255,0.3);
  animation: orbit-rotate linear infinite;
}

.orbit-1 {
  width: 300px; height: 300px;
  top: 60px; left: 60px;
  animation-duration: 20s;
}

.orbit-2 {
  width: 200px; height: 200px;
  top: 110px; left: 110px;
  animation-duration: 15s;
  animation-direction: reverse;
  border-color: rgba(0,212,170,0.3);
}

.orbit-dot {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  top: -5px; left: 50%;
  transform: translateX(-50%);
}

.dot-primary { background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.dot-teal { background: var(--teal); box-shadow: 0 0 10px var(--teal); }

.center-globe {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 5rem;
  animation: float 4s ease-in-out infinite;
}

@keyframes orbit-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-12px); }
}

/* ===== 區塊共用 ===== */
section {
  padding: 96px 5%;
  position: relative;
  z-index: 1;
}

section:nth-child(even) {
  background: rgba(255,255,255,0.02);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  display: inline-block;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.3);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--primary-light);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ===== 數據卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(108,99,255,0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow), 0 0 30px var(--glow);
}

.chart-card {
  padding: 28px;
  min-height: 300px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.charts-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto 40px;
}

.chart-full {
  grid-column: 1 / -1;
}

.chart-wrapper {
  position: relative;
  height: 280px;
}

/* ===== 心法區塊 ===== */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}

.tip-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(108,99,255,0.3);
  transform: translateY(-4px);
}

.tip-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
}

.tip-category {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--primary-light);
}

.tip-list {
  list-style: none;
}

.tip-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}

.tip-list li:last-child {
  border-bottom: none;
}

.tip-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 1.2rem;
  line-height: 1.4;
}

/* ===== 經驗卡片 ===== */
.experience-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.experiences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.exp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
  cursor: pointer;
}

.exp-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(108,99,255,0.4);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 30px var(--glow);
}

.exp-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.exp-avatar {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, rgba(108,99,255,0.3), rgba(0,212,170,0.3));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  border: 1px solid rgba(108,99,255,0.3);
}

.exp-meta {
  flex: 1;
}

.exp-alias {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
}

.tag-country {
  background: rgba(255,107,107,0.15);
  color: #ff9a9a;
  border: 1px solid rgba(255,107,107,0.2);
}

.tag-program {
  background: rgba(108,99,255,0.15);
  color: var(--primary-light);
  border: 1px solid rgba(108,99,255,0.2);
}

.tag-year {
  background: rgba(0,212,170,0.1);
  color: var(--teal);
  border: 1px solid rgba(0,212,170,0.2);
}

.tag-role {
  background: rgba(255,215,0,0.1);
  color: #ffd700;
  border: 1px solid rgba(255,215,0,0.2);
}

.exp-section {
  margin-bottom: 16px;
}

.exp-section-title {
  font-size: 0.8rem;
  color: var(--primary-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.exp-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.exp-quote {
  background: rgba(108,99,255,0.08);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-style: italic;
  margin-top: 4px;
  line-height: 1.6;
}

.load-more-btn {
  display: block;
  margin: 48px auto 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 12px 40px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
  font-family: inherit;
}

.load-more-btn:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  color: var(--primary-light);
}

/* ===== AI 聊天機器人 ===== */
#chatbot {
  padding: 96px 5%;
}

.chatbot-wrapper {
  max-width: 860px;
  margin: 0 auto;
}

.chatbot-intro {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.bot-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6c63ff, #00d4aa);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.bot-intro-text strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.bot-intro-text p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.api-key-section {
  background: rgba(255,215,0,0.05);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.api-key-section label {
  display: block;
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 10px;
  font-weight: 600;
}

.api-key-row {
  display: flex;
  gap: 12px;
}

.api-key-input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: monospace;
}

.api-key-input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-save-key {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-save-key:hover {
  background: var(--primary-light);
}

.api-key-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.chat-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 480px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.bot-msg-avatar {
  background: linear-gradient(135deg, rgba(108,99,255,0.3), rgba(0,212,170,0.3));
}

.user-msg-avatar {
  background: rgba(255,107,107,0.2);
  border-color: rgba(255,107,107,0.3);
}

.message-bubble {
  padding: 12px 18px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.bot .message-bubble {
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.2);
  color: var(--text-primary);
  border-radius: 4px 16px 16px 16px;
}

.user .message-bubble {
  background: rgba(255,107,107,0.12);
  border: 1px solid rgba(255,107,107,0.2);
  color: var(--text-primary);
  border-radius: 16px 4px 16px 16px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 6px 0;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-6px); opacity: 1; }
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  background: rgba(0,0,0,0.2);
}

.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;
  min-height: 46px;
  max-height: 120px;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-send-btn {
  background: linear-gradient(135deg, #6c63ff, #00d4aa);
  border: none;
  border-radius: 12px;
  width: 46px;
  height: 46px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(108,99,255,0.5);
}

.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.suggested-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.suggested-q {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.suggested-q:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(108,99,255,0.1);
}

/* ===== 頁尾 ===== */
footer {
  background: rgba(0,0,0,0.4);
  border-top: 1px solid var(--border);
  padding: 48px 5%;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-logo {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.footer-note {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 12px;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ===== 動畫 ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 漢堡選單 (手機) ===== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===== 彈出詳細卡片 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: #0f1629;
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px var(--glow);
}

.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ===== RWD ===== */
@media (max-width: 900px) {
  .charts-layout {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    display: none;
  }
  .nav-links {
    display: none;
  }
  .hamburger {
    display: flex;
  }
}

@media (max-width: 600px) {
  .experiences-grid {
    grid-template-columns: 1fr;
  }
  .tips-grid {
    grid-template-columns: 1fr;
  }
  .hero-stats {
    gap: 24px;
  }
  .modal-card {
    padding: 24px;
  }
}

/* ===== 進度條 ===== */
.ability-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.ability-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 0 0 170px;
  text-align: right;
}

.ability-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  overflow: hidden;
}

.ability-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #6c63ff, #00d4aa);
  width: 0;
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}

.ability-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex: 0 0 36px;
}

/* ===== 卡片展示更多 ===== */
.exp-card.hidden {
  display: none;
}

/* ===== 回饋與投稿表單 ===== */
#contribute { padding: 96px 5%; }

.form-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.form-tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  padding: 12px 24px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}

.form-tab-btn:hover { color: var(--text-primary); }
.form-tab-btn.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

.form-tab-panel { display: none; max-width: 860px; margin: 0 auto; }
.form-tab-panel.active { display: block; }

.contrib-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  backdrop-filter: blur(10px);
}

.contrib-notice {
  background: rgba(108,99,255,0.08);
  border: 1px solid rgba(108,99,255,0.25);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

/* 星星評分 */
.rating-group { margin-bottom: 32px; }
.rating-rows { display: flex; flex-direction: column; gap: 16px; }

.rating-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.rating-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  flex: 0 0 180px;
}

.star-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: rgba(255,255,255,0.15);
  transition: all 0.15s;
  padding: 0 2px;
  line-height: 1;
}

.star-btn:hover, .star-btn.active {
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
  transform: scale(1.15);
}

.star-label {
  font-size: 0.85rem;
  color: var(--teal);
  margin-left: 8px;
  min-width: 70px;
}

/* 質性回饋 */
.qualitative-group { margin-bottom: 8px; }
.form-field { margin-bottom: 20px; }

.form-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.form-textarea, .form-input {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
}

.form-textarea:focus, .form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}

.form-textarea::placeholder, .form-input::placeholder {
  color: var(--text-muted);
}

.char-count {
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 表單 Grid */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* 能力複選 */
.abilities-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.check-item:hover { color: var(--text-primary); }

.check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

/* 授權同意 */
.consent-box {
  background: rgba(108,99,255,0.06);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 24px;
}

.consent-check {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 送出按鈕 */
.submit-btn {
  font-size: 1rem;
  padding: 14px 36px;
  border: none;
}

/* 表單訊息 */
.form-msg {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.form-msg-success {
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.3);
  color: var(--teal);
}

.form-msg-error {
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.3);
  color: #ff9a9a;
}

.form-msg-warn {
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.25);
  color: var(--gold);
}

/* NEW badge */
.new-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff6b6b, #ffd700);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 8px;
  vertical-align: middle;
  margin-left: 6px;
  letter-spacing: 0.05em;
}

/* 字數計數 */
#exp-writing:focus + .char-count { color: var(--primary-light); }

/* RWD */
@media (max-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .rating-label { flex: 0 0 auto; min-width: 120px; }
  .contrib-form { padding: 20px; }
}

/* ===== 互動投票策展 ===== */
#poll { padding: 80px 0; }

.poll-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 44px;
  max-width: 780px;
  margin: 0 auto;
}

.poll-question {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.5;
}

.poll-subtext {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

/* 投票選項按鈕 */
.poll-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.poll-opts-exit {
  opacity: 0;
  transform: translateY(-8px);
}

.poll-opt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(108,99,255,0.07);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}

.poll-opt-btn:hover {
  background: rgba(108,99,255,0.18);
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(108,99,255,0.2);
}

.poll-opt-emoji { font-size: 1.3rem; flex-shrink: 0; line-height: 1; }

/* 結果列 */
.poll-results { margin-bottom: 20px; }

.poll-result-row {
  display: grid;
  grid-template-columns: 180px 1fr 90px;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.poll-result-row.poll-chosen .poll-result-label { color: var(--text); font-weight: 600; }
.poll-result-row.poll-chosen .poll-result-bar {
  background: linear-gradient(90deg, var(--primary), var(--teal)) !important;
}

.poll-result-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.poll-res-emoji { font-size: 1.1rem; flex-shrink: 0; }

.poll-your-vote {
  display: inline-block;
  font-size: 0.68rem;
  background: var(--primary);
  color: #fff;
  padding: 2px 7px;
  border-radius: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.poll-result-bar-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  height: 10px;
  overflow: hidden;
}

.poll-result-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(108,99,255,0.65), rgba(0,212,170,0.65));
  border-radius: 100px;
  transition: width 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-width: 2px;
}

.poll-result-stat {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.poll-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.78rem;
  display: block;
}

.poll-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.poll-meta strong { color: var(--teal); }
#pollStatus { color: var(--teal); font-weight: 600; }

@media (max-width: 640px) {
  .poll-card { padding: 24px 20px; }
  .poll-result-row { grid-template-columns: 1fr 1fr 60px; gap: 8px; }
  .poll-result-label { font-size: 0.82rem; }
  .poll-count { display: none; }
}

/* ===== 引導式問題選擇 ===== */
.chat-guide { margin-top: 16px; }

.guide-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.guide-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.guide-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guide-cat {
  padding: 5px 13px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.guide-cat:hover {
  background: rgba(108,99,255,0.12);
  border-color: rgba(108,99,255,0.4);
  color: var(--text);
}

.guide-cat.active {
  background: rgba(108,99,255,0.18);
  border-color: var(--primary);
  color: var(--text);
  font-weight: 600;
}

.guide-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
}

.guide-q {
  padding: 7px 14px;
  background: rgba(108,99,255,0.07);
  border: 1px solid rgba(108,99,255,0.15);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  line-height: 1.4;
}

.guide-q:hover {
  background: rgba(108,99,255,0.16);
  border-color: var(--primary);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(108,99,255,0.15);
}

@media (max-width: 640px) {
  .guide-cats { gap: 5px; }
  .guide-cat { font-size: 0.75rem; padding: 4px 10px; }
  .guide-q { font-size: 0.8rem; }
}

/* ===== 延伸推薦問題（回覆後跟進chips） ===== */
.followup-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 56px;
  margin-bottom: 4px;
}

.followup-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  width: 100%;
  margin-bottom: 2px;
}

.followup-chip {
  padding: 6px 13px;
  background: rgba(0,212,170,0.07);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.followup-chip:hover {
  background: rgba(0,212,170,0.18);
  border-color: var(--teal);
  color: var(--text);
  transform: translateY(-1px);
}

/* ===== 投票個別回覆紀錄 ===== */
.poll-feed {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.poll-feed-header {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.poll-feed-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.poll-feed-list::-webkit-scrollbar { width: 4px; }
.poll-feed-list::-webkit-scrollbar-track { background: transparent; }
.poll-feed-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.poll-feed-item {
  display: grid;
  grid-template-columns: 32px 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  transition: background 0.15s;
}

.poll-feed-item:hover { background: rgba(255,255,255,0.06); }

.poll-feed-idx {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.poll-feed-emoji { font-size: 1rem; text-align: center; }

.poll-feed-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.poll-feed-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .poll-feed-item { grid-template-columns: 28px 20px 1fr auto; gap: 6px; }
  .poll-feed-label { font-size: 0.8rem; }
}
