/* ============================================
   BoothSearch - 企业展位查询系统
   Theme: 科技蓝 / Tech Blue
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --primary-gradient: linear-gradient(135deg, #1a73e8 0%, #4a90d9 50%, #6db3f2 100%);
  --accent: #ff6b35;
  --success: #0f9d58;
  --warning: #f4b400;
  --danger: #db4437;
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --text: #202124;
  --text-secondary: #5f6368;
  --text-light: #80868b;
  --border: #e0e0e0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-blue: 0 4px 20px rgba(26,115,232,0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* --- Header --- */
.header {
  background: var(--primary-gradient);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(26,115,232,0.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-logo .icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.header-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.header-nav a {
  color: rgba(255,255,255,0.9);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.header-nav a:hover,
.header-nav a.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* --- Main Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  width: 100%;
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 40px 20px 24px;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* --- Search Box --- */
.search-section {
  max-width: 680px;
  margin: 0 auto 32px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 16px 56px 16px 24px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 1.05rem;
  outline: none;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  font-family: var(--font);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-blue);
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-icon {
  position: absolute;
  right: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-gradient);
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.search-icon:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-blue);
}

.search-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 8px;
}

/* --- Results --- */
.results-info {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* --- Card --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.card-booth {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-light);
}

.card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --- Modal / Detail --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--danger);
  color: white;
}

.modal-booth {
  display: inline-block;
  background: var(--primary-gradient);
  color: white;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.detail-item {
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.detail-item.full {
  grid-column: 1 / -1;
}

.detail-label {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.detail-value.salary {
  color: var(--accent);
  font-weight: 700;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state .text {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  box-shadow: var(--shadow-blue);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-warning:hover {
  opacity: 0.9;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pagination button {
  min-width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.pagination button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 8px;
}

/* --- Admin Panel --- */
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-search {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 400px;
}

.admin-search input {
  flex: 1;
  padding: 10px 18px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition);
  font-family: var(--font);
}

.admin-search input:focus {
  border-color: var(--primary);
}

/* --- Table --- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--primary-gradient);
  color: white;
}

th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--primary-light);
}

td .booth-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.82rem;
}

td .actions {
  display: flex;
  gap: 6px;
}

/* --- Form --- */
.form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.form-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

.form-panel h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: all var(--transition);
  background: var(--bg-card);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  max-width: 360px;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--primary); }

/* --- Confirm Dialog --- */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.confirm-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slideUp 0.3s ease;
}

.confirm-box .icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.confirm-box p {
  margin-bottom: 20px;
  color: var(--text-secondary);
}

/* --- File Upload --- */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}

.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.file-upload-area .icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.file-upload-area .text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.file-upload-area input[type="file"] {
  display: none;
}

/* --- Stats --- */
.stats-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat-card {
  flex: 1;
  min-width: 140px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  border-left: 4px solid var(--primary);
}

.stat-card .stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero-title { font-size: 1.5rem; }
  .hero-subtitle { font-size: 0.85rem; }
  .results-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .header-inner { justify-content: center; text-align: center; }
  .header-nav a { font-size: 0.8rem; padding: 6px 12px; }
  .modal-content { padding: 20px; }
  .form-panel { padding: 20px; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .admin-search { max-width: 100%; }
  .search-input { padding: 14px 50px 14px 18px; font-size: 0.95rem; }
  .card { padding: 16px; }
  .btn-group { justify-content: center; }
}

@media (max-width: 480px) {
  .container { padding: 12px; }
  .hero { padding: 24px 12px 16px; }
  .header-logo { font-size: 1.1rem; }
  .stat-card { min-width: 100px; padding: 14px; }
  .stat-card .stat-num { font-size: 1.5rem; }
}

/* --- Utilities --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 16px; }

/* --- Skeleton Loading --- */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-line {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  width: 60%;
}

/* --- Back to top --- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top:hover {
  transform: translateY(-3px);
}

/* --- Print --- */
@media print {
  .header, .footer, .back-to-top, .header-nav { display: none; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  .modal-overlay { position: static; background: none; }
}
