@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  background: var(--content-bg);
  font-family: 'Noto Sans TC', sans-serif;
  color: #1a1a1a;
}

.phone-frame {
  max-width: 430px;
  margin: 0 auto;
  background: var(--content-bg);
  min-height: 100vh;
  position: relative;
}

/* Hero */
.hero-image {
  width: calc(100% - 32px);
  margin: 20px 16px 0;
  border-radius: 16px;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.hero-placeholder {
  width: calc(100% - 32px);
  margin: 20px 16px 0;
  border-radius: 16px;
  background: #e0e0e0;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 14px;
  font-weight: 500;
}

/* Content */
.content {
  padding: 20px 16px 120px;
}

.field-label {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
}
.field-label .required {
  color: #e53935;
  margin-left: 4px;
  font-size: 13px;
}

.search-wrap {
  position: relative;
  margin-bottom: 24px;
}
.search-wrap::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}
.search-input {
  width: 100%;
  padding: 14px 14px 14px 42px;
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 12px;
  font-size: 14px;
  color: #1a1a1a;
  outline: none;
  font-family: 'Noto Sans TC', sans-serif;
}
.search-input::placeholder { color: #aaa; }
.search-input:focus { border-color: var(--primary); }

.search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 12px;
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.search-result-item {
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item:hover {
  background: #f5f5f5;
}
.search-result-item.no-result {
  color: #999;
  cursor: default;
}
.search-result-item.no-result:hover {
  background: transparent;
}

/* 高風險/Closed 職業標籤（灰色圖示，跟 App 一樣） */
.search-result-item.high-risk,
.search-result-item.closed {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.risk-badge {
  font-size: 14px;
  margin-left: 8px;
  opacity: 0.6;
}

/* Closed Alert 單按鈕置中 */
.high-risk-alert-buttons.single {
  justify-content: center;
}
.high-risk-alert-buttons.single .high-risk-alert-btn {
  flex: none;
  min-width: 120px;
}

/* 高風險 Alert Modal */
.high-risk-alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.high-risk-alert-modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
.high-risk-alert-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
}
.high-risk-alert-message {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 24px;
}
.high-risk-alert-buttons {
  display: flex;
  gap: 12px;
}
.high-risk-alert-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: 'Noto Sans TC', sans-serif;
  transition: all 0.2s;
}
.high-risk-alert-btn.cancel {
  background: #f0f0f0;
  color: #666;
}
.high-risk-alert-btn.cancel:hover {
  background: #e0e0e0;
}
.high-risk-alert-btn.confirm {
  background: transparent;
  color: #006AA6;
}
.high-risk-alert-btn.confirm:hover {
  background: #e3f2fd;
}

.section-title {
  font-size: 13px;
  color: #888;
  font-weight: 600;
  margin-bottom: 16px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1px solid #ddd;
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 14px;
  color: #555;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover, .chip.selected {
  border-color: var(--primary);
  color: var(--primary);
}
.chip.selected {
  background: var(--primary);
  color: #fff;
}

/* CTA */
.cta-wrap {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  padding: 12px 16px 28px;
  background: var(--content-bg);
}
.cta-btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Noto Sans TC', sans-serif;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.cta-btn.ready {
  opacity: 1;
}

/* 轉場頁 */
.transition-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 40px;
  background: var(--content-bg);
  min-height: 100vh;
}
.transition-screen.active {
  display: flex;
}
.trans-prefix {
  font-size: 13px;
  color: #666;
}
.trans-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--trans-value-color, var(--primary));
}
.trans-suffix {
  font-size: 13px;
  color: #666;
}
/* 轉場文字脈動動畫 */
.transition-screen.active .trans-value {
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
}

/* 題目頁 */
.quiz-screen {
  display: none;
  flex-direction: column;
  padding: 24px 20px;
  background: var(--quiz-bg);
  min-height: 100vh;
}
.quiz-screen.active {
  display: flex;
}
.quiz-header {
  text-align: right;
  font-size: 13px;
  color: #888;
  font-weight: 600;
  margin-bottom: 24px;
}
.quiz-text {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.6;
  margin-bottom: 32px;
}
.quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quiz-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.quiz-opt:hover {
  border-color: var(--primary);
}
.quiz-opt:active {
  transform: scale(0.98);
}
.quiz-opt.selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.quiz-opt-label {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #666;
  flex-shrink: 0;
}
.quiz-opt.selected .quiz-opt-label {
  background: var(--primary);
  color: #fff;
}
.quiz-opt-text {
  font-size: 15px;
  color: #333;
  line-height: 1.5;
  padding-top: 3px;
}

/* 結果頁 */
.result-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
  background: var(--result-bg);
  min-height: 100vh;
  gap: 20px;
}
.result-screen.active {
  display: flex;
}

/* 分享頁 */
.share-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
  background: var(--result-bg);
  min-height: 100vh;
  gap: 20px;
}
.share-screen.active {
  display: flex;
}
.result-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
}
.result-canvas-wrap {
  width: 100%;
  max-width: 300px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.result-canvas-wrap.shrink {
  max-width: 240px;
}
.result-canvas-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
}
/* 結果頁按鈕 */
.result-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin-top: 20px;
}
.result-btns-row {
  display: flex;
  gap: 12px;
  width: 100%;
}
.result-btn {
  flex: 1;
  padding: 16px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Noto Sans TC', sans-serif;
  border: none;
  transition: opacity 0.2s;
  text-align: center;
}
.result-btn:active {
  opacity: 0.8;
}
.result-btn.primary {
  background: var(--primary);
  color: #fff;
}
.result-btn.secondary {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.result-btn.full-width {
  flex: none;
  width: 100%;
}
/* IG 分享步驟區塊 */
.ig-share-section {
  width: 100%;
  max-width: 400px;
  display: none;
}
.ig-share-section.show {
  display: block;
}
.ig-share-toast {
  background: #444;
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
  margin-bottom: 20px;
}
.ig-share-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #666;
  font-size: 14px;
  margin-bottom: 16px;
}
.ig-share-title::before,
.ig-share-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #ccc;
}
.ig-share-title svg {
  width: 20px;
  height: 20px;
}
.ig-share-steps {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.ig-share-steps.two-steps {
  justify-content: center;
  gap: 48px;
}
.ig-step {
  flex: 1;
  text-align: center;
}
.ig-step-label {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.ig-step-btn {
  display: inline-block;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  background: transparent;
  border: 1.5px solid #333;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Noto Sans TC', sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
}
.ig-step-btn:active {
  background: #333;
  color: #fff;
}
.ig-step-text {
  font-size: 13px;
  color: #333;
  font-weight: 500;
}
.result-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.result-toast.show {
  opacity: 1;
}
