/* ============================================
   型遇 TypeMeet — 用户端样式
   年轻潮流风：渐变 + 圆角 + 卡片 + emoji
   ============================================ */

:root {
  --primary: #9B8EC7;
  --primary-dark: #7B6FA7;
  --primary-light: #B8AED4;
  --accent: #F4A28C;
  --accent-light: #F8C4B4;
  --bg: #F7F2E8;
  --card-bg: #FFFFFF;
  --text: #1A1A1A;
  --text-light: #5A5A5A;
  --text-lighter: #9A9A9A;
  --border: #EBE5DB;
  --success: #00B894;
  --danger: #E17055;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(155, 142, 199, 0.08);
  --shadow-hover: 0 8px 30px rgba(155, 142, 199, 0.15);
  --max-width: 420px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

.hidden { display: none !important; }

/* ===== 首页 Hero ===== */
.hero {
  position: relative;
  padding: 60px 24px 40px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: -50px; left: -50px; right: -50px;
  height: 400px;
  background: linear-gradient(135deg, #9B8EC7 0%, #B8AED4 40%, #F4A28C 100%);
  border-radius: 0 0 50% 50% / 0 0 30px 30px;
  z-index: 0;
}

.hero-content { position: relative; z-index: 1; }

.logo-emoji {
  font-size: 56px;
  margin-bottom: 16px;
  display: inline-block;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.15));
}

.logo-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border: 4px solid rgba(255,255,255,0.3);
}

.logo-img-small {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 12px;
}

.brand {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.tagline {
  font-size: 15px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 4px;
}

.subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

/* ===== 用户卡片 ===== */
.user-card {
  margin: -20px 20px 24px;
  position: relative;
  z-index: 2;
}

.user-card-inner {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}

.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-male { background: linear-gradient(135deg, #74B9FF, #0984E3); }
.avatar-female { background: linear-gradient(135deg, #F4A28C, #E89B8C); }

.user-nickname {
  font-size: 18px;
  font-weight: 700;
}

.user-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.user-gender {
  font-size: 13px;
  color: var(--text-light);
}

/* ===== MBTI 徽章 ===== */
.mbti-badge {
  display: inline-block;
  padding: 2px 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ===== 按钮区 ===== */
.action-area {
  padding: 0 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  text-decoration: none;
  display: block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 15px rgba(155, 142, 199, 0.3);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(155, 142, 199, 0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--card-bg);
  color: var(--primary);
  border: 2px solid var(--primary-light);
}

.btn-secondary:hover { background: rgba(155, 142, 199, 0.05); }

.btn-full { width: 100%; }

/* ===== 特性介绍 ===== */
.features {
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feature-icon { font-size: 32px; flex-shrink: 0; }

.feature-text h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.feature-text p { font-size: 13px; color: var(--text-light); }

/* ===== Footer ===== */
.footer {
  padding: 20px 24px 32px;
  text-align: center;
}
.footer p { font-size: 12px; color: var(--text-lighter); }

/* ===== 导航栏 ===== */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--card-bg);
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-back {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.nav-title { font-size: 16px; font-weight: 700; }

/* ===== 表单 ===== */
.form-container { padding: 24px 20px; }

.form-header { text-align: center; margin-bottom: 32px; }
.form-header .logo-emoji { font-size: 40px; margin-bottom: 8px; }
.form-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.form-desc { font-size: 14px; color: var(--text-light); }

.form-group { margin-bottom: 24px; }
.form-group > label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  background: var(--card-bg);
}

input[type="text"]:focus { border-color: var(--primary-light); }

/* MBTI 维度选择器 */
.mbti-selector { display: flex; flex-direction: column; gap: 12px; }

.dim-group {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.dim-label {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
  font-weight: 600;
}

.dim-options { display: flex; gap: 10px; }

.dim-btn {
  flex: 1;
  padding: 14px 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dim-btn span { font-size: 11px; font-weight: 500; color: var(--text-light); }

.dim-btn.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(155,142,199,0.08), rgba(184,174,212,0.05));
  color: var(--primary);
}

.dim-btn.active span { color: var(--primary); }

.mbti-preview {
  margin-top: 12px;
  text-align: center;
  padding: 16px;
  background: linear-gradient(135deg, rgba(155,142,199,0.05), rgba(244,162,140,0.05));
  border-radius: 12px;
}

.mbti-result {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--primary);
  display: block;
}

.mbti-type-name {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
  display: block;
}

/* 选项按钮组 */
.option-group { display: flex; gap: 10px; }

.opt-btn {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s;
}

.opt-btn.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(155,142,199,0.08), rgba(184,174,212,0.05));
  color: var(--primary);
}

/* ===== 匹配结果页 ===== */
.result-area { padding: 20px; }

.result-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.result-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.result-nickname { font-size: 18px; font-weight: 700; }

.result-tip {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
  text-align: center;
}

.result-tip strong { color: var(--primary); }

.match-list { display: flex; flex-direction: column; gap: 16px; }

.match-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s;
}

.match-card:hover { box-shadow: var(--shadow-hover); }

.match-card-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.match-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.match-info { flex: 1; }

.match-name { font-size: 17px; font-weight: 700; margin-bottom: 2px; }

.match-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.match-gender { font-size: 13px; color: var(--text-light); }

/* 分数徽章 */
.score-badge {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
}

.score-value { font-size: 20px; line-height: 1; }
.score-label { font-size: 9px; opacity: 0.85; text-transform: uppercase; }

.score-10 { background: linear-gradient(135deg, #00B894, #00CEC9); }
.score-9 { background: linear-gradient(135deg, #9B8EC7, #B8AED4); }
.score-8 { background: linear-gradient(135deg, #7B6FA7, #9B8EC7); }
.score-7 { background: linear-gradient(135deg, #9B8EC7, #B8AED4); }
.score-6 { background: linear-gradient(135deg, #F4A28C, #E17055); }
.score-5 { background: linear-gradient(135deg, #B8AED4, #9B8EC7); }
.score-below5 { background: linear-gradient(135deg, #B2BEC3, #636E72); }

/* 关系名 */
.match-relation {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(155, 142, 199, 0.1);
  color: var(--primary);
  margin-top: 6px;
}

/* 展开详情 */
.match-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.match-detail.open { max-height: 500px; }

.match-detail-inner {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  margin-top: 0;
  padding-top: 16px;
}

.match-detail-inner h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.match-explanation {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
}

.match-toggle {
  width: 100%;
  padding: 10px;
  background: rgba(155, 142, 199, 0.04);
  border: none;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.match-toggle:hover { background: rgba(155, 142, 199, 0.08); }

/* 加载动画 */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
}

.loader {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(155, 142, 199, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading p { color: var(--text-light); font-size: 14px; }

/* 无结果 */
.no-result {
  text-align: center;
  padding: 60px 20px;
}

.no-result-icon { font-size: 56px; margin-bottom: 16px; }
.no-result p { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.no-result-sub { font-size: 14px; color: var(--text-light); margin-bottom: 20px !important; }

/* ===== 新增表单元素 ===== */
.required { color: #E17055; font-weight: 700; }
.hint { font-size: 12px; color: var(--text-lighter); font-weight: 400; }

input[type="date"], textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  background: var(--card-bg);
  font-family: inherit;
  resize: none;
}

input[type="date"]:focus, textarea:focus { border-color: var(--primary-light); }

/* 多选标签组 */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-btn {
  position: relative;
  cursor: pointer;
}

.checkbox-btn input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-btn span {
  display: inline-block;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--card-bg);
  transition: all 0.2s;
  user-select: none;
}

.checkbox-btn input[type="checkbox"]:checked + span {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(155,142,199,0.1), rgba(184,174,212,0.05));
  color: var(--primary);
}

/* 匹配结果额外信息 */
.match-extra-info {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.info-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(155, 142, 199, 0.1);
  color: var(--primary);
}

.info-tag-city {
  background: rgba(244, 162, 140, 0.12);
  color: #E17055;
}
