/* === CSS Variables — 锘骅园区品牌色系 === */
:root {
  --bg: #f4fafb;
  --bg-card: #ffffff;
  --ink: #2d3436;
  --muted: #636e72;
  --rule: #dfe6e9;
  --accent: #1AADB5;
  --accent-light: #e0f7f8;
  --accent2: #8BC53F;
  --accent2-light: #eef8e0;
  --success: #8BC53F;
  --success-light: #eef8e0;
  --warning: #f39c12;
  --warning-light: #fef9e7;
  --danger: #e74c3c;
  --danger-light: #fdedec;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* === App Container === */
#app {
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Progress Bar === */
#progress-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  padding: 12px 20px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.progress-track {
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  margin-bottom: 12px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  width: 0%;
  transition: width var(--transition);
}
.progress-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.4;
  transition: opacity var(--transition);
}
.step.active { opacity: 1; }
.step.completed { opacity: 0.7; }
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rule);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  transition: all var(--transition);
}
.step.active .step-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.step.completed .step-dot {
  background: var(--success);
}
.step-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* === Main Content === */
#main-content {
  flex: 1;
  padding: 24px 20px;
  overflow-y: auto;
}

/* === Page Transitions === */
.page {
  animation: fadeSlideIn 0.4s ease-out;
}
.page-exit {
  animation: fadeSlideOut 0.3s ease-in forwards;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

/* === Welcome Page === */
.welcome-page {
  text-align: center;
  padding: 40px 0;
}
.park-logo {
  width: 140px;
  height: 140px;
  margin: 0 auto 20px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}
.park-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}
.welcome-logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-lg);
}
.welcome-logo svg { width: 48px; height: 48px; }
.welcome-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 12px;
}
.welcome-subtitle {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.8;
}
.welcome-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 32px;
  text-align: left;
}
.feature-card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.feature-icon.blue { background: var(--accent-light); }
.feature-icon.teal { background: var(--accent2-light); }
.feature-icon.green { background: var(--success-light); }
.feature-icon.orange { background: var(--warning-light); }
.feature-text h4 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.feature-text p { font-size: 11px; color: var(--muted); line-height: 1.4; }

/* === Section Title === */
.section-header {
  text-align: center;
  margin-bottom: 24px;
}
.section-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}
.section-icon.blue { background: var(--accent-light); }
.section-icon.teal { background: var(--accent2-light); }
.section-icon.green { background: var(--success-light); }
.section-icon.orange { background: var(--warning-light); }
.section-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}
.section-desc {
  font-size: 14px;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto;
}

/* === Option Cards === */
.options-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.options-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.options-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.option-card {
  background: var(--bg-card);
  border: 2.5px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  overflow: hidden;
}
.option-card:active {
  transform: scale(0.97);
}
.option-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
}

/* --- Single select (角色/行业) --- */
.option-card.selected {
  border-color: var(--accent);
  border-width: 3px;
  background: var(--accent-light);
  box-shadow: 0 0 0 4px var(--accent-light);
  transform: scale(1.02);
}
.option-card.selected .option-icon {
  transform: scale(1.15);
}
.option-card.selected .option-title {
  color: var(--accent);
}
.option-card.selected::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
  animation: checkPop 0.3s ease;
}

/* --- Multi select (痛点) --- */
.option-card.multi-selected {
  border-color: var(--accent2);
  border-width: 3px;
  background: var(--accent2-light);
  box-shadow: 0 0 0 4px var(--accent2-light);
  transform: scale(1.02);
}
.option-card.multi-selected .option-icon {
  transform: scale(1.15);
}
.option-card.multi-selected .option-title {
  color: var(--accent2);
}
.option-card.multi-selected::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: var(--accent2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
  animation: checkPop 0.3s ease;
}

@keyframes checkPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

.option-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
  transition: transform 0.2s ease;
}
.option-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  transition: color 0.2s ease;
}
.option-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* === Multi-select hint === */
.select-hint {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.select-counter strong {
  color: var(--accent2);
  font-size: 16px;
}
.select-tip {
  font-size: 12px;
  opacity: 0.7;
}

/* === Text Input === */
.text-input-area {
  margin-bottom: 16px;
}

/* === Example Box (matching page) === */
.example-box {
  margin-top: 12px;
  border: 1px dashed var(--accent2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.example-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--accent2-light);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent2);
  transition: background var(--transition);
  user-select: none;
  -webkit-user-select: none;
}
.example-toggle:hover { background: #b8ecec; }
.example-toggle:active { transform: scale(0.99); }
.example-toggle-icon {
  font-size: 10px;
  transition: transform var(--transition);
}
.example-content {
  padding: 16px;
  background: var(--bg);
  animation: fadeSlideIn 0.3s ease-out;
}
.example-scenario {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 12px;
  line-height: 1.6;
}
.example-steps {
  font-size: 13px;
  color: var(--ink);
}
.example-steps ol {
  padding-left: 20px;
  margin-top: 8px;
}
.example-steps li {
  margin-bottom: 8px;
  line-height: 1.6;
  padding-left: 4px;
}

/* === Example Card (solution page) === */
.example-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.example-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.example-card-scenario {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.6;
}
.example-card-steps {
  font-size: 13px;
  color: var(--ink);
}
.example-card-steps ol {
  padding-left: 20px;
  margin-top: 8px;
}
.example-card-steps li {
  margin-bottom: 8px;
  line-height: 1.6;
}
.text-input-area textarea {
  width: 100%;
  min-height: 100px;
  padding: 16px;
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: border-color var(--transition);
  line-height: 1.6;
}
.text-input-area textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.text-input-area textarea::placeholder {
  color: var(--muted);
}

/* === Matching Results === */
.match-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  animation: fadeSlideIn 0.4s ease-out;
  animation-fill-mode: both;
}
.match-card:nth-child(1) { animation-delay: 0.1s; }
.match-card:nth-child(2) { animation-delay: 0.2s; }
.match-card:nth-child(3) { animation-delay: 0.3s; }
.match-card:nth-child(4) { animation-delay: 0.4s; }
.match-card:nth-child(5) { animation-delay: 0.5s; }
.match-card:nth-child(6) { animation-delay: 0.6s; }

.match-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.match-product-tag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: white;
}
.tag-ide { background: var(--accent); }
.tag-work { background: var(--accent2); }
.tag-cli { background: #8b5cf6; }
.tag-plugin { background: var(--warning); }
.tag-enterprise { background: var(--success); }

.match-title {
  font-size: 16px;
  font-weight: 700;
}
.match-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 12px;
}
/* === Analogy (比喻) === */
.match-analogy {
  background: var(--warning-light);
  border-left: 3px solid var(--warning);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 12px;
  line-height: 1.5;
}

.match-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.benefit-tag {
  padding: 4px 12px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* === Solution Page === */
.solution-page {
  padding-bottom: 20px;
}
.solution-header {
  text-align: center;
  margin-bottom: 24px;
}
.solution-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
}
.solution-summary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}
.solution-summary h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  opacity: 0.9;
}
.solution-items {
  list-style: none;
}
.solution-items li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  font-size: 14px;
  line-height: 1.5;
}
.solution-items li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
}

.solution-section {
  margin-bottom: 24px;
}
.solution-section h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.solution-section h3 .icon {
  font-size: 20px;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.benefit-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.benefit-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}
.benefit-label {
  font-size: 12px;
  color: var(--muted);
}

.action-cards {
  display: grid;
  gap: 12px;
}
.action-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--rule);
}
.action-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.action-card:active {
  transform: scale(0.98);
}
.action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.action-icon.blue { background: var(--accent-light); }
.action-icon.teal { background: var(--accent2-light); }
.action-icon.green { background: var(--success-light); }
.action-text h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.action-text p { font-size: 12px; color: var(--muted); }

/* === Navigation Buttons === */
#nav-buttons {
  position: sticky;
  bottom: 0;
  padding: 16px 20px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: var(--bg-card);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  display: flex;
  gap: 12px;
  z-index: 100;
}
.nav-btn {
  flex: 1;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  font-family: inherit;
}
.nav-btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  box-shadow: 0 4px 12px rgba(0,102,204,0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0,102,204,0.4);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--rule);
}
.btn-secondary:hover {
  background: var(--bg2);
  color: var(--ink);
}
.btn-start {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  padding: 16px 48px;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,102,204,0.3);
  transition: all var(--transition);
  font-family: inherit;
}
.btn-start:active { transform: scale(0.97); }

/* === Responsive === */
@media (max-width: 600px) {
  #main-content { padding: 16px 16px; }
  .welcome-features { grid-template-columns: 1fr; }
  .options-grid.cols-2 { grid-template-columns: 1fr; }
  .options-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .benefit-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .benefit-value { font-size: 22px; }
  .benefit-label { font-size: 11px; }
  .section-title { font-size: 20px; }
  .welcome-title { font-size: 24px; }
  .solution-summary { padding: 20px 16px; }
}

@media (min-width: 601px) and (max-width: 900px) {
  .options-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }

/* === Selection === */
::selection { background: var(--accent-light); color: var(--accent); }

/* === TRAE Link Section === */
.trae-link-section {
  background: linear-gradient(135deg, var(--accent-light), var(--accent2-light));
  border-radius: var(--radius);
  padding: 24px 20px !important;
  margin-top: 8px;
}
.trae-link-section h3 {
  margin-top: 0 !important;
}
.trae-link-section .action-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
}
.trae-link-section .action-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* === Customer Info Form === */
.customer-form {
  max-width: 480px;
  margin: 0 auto;
}
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.form-icon {
  font-size: 18px;
}
.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--bg-card);
  color: var(--ink);
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-input::placeholder {
  color: var(--muted);
  font-size: 14px;
}
.form-hint {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

/* === Solution Actions === */
.solution-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-top: 32px;
  flex-wrap: wrap;
}
.btn-download {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  border: 2px solid var(--accent);
  background: var(--bg-card);
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.btn-download:hover {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(26, 173, 181, 0.3);
}
.btn-download:active {
  transform: scale(0.97);
}

/* === History Page === */
.history-page {
  padding-bottom: 20px;
}
.history-empty {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 16px;
}
.history-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--rule);
}
.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.history-date {
  font-size: 12px;
  color: var(--muted);
}
.history-company {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}
.history-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.history-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.history-tag.teal {
  background: var(--accent2-light);
  color: var(--accent2);
}
.history-painpoints {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.history-pp-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--warning-light);
  color: var(--warning);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.history-products {
  font-size: 13px;
  color: var(--muted);
}

/* === Welcome History Link === */
.welcome-history-link {
  margin-top: 16px;
}
.btn-history {
  background: none;
  border: 1px solid var(--rule);
  color: var(--muted);
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.btn-history:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}