/* =============================================
   首页样式
   ============================================= */

.page-body {
  padding-top: 24px;
}

/* Hero区域 */
.hero-section {
  text-align: center;
  padding: 8px 0 24px;
}

.hero-icon {
  width: 80px; height: 80px;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light);
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(26,107,189,.15);
}

.hero-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-8);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.hero-sub {
  font-size: 14px;
  color: var(--gray-6);
}

/* 搜索框 */
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 0 50px 0 40px;
  border: 1.5px solid var(--gray-3);
  border-radius: 12px;
  font-size: 15px;
  color: var(--gray-8);
  background: var(--gray-1);
  transition: all var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,107,189,.12);
}

.search-input::placeholder { color: var(--gray-5); }

.search-clear {
  position: absolute;
  right: 10px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-3);
  border-radius: 50%;
}

/* 搜索结果 */
.search-result {
  margin-top: 10px;
  border: 1px solid var(--gray-3);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}

.result-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-3);
  cursor: pointer;
  transition: background var(--transition);
}

.result-item:last-child { border-bottom: none; }
.result-item:active { background: var(--primary-lighter); }

.result-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-right: 12px;
  flex-shrink: 0;
  background: var(--primary);
}

.result-avatar.female { background: #e84393; }

.result-main { flex: 1; min-width: 0; }

.result-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-8);
  margin-bottom: 2px;
}

.result-sub {
  font-size: 12px;
  color: var(--gray-6);
}

.result-status {
  margin-left: 8px;
}

.result-empty {
  padding: 16px;
  text-align: center;
  color: var(--gray-5);
  font-size: 14px;
}

.result-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border-top: 1px solid var(--gray-3);
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.result-add:active {
  background: var(--primary-light);
}

/* 已选人员 */
.selected-card {
  margin-top: 12px;
}

.btn-text {
  background: none;
  color: var(--primary);
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
}
.btn-text:active { background: var(--primary-light); }

.selected-info {}

.selected-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.selected-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-8);
}

.gender-chip, .age-chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
}

.selected-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-7);
}

.meta-row svg { color: var(--gray-5); flex-shrink: 0; }

/* 底部入口 */
.bottom-entry {
  margin-top: 20px;
}

.entry-item {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  gap: 12px;
  transition: all var(--transition);
}

.entry-item:active { background: var(--gray-1); }

.entry-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.entry-item span {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-8);
}

.entry-arrow { flex-shrink: 0; }

/* 扫码按钮（在输入框内右侧） */
.scan-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26,107,189,.1);
  color: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: right .2s ease;
}
.scan-btn:active { background: rgba(26,107,189,.2); }

/* 有输入内容时，扫码按钮左移给清除按钮让位 */
.search-input-wrap.has-value .scan-btn {
  right: 48px;
}

/* 扫码弹窗 */
.scan-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
}

.scan-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.scan-modal-close {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
}
.scan-modal-close:active { background: rgba(255,255,255,.25); }

.scan-modal-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-canvas { display: none; }

/* 扫描框 */
.scan-guide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.scan-guide-frame {
  width: 220px; height: 220px;
  position: relative;
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 12px;
}

.scan-guide-frame .corner {
  position: absolute;
  width: 24px; height: 24px;
}

.scan-guide-frame .corner::before,
.scan-guide-frame .corner::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 2px;
}

.scan-guide-frame .corner-tl { top: -2px; left: -2px; }
.scan-guide-frame .corner-tl::before { top: 0; left: 0; width: 24px; height: 3px; }
.scan-guide-frame .corner-tl::after  { top: 0; left: 0; width: 3px; height: 24px; }

.scan-guide-frame .corner-tr { top: -2px; right: -2px; }
.scan-guide-frame .corner-tr::before { top: 0; right: 0; width: 24px; height: 3px; }
.scan-guide-frame .corner-tr::after  { top: 0; right: 0; width: 3px; height: 24px; }

.scan-guide-frame .corner-bl { bottom: -2px; left: -2px; }
.scan-guide-frame .corner-bl::before { bottom: 0; left: 0; width: 24px; height: 3px; }
.scan-guide-frame .corner-bl::after  { bottom: 0; left: 0; width: 3px; height: 24px; }

.scan-guide-frame .corner-br { bottom: -2px; right: -2px; }
.scan-guide-frame .corner-br::before { bottom: 0; right: 0; width: 24px; height: 3px; }
.scan-guide-frame .corner-br::after  { bottom: 0; right: 0; width: 3px; height: 24px; }

.scan-guide-text {
  margin-top: 16px;
  color: rgba(255,255,255,.6);
  font-size: 14px;
}
