/* ===================================================
   购票系统 - 全局样式
   主题色: #6B1A2A (深红) / #C8A97E (金色)
   适配: 移动端优先 + 后台桌面端
   =================================================== */

/* --- 变量 --- */
:root {
  --primary: #6B1A2A;
  --primary-light: #8B2D3D;
  --gold: #C8A97E;
  --gold-dark: #B8976A;
  --bg-cream: #FAF6F0;
  --text-dark: #333;
  --text-gray: #6B7280;
  --text-light: #9CA3AF;
  --white: #FFFFFF;
  --shadow: 0 4px 24px rgba(139,90,43,0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* 席位颜色 */
  --color-premium: #D4A017;
  --color-premium-bg: #FFF8E0;
  --color-vip: #C0392B;
  --color-vip-bg: #FDE8E8;
  --color-audience: #2E86C1;
  --color-audience-bg: #E8F0FE;
  --color-invite: #27AE60;
  --color-invite-bg: #E8F8E8;
  --color-locked: #7F8C8D;
  --color-locked-bg: #ECF0F1;
  --color-sold: #34495E;
}

/* --- Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Noto Serif SC', sans-serif;
  background: var(--bg-cream);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

/* --- 移动端背景 --- */
.mobile-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background: url('../../子页背景图.jpg') no-repeat center center fixed;
  background-size: cover;
  padding-bottom: 100px;
}
.mobile-page::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(250,246,240,0.85);
  pointer-events: none;
  z-index: 0;
}
.mobile-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --- 顶部导航 --- */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px;
  position: relative;
  height: 56px;
}
.top-nav .back-btn {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.8);
  border: none; border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow);
}
.top-nav .back-btn svg {
  width: 20px; height: 20px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.top-nav .nav-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 1px;
}
.top-nav .nav-subtitle {
  font-size: 10px;
  color: var(--gold);
  text-align: center;
  letter-spacing: 2px;
  margin-top: 0;
}
.nav-divider {
  width: calc(100% - 40px);
  height: 1px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* --- 卡片 --- */
.card {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 1px 3px rgba(139,90,43,0.05);
  padding: 16px;
  margin-bottom: 16px;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  letter-spacing: 1px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(101deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary) 100%);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(107,26,42,0.3);
}
.btn-gold {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--white);
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold-dark);
}
.btn svg {
  width: 18px; height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-block { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: 14px; }

/* --- 输入框 --- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-gray);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: var(--radius-xs);
  font-size: 15px;
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,169,126,0.15);
}

/* --- 标签 --- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.badge-premium { background: var(--color-premium-bg); color: var(--color-premium); }
.badge-vip { background: var(--color-vip-bg); color: var(--color-vip); }
.badge-audience { background: var(--color-audience-bg); color: var(--color-audience); }
.badge-invite { background: var(--color-invite-bg); color: var(--color-invite); }
.badge-locked { background: var(--color-locked-bg); color: var(--color-locked); }
.badge-sold { background: #F0F0F0; color: var(--color-sold); }

/* --- 选择座位提示 --- */
.seat-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 12px 0;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-gray);
}
.legend-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- 舞台样式 --- */
.stage-area {
  width: 80%;
  max-width: 280px;
  margin: 20px auto;
  background: linear-gradient(180deg, #C8A97E 0%, #B8976A 100%);
  border-radius: 50px 50px 12px 12px;
  text-align: center;
  padding: 10px 0;
}
.stage-area .stage-text {
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
}
.stage-area .stage-sub {
  color: rgba(255,255,255,0.6);
  font-size: 10px;
  letter-spacing: 1px;
}

/* --- 座位网格容器 (支持缩放平移) --- */
.seat-container {
  width: 100%;
  overflow: hidden;
  touch-action: none;
  position: relative;
  background: rgba(255,255,255,0.5);
  border-radius: var(--radius-sm);
  min-height: 400px;
}
.seat-grid-wrapper {
  transform-origin: 0 0;
  transition: none;
}
.seat-grid {
  display: grid;
  gap: 3px;
  padding: 16px;
  width: max-content;
}
.seat-item {
  width: 24px; height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}
.seat-item .seat-num {
  display: none;
}
.seat-item:hover .seat-num {
  display: block;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
}
.seat-row-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-gray);
  font-weight: 500;
  width: 24px; height: 24px;
}
.seat-available { background: var(--gold); }
.seat-available:hover { background: var(--gold-dark); transform: scale(1.15); }
.seat-selected { background: var(--primary) !important; box-shadow: 0 0 0 2px var(--gold); transform: scale(1.1); }
.seat-locked { background: #BDC3C7; cursor: not-allowed; }
.seat-sold { background: #7F8C8D; cursor: not-allowed; }

/* 不同价位座位颜色 */
.seat-premium.seat-available { background: var(--color-premium); }
.seat-premium.seat-selected { background: #8B6914 !important; }
.seat-vip.seat-available { background: var(--color-vip); }
.seat-vip.seat-selected { background: #7B241C !important; }
.seat-audience.seat-available { background: var(--color-audience); }
.seat-audience.seat-selected { background: #154360 !important; }
.seat-invite.seat-available { background: var(--color-invite); }
.seat-invite.seat-selected { background: #1A5632 !important; }

/* --- 底部操作栏 --- */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 20px rgba(0,0,0,0.06);
  z-index: 100;
}
.bottom-bar .flex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.seat-summary {
  flex: 1;
}
.seat-summary .count {
  font-size: 14px;
  color: var(--text-gray);
}
.seat-summary .count strong {
  color: var(--primary);
  font-size: 18px;
}
.seat-summary .selected-list {
  font-size: 12px;
  color: var(--text-gray);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- 信息登记 --- */
.register-card .card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
  letter-spacing: 1px;
}
.register-card .seat-summary-register {
  background: var(--gold-bg);
  border-radius: var(--radius-xs);
  padding: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-gray);
  line-height: 1.8;
}
.register-card .seat-summary-register strong {
  color: var(--primary);
}

/* --- 凭证码展示 --- */
.ticket-display {
  text-align: center;
  padding: 30px 20px;
}
.ticket-display .qr-code-area {
  width: 200px; height: 200px;
  margin: 20px auto;
  background: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  position: relative;
}
.ticket-display .qr-code-area svg {
  width: 180px; height: 180px;
}
.ticket-display .qr-code-area .code-text {
  position: absolute;
  bottom: -30px;
  font-size: 14px;
  color: var(--text-gray);
  letter-spacing: 3px;
  font-weight: 600;
}
.ticket-display .ticket-amount {
  font-size: 24px;
  color: var(--primary);
  font-weight: 700;
  margin: 10px 0;
}
.ticket-item {
  background: rgba(255,255,255,0.9);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  border-left: 4px solid var(--gold);
}
.ticket-item .ticket-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ticket-item .ticket-code {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
}
.ticket-item .ticket-seats {
  font-size: 13px;
  color: var(--text-gray);
  line-height: 1.6;
}
.ticket-item .ticket-status {
  font-size: 12px;
  color: var(--gold-dark);
}

/* --- Toast 提示 --- */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 16px 24px;
  border-radius: var(--radius-xs);
  font-size: 15px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.25s;
  pointer-events: none;
  text-align: center;
  max-width: 80%;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* --- 桌面后台适配 --- */
@media (min-width: 768px) {
  body.admin-body {
    background: #F0F2F5;
  }
  .admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
  }
  .admin-sidebar {
    width: 220px;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    background: var(--primary);
    color: #fff;
    padding: 20px 0;
    z-index: 1000;
  }
  .admin-sidebar .sidebar-title {
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
  }
  .admin-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
  }
  .admin-sidebar .nav-item:hover, .admin-sidebar .nav-item.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
  }
  .admin-sidebar .nav-item svg {
    width: 18px; height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
  }
  .admin-main {
    margin-left: 220px;
    padding: 20px 30px;
  }
  .admin-card {
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 20px;
  }
  .admin-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
  }
  .admin-card .card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
  }
  table.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  table.admin-table th {
    background: #F9FAFB;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-gray);
    border-bottom: 2px solid #E5E7EB;
  }
  table.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #F3F4F6;
  }
  table.admin-table tr:hover td {
    background: #F9FAFB;
  }
  .admin-form .form-group {
    max-width: 500px;
  }
  .admin-form .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
  }
}
