/* ════════════════════════════════════════════
   心动互选 - 移动端样式
   ════════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #e91e63;
  --primary-dark: #c2185b;
  --primary-light: #fce4ec;
  --male: #2196f3;
  --male-light: #e3f2fd;
  --female: #e91e63;
  --female-light: #fce4ec;
  --success: #27ae60;
  --warn: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;
  --bg: #f8f5f2;
  --card-bg: #fff;
  --text: #333;
  --text-light: #888;
  --border: #eee;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #fce4ec 0%, #f8f5f2 30%, #e3f2fd 70%, #fce4ec 100%);
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* ── Container ── */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 100px;
}

.admin-container {
  padding-bottom: 80px;
}

/* ── Header ── */
.header {
  text-align: center;
  padding: 24px 0 16px;
}

.header h1 {
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--female), var(--male));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.header .subtitle {
  font-size: 13px;
  color: var(--text-light);
}

/* ── Card ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title.success { color: var(--success); }
.card-title.warn { color: var(--warn); }

/* ── Form ── */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #555;
}

.form-group .required { color: var(--danger); }
.form-group .optional { color: var(--text-light); font-weight: 400; }

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  color: var(--text);
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233,30,99,0.1);
  background: #fff;
}

.form-group select {
  width: 100%;
  padding: 12px 36px 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  color: var(--text);
  background: #fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23888' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E") no-repeat right 12px center;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233,30,99,0.1);
  background-color: #fff;
}

.hint {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
}

.btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(233,30,99,0.3);
}

.btn-primary:active {
  box-shadow: 0 2px 8px rgba(233,30,99,0.2);
}

.btn-warn {
  background: linear-gradient(135deg, var(--warn), #e67e22);
  color: #fff;
  box-shadow: 0 4px 14px rgba(243,156,18,0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #c0392b);
  color: #fff;
  box-shadow: 0 4px 14px rgba(231,76,60,0.3);
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:active {
  background: var(--primary-light);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-warning {
  background: linear-gradient(135deg, var(--warn), #e67e22);
  color: #fff;
  box-shadow: 0 4px 14px rgba(243,156,18,0.3);
}

.btn-block {
  display: flex;
  width: 100%;
  margin-top: 6px;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn-row .btn-sm {
  flex: 1;
  min-width: 0;
}

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-live {
  background: #ffe0ec;
  color: #c2185b;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Table ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table th {
  text-align: left;
  padding: 6px 8px;
  background: #f8f9fa;
  font-weight: 600;
  color: #666;
}
table td {
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
}

/* ── Gender Select ── */
.gender-select {
  display: flex;
  gap: 10px;
}

.btn-gender {
  flex: 1;
  padding: 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-gender.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.btn-gender:active {
  transform: scale(0.97);
}

/* ── Choice Grid ── */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.choice-btn {
  padding: 10px 4px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.choice-btn:active {
  transform: scale(0.95);
}

.choice-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

/* ── Selected Bar ── */
.selected-bar {
  background: var(--primary-light);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
}

/* ── Info Row ── */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 15px;
}

.info-row:last-child { border-bottom: none; }

.info-label { color: var(--text-light); }
.info-value { font-weight: 600; }

/* ── Desc ── */
.desc {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-live {
  background: #d4edda;
  color: #155724;
}

.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

.badge-warn {
  background: #fff3cd;
  color: #856404;
}

/* ── Tags ── */
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  background: #f0f0f0;
  color: var(--text-light);
}

/* ── Chose List ── */
.chose-list { margin-top: 8px; }

.chose-item {
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}

/* ── Match Result ── */
.match-result {
  text-align: center;
  padding: 20px 0;
  color: var(--success);
  font-size: 16px;
}

.match-result p {
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Status Banner ── */
.status-banner {
  margin-bottom: 12px;
}

/* ── Result Table ── */
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 8px;
}

.result-table th {
  background: #f8f9fa;
  padding: 8px 6px;
  text-align: center;
  font-weight: 600;
  border-bottom: 2px solid #eee;
  font-size: 12px;
  color: #555;
}

.result-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
}

.result-table tbody tr:hover {
  background: #fafafa;
}

/* ── Progress Bar ── */
.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.progress-bar-wrap span:first-child {
  width: 90px;
  flex-shrink: 0;
  color: var(--text-light);
}

.progress-bar-wrap span:last-child {
  width: 60px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 600;
  font-size: 12px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-fill.male { background: var(--male); }
.progress-fill.female { background: var(--female); }
.progress-fill.warn { background: var(--warn); }

/* ── TOP3 ── */
.top-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 15px;
}

.top-item:last-child { border-bottom: none; }

.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.rank-1 { background: linear-gradient(135deg, #f39c12, #e74c3c); }
.rank-2 { background: linear-gradient(135deg, #bdc3c7, #95a5a6); }
.rank-3 { background: linear-gradient(135deg, #e67e22, #d35400); }

/* ── Footer ── */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 16px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999;
  margin: 0 6px;
}

.round-label {
  font-size: 12px;
  color: var(--text-light);
}

/* ── View Switching ── */
.view { display: none; }
.view.active { display: block; }

/* ── Responsive ── */
@media (max-width: 360px) {
  .choice-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .choice-btn { padding: 8px 2px; font-size: 12px; }
  .btn { padding: 10px 20px; font-size: 14px; }
}

/* ── Animations ── */
.card {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 0px; }

/* ════════════════════════════════════════════
   互选分析 - 新增样式（红色冲突/绿色阶段）
   ════════════════════════════════════════════ */

/* 分析区域块 */
.analysis-section {
  margin: 12px 0;
  padding: 12px;
  border-radius: 8px;
  border: 1.5px solid transparent;
}

.section-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.section-desc {
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
}

/* 1V1 自动锁定区 */
.section-locked {
  background: #eafaf1;
  border-color: #7dcea0;
}
.section-locked .section-title {
  color: #1e8449;
}

/* 多人互选区 */
.section-multi {
  background: #fdf2e9;
  border-color: #d4a373;
}
.section-multi .section-title {
  color: #a04000;
}

/* 红色冲突盒 */
.red-conflict-box {
  background: #fde8e8;
  border: 2px solid #e74c3c;
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}

.red-title {
  color: #c0392b;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}

.red-desc {
  font-size: 12px;
  color: #e74c3c;
  margin-bottom: 8px;
  line-height: 1.4;
}

.red-row {
  background: #fdedec !important;
}
.red-row td {
  padding: 10px 6px !important;
}

/* 红色标签 */
.tag-red-conflict {
  display: inline-block;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e74c3c !important;
  color: #fff !important;
  font-weight: 600;
  margin-right: 4px;
  animation: redPulse 1.5s ease-in-out infinite;
}

.tag-red-option {
  display: inline-block;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #fce4e4 !important;
  color: #c0392b !important;
  margin-right: 4px;
  border: 1px solid #e74c3c;
}

@keyframes redPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); }
}

/* 绿色非冲突盒 */
.green-conflict-box {
  background: #e8f8f0;
  border: 2px solid #27ae60;
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}

.green-title {
  color: #1e8449;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}

.green-desc {
  font-size: 12px;
  color: #27ae60;
  margin-bottom: 8px;
  line-height: 1.4;
}

.tag-green-option {
  display: inline-block;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #d5f5e3 !important;
  color: #1e8449 !important;
  margin-right: 4px;
  border: 1px solid #27ae60;
}

/* 冲突链说明 */
.conflict-note {
  font-size: 12px;
  color: #e74c3c;
  margin-top: 6px;
  padding: 6px 10px;
  background: #fadbd8;
  border-radius: 4px;
}

/* 阶段标签 */
.phase-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #e74c3c;
  color: #fff;
  margin-left: 6px;
  vertical-align: middle;
}

.phase-badge.phase-green {
  background: #27ae60;
  color: #fff;
}

/* 全部互选对下拉 */
.analysis-details {
  margin-top: 8px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
}

.analysis-details summary {
  padding: 6px 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #ddd;
}

/* ════════════════════════════════════════════
   弹窗组件（编号选择、心仪选择）
   ════════════════════════════════════════════ */

/* ── 弹窗通用 ── */
.popup-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}
.popup-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  width: 92%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  animation: popIn 0.25s;
}
.popup-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 4px;
}
.popup-hint {
  text-align: center;
  font-size: 13px;
  color: #999;
  margin-bottom: 16px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* ── 编号选择按钮 ── */
.num-picker-btn {
  width: 100%;
  padding: 13px 14px;
  border: 2px dashed #ccc;
  border-radius: 10px;
  font-size: 16px;
  background: #fafafa;
  color: #999;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.num-picker-btn:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.num-picker-btn:not(:disabled):hover { background: #fff5f8; }
.num-picker-btn:disabled { cursor: not-allowed; opacity: 0.6; }
.num-picker-btn.selected { border-style: solid; background: #fff5f8; color: var(--primary); font-weight: 700; }

/* ── 编号/心仪网格 ── */
.number-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.num-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.num-btn:hover { border-color: var(--primary); background: #fff5f8; }
.num-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.num-btn.selected { border-color: var(--primary); background: var(--primary); color: #fff; }
.num-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  background: #eee;
  border-color: #ddd;
  color: #bbb;
}
.num-btn.occupied {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
  background: #f5f5f5;
  border-color: #e0e0e0;
  color: #ccc;
  text-decoration: line-through;
}

/* 心仪选择按钮（非正方形） */
.choice-popup-btn {
  aspect-ratio: auto;
  min-height: 42px;
  padding: 10px 6px;
  font-size: 14px;
}

/* ── 确认列表 ── */
.confirm-list {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
  max-height: 200px;
  overflow-y: auto;
}
.confirm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  font-size: 15px;
}
.confirm-item:last-child { border-bottom: none; }
.confirm-item .tag {
  background: var(--primary);
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
}
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }

/* 弹窗内选择栏 */
.selected-bar-popup {
  background: #fff5f8;
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--primary);
  line-height: 1.6;
}

/* ── 心仪选择弹窗：底部操作栏固定，中间可滚动 ── */
.choice-popup-box {
  display: flex;
  flex-direction: column;
  width: 94%;
  max-width: 460px;
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
}
.choice-popup-header {
  padding: 24px 20px 8px;
  flex-shrink: 0;
}
.choice-popup-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 20px;
  -webkit-overflow-scrolling: touch;
}
.choice-popup-footer {
  padding: 12px 20px 20px;
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #f0f0f0;
}

/* 隐私提示 */
.privacy-note {
  background: #fef9e7;
  border: 1px solid #f9e79f;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #9a7d0a;
  text-align: center;
  margin-top: 12px;
}
