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

:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light: #e0f2fe;
  --admin: #4f46e5;
  --admin-dark: #4338ca;
  --admin-light: #e0e7ff;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============ Auth Screen ============ */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
}
.auth-screen.admin-theme {
  background: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
}
.auth-card {
  background: var(--card);
  border-radius: 20px;
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.auth-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.auth-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.auth-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 28px;
}
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.input-wrap input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}
.input-wrap input:focus {
  border-color: var(--primary);
}
.admin-theme .input-wrap input:focus {
  border-color: var(--admin);
}

/* ============ 验证码 ============ */
.captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.captcha-row input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.captcha-row input:focus {
  border-color: var(--admin);
}
.captcha-img {
  flex-shrink: 0;
  height: 44px;
  width: 120px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: #f0f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, opacity .2s;
}
.captcha-img:hover {
  border-color: var(--admin);
  opacity: 0.85;
}
.captcha-img svg {
  width: 100%;
  height: 100%;
}
.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

/* ============ Buttons ============ */
.btn-primary {
  padding: 12px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-admin { background: var(--admin); }
.btn-admin:hover { background: var(--admin-dark); }
.btn-secondary {
  padding: 12px 20px;
  background: var(--border);
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-secondary:hover { background: #cbd5e1; }
.btn-text {
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  opacity: .85;
  transition: opacity .2s;
}
.btn-text:hover { opacity: 1; }
.btn-search { white-space: nowrap; min-width: 80px; }
.btn-icon-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.1);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 1;
}
.btn-icon-close:hover { background: rgba(0,0,0,.2); }

/* ============ App Header ============ */
.app-view { min-height: 100vh; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.admin-header-bar { background: var(--admin); }
.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { font-size: 22px; }
.header-title { font-size: 17px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; }
.welcome-user { font-size: 13px; opacity: .85; }

/* ============ Filter Bar ============ */
.filter-bar {
  position: sticky;
  top: 56px;
  z-index: 90;
  background: var(--card);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.filter-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  max-width: 900px;
}
.filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 130px;
}
.filter-item label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.filter-item select,
.filter-item input {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  background: var(--card);
  transition: border-color .2s;
}
.filter-item select:focus,
.filter-item input:focus {
  border-color: var(--primary);
}

/* ============ Product Grid ============ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.product-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card-image {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
}
.no-image-hint {
  text-align: center;
  padding: 20px;
}
.no-image-hint span {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
  opacity: .7;
}
.no-image-hint p {
  font-size: 13px;
  font-weight: 400;
  opacity: .8;
  letter-spacing: 0;
  line-height: 1.5;
}
/* badge-type moved to card body as .card-type-tag */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.card-type-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.5;
}
.card-dest-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: #b45309;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.5;
}
.card-accom-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #5b21b6;
  background: #ddd6fe;
  border: 1px solid #c4b5fd;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.5;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-ids {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.card-id-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--border);
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.5;
  font-family: "SF Mono", "Cascadia Code", monospace;
  cursor: pointer;
  user-select: none;
  transition: transform .1s, background .2s, color .2s;
}
.card-id-tag:hover { transform: scale(1.03); }
.card-id-tag:active { transform: scale(.97); }
.card-id-tag .copy-icon { font-size: 11px; opacity: .5; }
.card-id-tag.copied { background: #d1fae5 !important; color: #059669 !important; }
.card-id-tag.copied .copy-icon { opacity: 1; }
.card-id-noflight {
  color: #6366f1;
  background: #e0e7ff;
}
.card-id-empty {
  color: var(--text-light);
  background: transparent;
  font-style: italic;
  font-weight: 400;
  cursor: default;
}
.card-body {
  padding: 14px 16px 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}
/* destination now displayed as .card-dest-tag inside .card-tags */
.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.card-days {
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-days::before { content: "📅"; font-size: 14px; }
.card-notes {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-copy-img {
  margin-top: 12px;
  width: 100%;
  padding: 8px 14px;
  border: 1.5px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .2s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-copy-img:active { transform: scale(.98); }
.btn-copy-img:hover { background: #bae6fd; }
.btn-copy-img.copied {
  border-color: var(--success);
  background: #d1fae5;
  color: #059669;
}
.copy-img-icon { font-size: 14px; }

/* ============ Empty & Loading ============ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.loading-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Admin Tabs ============ */
.admin-tabs {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  overflow-x: auto;
}
.tab {
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--admin);
  border-bottom-color: var(--admin);
}
.tab-content { padding: 20px; max-width: 1000px; margin: 0 auto; }

/* ============ Admin Toolbar ============ */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.count-label { font-size: 13px; color: var(--text-muted); }

/* ============ Admin List ============ */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.admin-item-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.admin-item-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.admin-item-info {
  flex: 1;
  min-width: 0;
}
.admin-item-id {
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}
.admin-item-noflight {
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.admin-item-noflight .text-muted {
  color: var(--text-light);
  font-style: italic;
}
.admin-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.admin-item-meta {
  font-size: 13px;
  color: var(--text-muted);
}
.admin-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.btn-edit, .btn-delete {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-edit { background: var(--admin-light); color: var(--admin); }
.btn-edit:hover { background: #c7d2fe; }
.btn-delete { background: #fee2e2; color: var(--danger); }
.btn-delete:hover { background: #fecaca; }

/* ============ Inline Form (types/users) ============ */
.inline-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.inline-form input {
  flex: 1;
  min-width: 150px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}
.inline-form input:focus { border-color: var(--admin); }
.inline-form button { white-space: nowrap; }
.inline-form .btn-primary { background: var(--admin); }
.inline-form .btn-primary:hover { background: var(--admin-dark); }

/* ============ Tag List ============ */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--admin-light);
  color: var(--admin);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}
.tag-delete {
  background: none;
  border: none;
  color: var(--admin);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: .6;
  transition: opacity .2s;
}
.tag-delete:hover { opacity: 1; }

/* ============ Modal ============ */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5);
}
.modal-box {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-form { padding: 24px; }
.form-row {
  display: flex;
  gap: 16px;
}
.form-row .form-group { flex: 1; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.req { color: var(--danger); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--admin); }
.form-group textarea { resize: vertical; }
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ============ Image Upload ============ */
.image-upload-area { position: relative; }
.image-preview-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--border);
}
.image-preview-wrap img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}
.upload-placeholder {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-placeholder:hover {
  border-color: var(--admin);
  background: var(--admin-light);
}
.upload-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.upload-placeholder p { font-size: 14px; color: var(--text); font-weight: 600; }
.upload-hint { font-size: 12px !important; color: var(--text-light) !important; font-weight: 400 !important; margin-top: 4px; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease;
  max-width: 90%;
  text-align: center;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============ User List Item ============ */
.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.user-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--admin-light);
  color: var(--admin);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}
.user-name { font-size: 15px; font-weight: 600; }
.user-login-name { font-size: 12px; font-weight: 400; color: var(--text-light); }
.user-date { font-size: 12px; color: var(--text-light); }

/* ============ Backup List ============ */
.backup-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.backup-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: relative;
}
.backup-item-latest {
  border: 2px solid var(--success);
  background: #f0fdf4;
}
.backup-new-badge {
  display: inline-block;
  background: var(--success);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  line-height: 1.4;
  letter-spacing: 0.5px;
}
.backup-prev-badge {
  display: inline-block;
  background: var(--warning);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  line-height: 1.4;
  letter-spacing: 0.5px;
}
.backup-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--admin-light);
  color: var(--admin);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.backup-item-info { flex: 1; min-width: 0; }
.backup-item-time {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.backup-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.backup-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.btn-download {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #dbeafe;
  color: #2563eb;
  transition: background .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-download:hover { background: #bfdbfe; }

/* ============ Operation Logs ============ */
.log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.log-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.log-filters select,
.log-filters input {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  background: var(--card);
  transition: border-color .2s;
}
.log-filters select:focus,
.log-filters input:focus { border-color: var(--admin); }
.log-filters input { min-width: 200px; }
.log-filters .btn-primary { background: var(--admin); padding: 9px 16px; font-size: 14px; }
.log-filters .btn-primary:hover { background: var(--admin-dark); }

.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.log-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--border);
}
.log-item-time {
  font-size: 12px;
  color: var(--text-light);
  font-family: "SF Mono", "Cascadia Code", monospace;
  margin-bottom: 6px;
}
.log-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.log-role-admin {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--admin-light);
  color: var(--admin);
}
.log-role-user {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary-dark);
}
.log-item-user {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.log-action-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.log-action-login { background: #dbeafe; color: #2563eb; }
.log-action-fail { background: #fee2e2; color: var(--danger); }
.log-action-add { background: #d1fae5; color: #059669; }
.log-action-edit { background: #fef3c7; color: #b45309; }
.log-action-delete { background: #fee2e2; color: var(--danger); }
.log-action-backup { background: #e0e7ff; color: #4f46e5; }
.log-action-other { background: var(--border); color: var(--text-muted); }
.log-item-action {
  font-size: 13px;
  color: var(--text-muted);
}
.log-item-detail {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 4px;
}
.log-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}
.log-page-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.log-page-btn:hover { background: var(--admin-light); border-color: var(--admin); color: var(--admin); }
.log-page-info {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ============ 系统管理 - 管理员 ============ */
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.perm-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  transition: all .15s ease;
  user-select: none;
}

.perm-item:hover {
  border-color: var(--primary);
  background: var(--primary-bg, #f0f7ff);
}

.perm-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.perm-item input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.perm-item input[type="checkbox"]:disabled + span {
  color: var(--text-muted);
}

.admin-user-item {
  padding: 14px 16px;
}

.admin-avatar {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.admin-super-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

.admin-perm-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.admin-perm-tag {
  display: inline-block;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
}

.admin-perm-none {
  display: inline-block;
  background: #f3f4f6;
  color: #9ca3af;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ============ Submit Itinerary Button (User) ============ */
.btn-submit-itinerary {
  padding: 12px 20px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .1s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(249, 115, 22, .3);
}
.btn-submit-itinerary:active { transform: scale(.98); }
.btn-submit-itinerary:hover { box-shadow: 0 4px 12px rgba(249, 115, 22, .4); }

/* Submit Hint */
.submit-hint {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  color: #92400e;
}
.submit-hint span { line-height: 1.5; }

/* ============ Tab Badge (Admin) ============ */
.tab-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  padding: 0 5px;
  margin-left: 4px;
  vertical-align: middle;
  animation: badgePulse 2s ease infinite;
}
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}

/* ============ Submission List (Admin) ============ */
.submission-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.submission-item {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--border);
  transition: border-color .2s;
}
.submission-pending { border-left-color: var(--warning); }
.submission-adopted { border-left-color: var(--success); }
.submission-rejected { border-left-color: var(--danger); }

.submission-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.submission-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.submission-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.submission-username {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.submission-time {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}
.sub-status-pending {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  background: #fef3c7;
  color: #b45309;
}
.sub-status-adopted {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  background: #d1fae5;
  color: #059669;
}
.sub-status-rejected {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  background: #fee2e2;
  color: var(--danger);
}
.submission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.sub-tag-type {
  font-size: 11px;
  font-weight: 500;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 4px;
}
.sub-tag-dest {
  font-size: 11px;
  font-weight: 500;
  color: #b45309;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 4px;
}
.sub-tag-days {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--border);
  padding: 2px 8px;
  border-radius: 4px;
}
.sub-tag-accom {
  font-size: 11px;
  font-weight: 500;
  color: #6d28d9;
  background: #ede9fe;
  padding: 2px 8px;
  border-radius: 4px;
}
.submission-content {
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 8px;
}
.submission-notes {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #fffbeb;
  border-radius: var(--radius);
}
.sub-review-info {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius);
}
.submission-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ============ Review Modal ============ */
.review-detail-box {
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}
.review-detail-row {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text);
}
.review-label {
  font-weight: 600;
  color: var(--text-muted);
  display: inline-block;
  min-width: 70px;
}
.review-detail-content {
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.review-action-group {
  display: flex;
  gap: 16px;
}
.review-action-item {
  cursor: pointer;
  user-select: none;
}
.review-action-item input[type="radio"] {
  display: none;
}
.review-action-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  transition: all .2s;
}
.review-action-label.adopted:hover {
  border-color: var(--success);
  background: #f0fdf4;
}
.review-action-label.rejected:hover {
  border-color: var(--danger);
  background: #fef2f2;
}
.review-action-item input[type="radio"]:checked + .review-action-label.adopted {
  border-color: var(--success);
  background: #d1fae5;
  color: #059669;
}
.review-action-item input[type="radio"]:checked + .review-action-label.rejected {
  border-color: var(--danger);
  background: #fee2e2;
  color: var(--danger);
}

/* ============ My Submissions Button (User) ============ */
.btn-my-submissions {
  padding: 12px 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .1s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(139, 92, 246, .3);
}
.btn-my-submissions:active { transform: scale(.98); }
.btn-my-submissions:hover { box-shadow: 0 4px 12px rgba(139, 92, 246, .4); }

/* ============ My Submissions List (User) ============ */
.modal-box-lg { max-width: 720px; }
.my-sub-loading { text-align: center; padding: 40px; color: var(--text-light); }
.my-sub-loading .spinner { margin: 0 auto 10px; }
.my-sub-empty { text-align: center; padding: 40px; color: var(--text-light); }
.my-sub-empty .empty-icon { font-size: 48px; margin-bottom: 10px; }
.my-sub-list { display: flex; flex-direction: column; gap: 12px; max-height: 65vh; overflow-y: auto; padding-right: 4px; }

.my-sub-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--border);
}
.my-sub-pending { border-left-color: var(--warning); }
.my-sub-adopted { border-left-color: var(--success); }
.my-sub-rejected { border-left-color: var(--danger); }

.my-sub-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.my-sub-card-time {
  font-size: 13px;
  color: var(--text-light);
}
.my-sub-status {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
}
.my-sub-status.my-sub-pending { background: #fef3c7; color: #b45309; }
.my-sub-status.my-sub-adopted { background: #d1fae5; color: #047857; }
.my-sub-status.my-sub-rejected { background: #fee2e2; color: #dc2626; }

.my-sub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.my-sub-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 8px;
}
.my-sub-tag-type { background: #e0f2fe; color: #0369a1; }
.my-sub-tag-dest { background: #f0fdf4; color: #15803d; }
.my-sub-tag-days { background: #fef3c7; color: #b45309; }
.my-sub-tag-accom { background: #f3e8ff; color: #7c3aed; }

.my-sub-content, .my-sub-notes {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.my-sub-content pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 4px 0 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  background: var(--bg);
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text);
}
.my-sub-label {
  font-weight: 600;
  color: var(--text-light);
  font-size: 13px;
}
.my-sub-notes {
  background: #fffbeb;
  border-radius: var(--radius);
  padding: 8px 12px;
}

.my-sub-review {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}
.my-sub-review-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}
.my-sub-review-sep {
  margin: 0 8px;
  color: var(--text-lighter);
}
.my-sub-review-note {
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--card);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
}

/* ============ Pagination ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 24px 20px 40px;
}
.page-btn {
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.page-btn.disabled {
  opacity: .4;
  cursor: not-allowed;
}
.page-ellipsis {
  min-width: 38px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  user-select: none;
}
.page-info {
  font-size: 13px;
  color: var(--text-light);
  margin-left: 12px;
  white-space: nowrap;
}

/* ============ Responsive ============ */
@media (max-width: 640px) {
  .header-title { font-size: 15px; }
  .welcome-user { display: none; }
  .filter-row { flex-direction: column; gap: 10px; }
  .filter-item { width: 100%; min-width: 0; }
  .btn-search { width: 100%; }
  .btn-submit-itinerary { width: 100%; }
  .btn-my-submissions { width: 100%; }
  .page-info { width: 100%; text-align: center; margin-left: 0; margin-top: 4px; }
  .page-btn { min-width: 34px; height: 34px; font-size: 13px; }
  .product-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .form-row { flex-direction: column; gap: 0; }
  .admin-item {
    flex-wrap: wrap;
  }
  .admin-item-actions { width: 100%; justify-content: flex-end; }
  .tab { padding: 12px 14px; font-size: 13px; }
  .modal-box { max-width: 100%; }
  .auth-card { padding: 32px 24px; }
  .log-filters input { min-width: 100%; }
  .log-toolbar { flex-direction: column; align-items: stretch; }
  .log-filters { width: 100%; }
  .log-filters .btn-primary { width: 100%; }
  .log-item-main { gap: 6px; }
  .review-action-group { flex-direction: column; }
}
