/* ==========================================
   BigParty H5 · 座位查询
   移动端优先 · 庆典主题
   ========================================== */

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #F7F4ED;
  color: #2D3748;
  min-height: 100vh;
  padding-bottom: 60px;
  -webkit-font-smoothing: antialiased;
}

/* ---- 顶部 ---- */
/* （原 header 已替换为 invite 邀请函区） */

/* ==================== 邀请函 ==================== */
.invite {
  background: linear-gradient(180deg, #8B1A1A 0%, #A32222 30%, #B72727 100%);
  padding: 0 20px 28px;
  color: #FFF;
  position: relative;
  overflow: hidden;
}
/* 背景暗纹 */
.invite::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(255,255,255,0.015) 8px,
    rgba(255,255,255,0.015) 10px
  );
  pointer-events: none;
}

/* 装饰线 */
.invite-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0 10px;
}
.invite-ornament-top {
  padding-top: 24px;
}
.invite-ornament-bottom {
  padding-bottom: 0;
}
.ornament-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,215,0,0.6), transparent);
  max-width: 80px;
}
.ornament-diamond {
  color: #D4A017;
  font-size: 10px;
  letter-spacing: 4px;
}

/* 邀请标题 */
.invite-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 3px;
  line-height: 1.6;
  padding: 6px 0 16px;
  color: #FFD700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* 正文 */
.invite-body {
  font-size: 14px;
  line-height: 2;
  color: rgba(255,255,255,0.92);
  text-align: justify;
}
.invite-body p {
  text-indent: 2em;
  margin-bottom: 8px;
}
.invite-body p:first-child {
  text-indent: 0;
  font-weight: 600;
  font-size: 15px;
}
.invite-body strong {
  color: #FFD700;
  font-weight: 700;
}

/* 落款 */
.invite-sign {
  text-align: right;
  padding: 12px 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 2px;
}

/* ==================== 重要公告 ==================== */
.notice {
  margin: 16px;
  background: #FFF;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
  border-left: 4px solid #C53030;
}
.notice-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #F0EBE3;
}
.notice-icon {
  font-size: 18px;
}
.notice-title {
  font-size: 16px;
  font-weight: 700;
  color: #C53030;
}
.notice-body {
  padding: 14px 16px 16px;
}
.notice-body > p {
  font-size: 14px;
  line-height: 1.8;
  color: #4A5568;
  margin-bottom: 14px;
}
.notice-body strong {
  color: #C53030;
}

/* 时间线 */
.notice-timeline {
  position: relative;
  padding-left: 8px;
}
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  position: relative;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: #E8E0D5;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #C53030;
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.timeline-content {
  flex: 1;
}
.timeline-time {
  font-size: 13px;
  font-weight: 700;
  color: #C53030;
  margin-bottom: 2px;
}
.timeline-text {
  font-size: 13px;
  color: #718096;
}

/* ==================== 分割线 ==================== */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  margin-top: 4px;
}
.divider-line {
  flex: 1;
  height: 1px;
  background: #E2D9CC;
}
.divider-text {
  font-size: 13px;
  color: #A0AEC0;
  font-weight: 600;
  letter-spacing: 2px;
  white-space: nowrap;
}

/* ==================== 座位查询区 ==================== */
.lookup-section {
  /* 无额外样式，tabs 从 sticky 变为静态（跟随滚动） */
}
.lookup-section .tabs {
  position: static;
  border-top: 1px solid #E8E0D5;
}

/* ---- Tab ---- */
.tabs {
  display: flex;
  background: #FFF;
  border-bottom: 1px solid #E8E0D5;
  position: sticky;
  top: 0;
  z-index: 50;
}
.tab {
  flex: 1;
  padding: 14px 0;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: #A0AEC0;
  cursor: pointer;
  transition: color 0.2s, box-shadow 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab:active {
  background: #FAF7F2;
}
.tab-active {
  color: #C53030;
  box-shadow: inset 0 -3px 0 #C53030;
}
.tab-icon {
  font-size: 17px;
}

/* ---- 面板 ---- */
.panel {
  padding: 16px;
}
.panel-hidden {
  display: none;
}

/* ---- 搜索框 ---- */
.search-box {
  display: flex;
  align-items: center;
  background: #FFF;
  border: 1.5px solid #E2D9CC;
  border-radius: 12px;
  padding: 0 14px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}
.search-box:focus-within {
  border-color: #C53030;
  box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.08);
}
.search-icon {
  font-size: 16px;
  margin-right: 8px;
  opacity: 0.5;
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  padding: 12px 0;
  background: transparent;
  color: #2D3748;
}
.search-input::placeholder {
  color: #C4B5A5;
}
/* 清除 Safari 搜索框默认样式 */
input[type="search"] {
  -webkit-appearance: none;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  display: none;
}

/* ---- 空状态 ---- */
.empty-hint {
  text-align: center;
  padding: 60px 20px;
}
.empty-hint.hidden {
  display: none;
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-text {
  font-size: 15px;
  color: #A0AEC0;
  line-height: 1.5;
}

/* ---- 人员卡片 ---- */
.person-card {
  background: #FFF;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  cursor: default;
  transition: box-shadow 0.2s;
}
.person-card:active {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-name {
  font-size: 16px;
  font-weight: 700;
  color: #2D3748;
}
.card-gender {
  font-size: 13px;
  color: #718096;
}
.card-relation {
  font-size: 13px;
  color: #718096;
  margin-top: 4px;
}

/* ---- 桌信息行 ---- */
.card-table {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
  background: #FFFBF0;
  border: 1px solid #F0E6D2;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.card-table:active {
  background: #FFF3D6;
}
.card-no-table {
  background: #F7FAFC;
  border-color: #E2E8F0;
  color: #A0AEC0;
  cursor: default;
  justify-content: center;
}
.table-icon {
  font-size: 16px;
}
.table-name {
  font-weight: 600;
  color: #C53030;
  flex: 1;
}
.table-count {
  font-size: 12px;
  color: #A0AEC0;
}
.table-arrow {
  font-size: 18px;
  color: #CBD5E0;
  transition: transform 0.2s;
}

/* ---- 桌详情展开 ---- */
.table-detail {
  display: none;
  margin-top: 8px;
  background: #FAF7F2;
  border-radius: 8px;
  overflow: hidden;
}
.table-detail.detail-open {
  display: block;
  animation: detailIn 0.25s ease;
}
@keyframes detailIn {
  from { opacity: 0; max-height: 0; }
  to   { opacity: 1; max-height: 600px; }
}
.detail-header {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #4A5568;
  border-bottom: 1px solid #E8E0D5;
}
.detail-list {
  padding: 6px 0;
}
.detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 14px;
  border-bottom: 1px solid #F0EBE3;
}
.detail-item:last-child {
  border-bottom: none;
}
.detail-num {
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #C53030;
  background: #FFF;
  border-radius: 50%;
  flex-shrink: 0;
}
.detail-name {
  font-weight: 600;
  flex: 1;
}
.detail-gender {
  font-size: 12px;
  color: #A0AEC0;
}
.detail-rel-desc {
  font-size: 12px;
  color: #718096;
  margin-left: 4px;
}
.detail-loading,
.detail-error,
.detail-empty {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: #A0AEC0;
}

/* ---- Badge ---- */
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  line-height: 1.6;
}
.badge-spouse {
  background: #FFF0F0;
  color: #C53030;
}
.badge-child {
  background: #FFF8E7;
  color: #B7791F;
}
.badge-kid {
  background: #EBF8FF;
  color: #2B6CB0;
}

/* ---- 联系人分组 ---- */
.contact-section {
  margin-bottom: 20px;
}
.contact-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 12px;
  border-bottom: 2px solid #C53030;
  margin-bottom: 10px;
}
.contact-name {
  font-size: 17px;
  font-weight: 700;
  color: #C53030;
}
.contact-phone {
  font-size: 13px;
  color: #718096;
  flex: 1;
}
.contact-count {
  font-size: 12px;
  color: #A0AEC0;
  background: #F7FAFC;
  padding: 3px 10px;
  border-radius: 10px;
}

/* ---- 页脚 ---- */
.footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 12px;
  color: #C4B5A5;
}

/* ==================== Toast ==================== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(45, 55, 72, 0.92);
  color: #FFF;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  max-width: 80vw;
  text-align: center;
  white-space: pre-wrap;
}
.toast-show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ==================== Loading ==================== */
.loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.6);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.loading-show {
  opacity: 1;
  pointer-events: auto;
}
.loading-spin {
  width: 32px;
  height: 32px;
  border: 3px solid #E2E8F0;
  border-top-color: #C53030;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-text {
  margin-top: 12px;
  font-size: 14px;
  color: #718096;
}

/* ==================== 响应式：桌面端居中 ==================== */
@media (min-width: 640px) {
  body {
    background: #EDE8DE;
  }
  .app-container {
    max-width: 480px;
    margin: 0 auto;
    background: #F7F4ED;
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0,0,0,0.08);
  }
}
