/* ============================================
   WorkBuddy 课前调研中心 · 共享样式
   所有问卷页面继承此文件
   ============================================ */

:root {
  --brand: #4ecba0;
  --brand-deep: #2ea87a;
  --brand-light: rgba(78,203,160,.1);
  --c-blue: #0ea5e9;
  --c-purple: #8b5cf6;
  --c-amber: #f59e0b;
  --text: #1a1a2e;
  --text-2: #5a5a72;
  --text-3: #8e8ea0;
  --bg: #fafbfc;
  --card-bg: #fff;
  --border: #e8ecf1;
  --radius: 20px;
  --radius-sm: 12px;
  --nav-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-h);
  text-wrap: pretty;
}

/* ===== NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; color: var(--text);
  text-decoration: none;
}
.nav-logo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
}
.nav-progress {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text-3);
}
.nav-progress-bar {
  width: 120px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.nav-progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  transition: width .4s ease;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(160deg, #0f1923 0%, #1a2a3a 40%, #162635 100%);
  position: relative;
  overflow: hidden;
  padding: 80px 40px 70px;
  text-align: center;
  color: #fff;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -30%;
  width: 160%; height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(78,203,160,.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 30%, rgba(14,165,233,.06) 0%, transparent 50%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--c-blue), var(--c-purple));
}
.hero-inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hero-tag {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 100px;
  background: rgba(78,203,160,.12);
  color: var(--brand);
  font-size: 13px; font-weight: 600;
  letter-spacing: .05em;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 40px; font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.3;
  margin-bottom: 16px;
}
.hero h1 span { color: var(--brand); }
.hero .hero-sub {
  color: rgba(255,255,255,.55);
  font-size: 15px; line-height: 1.7;
  max-width: 500px; margin: 0 auto 32px;
}
.hero-meta {
  display: flex; justify-content: center; gap: 32px;
  font-size: 14px; color: rgba(255,255,255,.45);
}
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.hero-meta .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

/* ===== LAYOUT ===== */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ===== INTRO CARD ===== */
.intro-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 36px 40px;
  margin-top: -30px;
  position: relative; z-index: 2;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  border: 1px solid var(--border);
}
.intro-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.intro-card p { font-size: 14px; color: var(--text-2); margin-bottom: 10px; line-height: 1.7; }
.intro-card ul { font-size: 14px; color: var(--text-2); padding-left: 20px; margin-bottom: 16px; }
.intro-card ul li { margin-bottom: 4px; }
.privacy-note {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-3);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ===== SURVEY SECTION ===== */
.survey-section { margin-top: 40px; }
.section-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
.section-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-deep);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  flex-shrink: 0;
}
.section-title {
  font-size: 20px; font-weight: 700; color: var(--text);
  line-height: 1.3;
}
.section-subtitle {
  font-size: 14px; color: var(--text-3); margin-top: 2px;
}

/* ===== QUESTION CARD ===== */
.q-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  transition: box-shadow .3s ease, border-color .3s ease;
  position: relative;
}
.q-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.04);
  border-color: #dde2e8;
}
.q-card.answered {
  border-left: 4px solid var(--brand);
}
.q-card .q-label {
  font-size: 12px; font-weight: 700;
  color: var(--brand-deep);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 6px;
}
.q-card .q-title {
  font-size: 17px; font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.q-card .q-type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  margin-bottom: 16px;
}
.badge-single { background: rgba(14,165,233,.1); color: #0ea5e9; }
.badge-multi { background: rgba(139,92,246,.1); color: #8b5cf6; }
.badge-scale { background: rgba(245,158,11,.1); color: #d97706; }
.badge-open { background: rgba(78,203,160,.1); color: #2ea87a; }
.badge-contact { background: rgba(14,165,233,.1); color: #7c3aed; }

.q-card .q-hint {
  font-size: 13px; color: var(--text-3);
  margin-bottom: 16px; line-height: 1.5;
}

/* ===== RADIO ===== */
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
}
.radio-option:hover { border-color: var(--brand); background: rgba(78,203,160,.03); }
.radio-option.selected { border-color: var(--brand); background: rgba(78,203,160,.06); }
.radio-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0; margin-top: 1px;
  transition: all .2s ease;
  display: flex; align-items: center; justify-content: center;
}
.radio-option.selected .radio-dot {
  border-color: var(--brand);
  background: var(--brand);
}
.radio-option.selected .radio-dot::after {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
}
.radio-text { flex: 1; }
.radio-text .rt-label { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.radio-text .rt-desc { font-size: 13px; color: var(--text-3); line-height: 1.5; }

/* horizontal radio for scale */
.radio-h-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-h-option {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .2s ease;
  min-width: 60px;
}
.radio-h-option:hover { border-color: var(--brand); background: rgba(78,203,160,.03); }
.radio-h-option.selected { border-color: var(--c-amber); background: rgba(245,158,11,.06); }
.radio-h-option .scale-num { font-size: 22px; font-weight: 700; color: var(--text); }
.radio-h-option .scale-label { font-size: 11px; color: var(--text-3); }
.scale-caption { font-size: 12px; color: var(--text-3); margin-top: 8px; }

/* ===== CHECKBOX (multi select) ===== */
.check-group { display: flex; flex-direction: column; gap: 8px; }
.check-option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
}
.check-option:hover { border-color: var(--c-purple); background: rgba(139,92,246,.02); }
.check-option.selected { border-color: var(--c-purple); background: rgba(139,92,246,.05); }
.check-option.limit-reached { opacity: .4; cursor: not-allowed; }
.check-option.limit-reached:hover { border-color: var(--border); background: transparent; }
.check-box {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  flex-shrink: 0; margin-top: 1px;
  transition: all .2s ease;
  display: flex; align-items: center; justify-content: center;
}
.check-option.selected .check-box {
  border-color: var(--c-purple);
  background: var(--c-purple);
}
.check-option.selected .check-box::after {
  content: ''; width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.check-text { flex: 1; }
.check-text .ct-label { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.check-text .ct-desc { font-size: 13px; color: var(--text-3); line-height: 1.5; }
.multi-counter {
  font-size: 12px; color: var(--c-purple); font-weight: 600;
  margin-bottom: 8px;
}

/* ===== TEXT AREA ===== */
.text-input-area {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
  background: var(--bg);
}
.text-input-area:focus { border-color: var(--brand); background: #fff; }
.text-input-area::placeholder { color: var(--text-3); }

/* ===== CONTACT FIELD ===== */
.contact-group { display: flex; flex-direction: column; gap: 10px; }
.contact-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
}
.contact-row label { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.contact-row input {
  border: none; outline: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  flex: 1;
}
.contact-optout {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-3);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  cursor: pointer;
  transition: all .2s;
}
.contact-optout:hover { border-color: var(--text-3); }
.contact-optout.selected { border-color: var(--brand); background: var(--brand-light); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 36px;
  border-radius: 100px;
  font-size: 15px; font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .25s ease;
  font-family: inherit;
  letter-spacing: .02em;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(78,203,160,.3);
}
.btn-submit {
  width: 100%;
  padding: 18px;
  font-size: 17px;
  margin-top: 20px;
}
.btn-submit:disabled {
  background: var(--border);
  color: var(--text-3);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-secondary {
  background: var(--bg);
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.submit-area {
  text-align: center;
  padding: 40px 0 80px;
}
.submit-warning {
  font-size: 13px; color: var(--text-3);
  margin-top: 8px;
}

/* ===== RESULTS PAGE ===== */
.results-page {
  display: none;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.results-page.active { display: block; }

.results-hero {
  text-align: center;
  padding: 48px 20px;
  background: linear-gradient(160deg, #0f1923, #1a2a3a, #162635);
  border-radius: var(--radius);
  color: #fff;
  margin-bottom: 32px;
}
.results-hero .check-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
}
.results-hero h2 { font-size: 28px; margin-bottom: 8px; }
.results-hero p { color: rgba(255,255,255,.55); font-size: 14px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; top: 80px; right: 24px;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  font-size: 13px; font-weight: 600;
  z-index: 999;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  animation: slideIn .3s ease;
}
.toast.show { display: block; }
.toast.error { background: #ef4444; }
@keyframes slideIn {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .hero { padding: 60px 20px 50px; }
  .hero h1 { font-size: 28px; }
  .hero-meta { flex-direction: column; gap: 8px; align-items: center; }
  .intro-card { padding: 24px 20px; }
  .q-card { padding: 20px 16px; }
  .radio-option, .check-option { padding: 12px 14px; }
  .radio-text .rt-label, .check-text .ct-label { font-size: 14px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .nav-progress { display: none; }
  .radio-h-group { justify-content: center; }
  .radio-h-option { min-width: 48px; padding: 10px 12px; }
}
