/* ── CSS Variables ── */
:root {
  --primary:        #FF00FA;
  --primary-dim:    rgba(255, 0, 250, 0.65);
  --primary-glow:   rgba(255, 0, 250, 0.18);
  --primary-subtle: rgba(255, 0, 250, 0.07);
  --primary-border: rgba(255, 0, 250, 0.18);

  --glass-bg:        rgba(255, 255, 255, 0.72);
  --glass-bg-hover:  rgba(255, 255, 255, 0.88);
  --glass-border:    rgba(255, 0, 250, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.95);

  --text-1: #1A0A2E;
  --text-2: #5A4070;
  --text-3: #A090B8;

  --danger:  #E8003A;
  --success: #00C87A;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, select { font-family: inherit; }

/* ── Body & Background ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  background: #FBF0FF;
  color: var(--text-1);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,0,250,0.14) 0%, transparent 65%);
  top: -150px; right: -100px;
}
body::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(160,0,255,0.10) 0%, transparent 65%);
  bottom: -100px; left: -120px;
}

/* ── App Layout ── */
#app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ── Hero Banner ── */
.hero {
  position: relative;
  padding: 28px 20px 22px;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,0,250,0.10) 0%, rgba(255,255,255,0) 100%);
  border-bottom: 1px solid rgba(255,0,250,0.12);
}
.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(255,0,250,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.hero-title {
  position: relative;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--primary);
  text-shadow: 0 2px 20px rgba(255,0,250,0.25);
  margin-bottom: 12px;
}
.hero-notes {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hero-note {
  font-size: 12px;
  color: var(--text-2);
  background: rgba(255, 0, 250, 0.06);
  border: 1px solid rgba(255, 0, 250, 0.15);
  border-radius: 20px;
  padding: 4px 14px;
  display: inline-block;
}

/* ── Tab Nav ── */
.tab-nav {
  display: flex;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,0,250,0.10);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 12px rgba(255,0,250,0.07);
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9px 2px 7px;
  font-size: 11px;
  color: var(--text-3);
  gap: 3px;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
}
.tab-btn svg { width: 20px; height: 20px; }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Main & Panels ── */
.main { flex: 1; padding: 12px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Glass Card ── */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-top-color: rgba(255,255,255,0.95);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 4px 24px rgba(255,0,250,0.07), 0 1px 0 rgba(255,255,255,0.9) inset;
}
.card-dim {
  background: rgba(255,0,250,0.04);
  border-color: rgba(255,0,250,0.09);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 16px;
}

/* ── Form Elements ── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.req { color: var(--primary); }

.form-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(200,160,220,0.35);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-1);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--text-3); }
.form-input:focus {
  outline: none;
  border-color: var(--primary-dim);
  background: white;
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input option, .form-input optgroup {
  background: #fff;
  color: var(--text-1);
}

.form-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── Section Picker ── */
.section-picker { display: flex; flex-direction: column; gap: 10px; }
.tier-label {
  font-size: 10px; font-weight: 700;
  color: var(--text-3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.tier-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.section-chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  border: 1.5px solid rgba(200,160,220,0.3);
  background: rgba(255,255,255,0.7);
  color: var(--text-2);
  transition: all 0.15s;
}
.section-chip:active { transform: scale(0.94); }
.section-chip.selected[data-tier="2680"] { background: #FFE0FF; border-color: #FF40F0; color: #CC00C8; }
.section-chip.selected[data-tier="2280"] { background: #FFE4E4; border-color: #FF6B6B; color: #CC2222; }
.section-chip.selected[data-tier="1680"] { background: #E0EEFF; border-color: #3B82F6; color: #1D4ED8; }
.section-chip.selected[data-tier="1280"] { background: #F0E8FF; border-color: #A855F7; color: #7E22CE; }
.section-chip.selected[data-tier="780"]  { background: #E0FFF4; border-color: #10B981; color: #065F46; }

.hint-text { font-size: 12px; color: var(--text-3); margin-top: 5px; }

/* ── Buttons ── */
.btn {
  display: block; width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-size: 15px; font-weight: 700;
  text-align: center;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  margin-top: 4px;
  box-shadow: 0 4px 18px rgba(255,0,250,0.30);
}
.btn-primary:active { background: #DD00DC; box-shadow: 0 2px 8px rgba(255,0,250,0.2); }
.btn-outline {
  background: white;
  color: var(--primary);
  border: 1.5px solid var(--primary-border);
}
.btn-outline:active { background: var(--primary-subtle); }
.btn-danger {
  background: rgba(232,0,58,0.08);
  color: var(--danger);
  border: 1.5px solid rgba(232,0,58,0.2);
}
.btn-danger:active { background: rgba(232,0,58,0.15); }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; border-radius: 8px; }
.btn-refresh {
  padding: 9px 11px;
  border-radius: 10px;
  background: white;
  border: 1.5px solid rgba(200,160,220,0.3);
  color: var(--text-2);
  display: flex; align-items: center;
  box-shadow: 0 1px 4px rgba(255,0,250,0.06);
}
.btn-refresh:active { background: #FDF0FF; }
.btn-copy {
  padding: 5px 13px;
  border-radius: 8px;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 13px; font-weight: 600;
}
.btn-contact {
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 13px; font-weight: 600;
}

/* ── Messages ── */
.error-msg {
  background: rgba(232,0,58,0.06);
  color: #C00030;
  border: 1px solid rgba(232,0,58,0.18);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 8px;
}
.warn-text { font-size: 12px; color: #B45309; margin-top: 10px; text-align: center; }
.hidden { display: none !important; }

/* ── Success Box ── */
.success-box { text-align: center; padding: 16px 0 4px; }
.success-icon { font-size: 44px; line-height: 1; }
.success-title { font-size: 18px; font-weight: 700; margin: 10px 0 4px; color: var(--text-1); }
.success-sub { font-size: 13px; color: var(--text-2); }
.big-id-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 0 4px; }
.big-id {
  font-size: 42px; font-weight: 800;
  color: var(--primary);
  letter-spacing: 2px;
  text-shadow: 0 2px 16px rgba(255,0,250,0.2);
}

/* ── Filter Bar ── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.filter-select {
  flex: 1;
  padding: 9px 10px;
  border: 1.5px solid rgba(200,160,220,0.3);
  border-radius: 10px;
  background: rgba(255,255,255,0.85);
  color: var(--text-1);
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
}

/* ── Listing Cards ── */
.listing-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,0,250,0.10);
  border-left: 3px solid transparent;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 12px rgba(255,0,250,0.06);
  transition: opacity 0.2s;
}
.listing-card.seeking   { border-left-color: var(--primary); }
.listing-card.completed { opacity: 0.5; border-left-color: var(--text-3); }

.lc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.lc-id     { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.lc-weibo  { font-size: 14px; font-weight: 600; color: var(--text-3); letter-spacing: 1px; }
.lc-seat   { font-size: 15px; font-weight: 700; color: var(--text-1); margin: 6px 0 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lc-targets-label { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.lc-chips  { display: flex; flex-wrap: wrap; gap: 4px; }
.lc-chip   { padding: 2px 8px; border-radius: 10px; font-size: 12px; background: rgba(255,0,250,0.06); color: var(--text-2); border: 1px solid rgba(255,0,250,0.12); }
.lc-time   { font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* ── Price Tags ── */
.price-tag {
  display: inline-block;
  padding: 2px 7px; border-radius: 5px;
  font-size: 11px; font-weight: 700; line-height: 1.6;
}
.pt-2680 { background: #FFE0FF; color: #CC00C8; border: 1px solid #FFB0FF; }
.pt-2280 { background: #FFE8E8; color: #CC2222; border: 1px solid #FFBBBB; }
.pt-1680 { background: #E0EEFF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.pt-1280 { background: #F0E8FF; color: #7E22CE; border: 1px solid #DDD6FE; }
.pt-780  { background: #E0FFF4; color: #065F46; border: 1px solid #A7F3D0; }

/* ── Status Badges ── */
.status-badge {
  padding: 3px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.status-seeking   { background: #FFE0FF; color: var(--primary); border: 1px solid #FFB0FF; }
.status-completed { background: #F3F4F6; color: var(--text-3); border: 1px solid #E5E7EB; }

/* ── Empty / Loading ── */
.empty-state, .loading { text-align: center; padding: 48px 20px; color: var(--text-3); font-size: 14px; }

/* ── Manage View ── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.info-item label { font-size: 11px; color: var(--text-3); display: block; margin-bottom: 2px; }
.info-item .val  { font-size: 15px; font-weight: 600; color: var(--text-1); }
.action-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ── Match ── */
.match-legend { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.match-section-hd { font-size: 13px; font-weight: 700; padding: 10px 0 6px; display: flex; align-items: center; gap: 6px; }
.match-count { font-size: 12px; font-weight: 400; color: var(--text-3); }
.match-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,0,250,0.10);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: 0 2px 12px rgba(255,0,250,0.05);
}
.match-card.perfect { border-left: 3px solid #00C87A; }
.match-card.good    { border-left: 3px solid #3B82F6; }
.match-card.partial { border-left: 3px solid #F59E0B; }
.contact-row { margin-top: 10px; }

.badge-perfect  { background: #E0FFF4; color: #065F46; border: 1px solid #A7F3D0; padding: 3px 11px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.badge-good     { background: #E0EEFF; color: #1D4ED8; border: 1px solid #BFDBFE; padding: 3px 11px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.badge-partial  { background: #FFF8E0; color: #92400E; border: 1px solid #FDE68A; padding: 3px 11px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.badge-crossday { background: #F3E8FF; color: #6B21A8; border: 1px solid #D8B4FE; padding: 3px 11px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.match-card.crossday { border-left: 3px solid #A855F7; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(100,0,100,0.25);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,0,250,0.15);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  width: 100%; max-width: 600px;
  max-height: 88vh; overflow-y: auto;
  position: relative;
  box-shadow: 0 -8px 40px rgba(255,0,250,0.10);
}
.modal-close { position: absolute; top: 16px; right: 16px; font-size: 18px; color: var(--text-3); padding: 4px 8px; border-radius: 6px; }
.modal-close:active { background: var(--primary-subtle); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,0,250,0.3); border-radius: 2px; }
