/**
 * CityPulse 管理后台专属样式
 * - 简洁白色背景
 * - 蓝色主色（沿用 variables.css 的 --color-primary）
 * - 表格斑马纹 + hover 效果
 * - 弹窗居中 + 遮罩层
 */

/* ===== 全局容器 ===== */
.admin-body {
  background: #f5f7fa;
  min-height: 100vh;
}

.container {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}

/* ===== 顶部标题栏 ===== */
.admin-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.admin-header__inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header__title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: 0.2px;
}
.admin-header__back {
  color: var(--color-primary, #1890ff);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background 0.2s ease;
}
.admin-header__back:hover {
  background: #e6f4ff;
}

/* ===== 主体 ===== */
.admin-main {
  padding: 28px 0 80px;
}

/* ===== 操作栏（搜索 + 添加按钮） ===== */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.admin-search {
  position: relative;
  flex: 1 1 360px;
  max-width: 560px;
}
.admin-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 15px;
  pointer-events: none;
}
.admin-search__input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: #111827;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.admin-search__input::placeholder {
  color: #9ca3af;
}
.admin-search__input:focus {
  outline: none;
  border-color: var(--color-primary, #1890ff);
  box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.12);
}

/* ===== 通用按钮 ===== */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.admin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}
.admin-btn--primary {
  background: var(--color-primary, #1890ff);
  color: #fff;
}
.admin-btn--primary:hover:not(:disabled) {
  background: #096dd9;
}
.admin-btn--primary:active:not(:disabled) {
  transform: translateY(1px);
}
.admin-btn--ghost {
  background: #fff;
  color: #374151;
  border-color: #d1d5db;
}
.admin-btn--ghost:hover:not(:disabled) {
  color: var(--color-primary, #1890ff);
  border-color: var(--color-primary, #1890ff);
  background: #f0f8ff;
}
.admin-btn--danger {
  background: #ff4d4f;
  color: #fff;
}
.admin-btn--danger:hover:not(:disabled) {
  background: #e63946;
}
.admin-btn--sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 8px;
}

/* ===== 表格 ===== */
.admin-table-wrap {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
.admin-table thead {
  background: #f9fafb;
  color: #374151;
}
.admin-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f3f5;
  color: #1f2937;
  vertical-align: middle;
  word-break: break-all;
}
.admin-table tbody tr:last-child td {
  border-bottom: none;
}
/* 斑马纹 */
.admin-table tbody tr:nth-child(even) {
  background: #fafbfc;
}
/* Hover 效果 */
.admin-table tbody tr:hover {
  background: #f0f7ff;
}
/* 表格内小组件 */
.admin-table__name {
  font-weight: 600;
  color: #111827;
}
.admin-table__rating {
  color: #f59e0b;
  font-weight: 600;
}
.admin-table__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-table__chip {
  display: inline-block;
  padding: 2px 10px;
  background: #e6f4ff;
  color: var(--color-primary, #1890ff);
  font-size: 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* 骨架行 */
.admin-skeleton-row td {
  padding: 0;
}
.admin-skeleton {
  height: 120px;
  background: linear-gradient(90deg, #f0f2f5 25%, #f6f7f9 37%, #f0f2f5 63%);
  background-size: 400% 100%;
  animation: admin-skeleton-ani 1.4s ease-in-out infinite;
}
@keyframes admin-skeleton-ani {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ===== 空状态 ===== */
.admin-empty {
  padding: 48px 0;
  text-align: center;
  color: #9ca3af;
}
.admin-empty__icon {
  font-size: 44px;
  margin-bottom: 8px;
}
.admin-empty__text {
  font-size: 14px;
}

/* ===== 分页 ===== */
.admin-pagination {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.admin-pagination__info {
  font-size: 13px;
  color: #4b5563;
}
.admin-pagination__info b {
  color: #111827;
  margin: 0 2px;
}

/* ===== 弹窗（居中 + 遮罩） ===== */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.admin-modal[hidden] {
  display: none;
}
.admin-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.48);
  backdrop-filter: blur(2px);
  animation: admin-fade-in 0.18s ease;
}
.admin-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: admin-pop-in 0.22s cubic-bezier(.16,.84,.44,1);
}
.admin-modal--sm .admin-modal__dialog {
  max-width: 420px;
}
@keyframes admin-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes admin-pop-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.admin-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #f1f3f5;
}
.admin-modal__title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}
.admin-modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 24px;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.admin-modal__close:hover {
  background: #f3f4f6;
  color: #111827;
}
.admin-modal__body {
  padding: 20px 24px;
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}
.admin-modal__body p + p {
  margin-top: 8px;
}
.admin-modal__tip {
  color: #ef4444;
  font-size: 13px;
  margin-top: 6px !important;
}

/* ===== 表单 ===== */
.admin-form {
  padding: 20px 24px 24px;
  overflow-y: auto;
}
.admin-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.admin-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-form__field--full {
  grid-column: 1 / -1;
}
.admin-form__label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}
.admin-form__label em {
  color: #ff4d4f;
  font-style: normal;
  margin-left: 2px;
}
.admin-form__input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}
.admin-form__input::placeholder {
  color: #9ca3af;
}
.admin-form__input:focus {
  outline: none;
  border-color: var(--color-primary, #1890ff);
  box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.14);
}
.admin-form__input--textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.6;
}
.admin-form__input--select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236b7280' d='M6 8 0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.admin-form__err {
  color: #ff4d4f;
  font-size: 12px;
  min-height: 16px;
}
.admin-form__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 8px 4px;
}
.admin-form__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fafbfc;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  user-select: none;
}
.admin-form__tag input {
  accent-color: var(--color-primary, #1890ff);
  margin: 0;
}
.admin-form__tag:has(input:checked) {
  background: #e6f4ff;
  border-color: var(--color-primary, #1890ff);
  color: var(--color-primary, #1890ff);
  font-weight: 500;
}
.admin-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #f1f3f5;
}
.admin-modal--sm .admin-form__actions {
  padding: 0 24px 20px;
  margin-top: 0;
  border-top: none;
}

/* ===== Toast 提示 ===== */
.admin-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  padding: 10px 20px;
  background: #111827;
  color: #fff;
  font-size: 14px;
  border-radius: 10px;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 200;
  max-width: min(560px, calc(100vw - 48px));
  text-align: center;
}
.admin-toast.is-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.admin-toast.is-success { background: #10b981; }
.admin-toast.is-error   { background: #ff4d4f; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .admin-header__inner { height: 56px; }
  .admin-header__title { font-size: 17px; }
  .admin-main { padding: 20px 0 60px; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .admin-search { max-width: none; }
  .admin-table thead th:nth-child(4),
  .admin-table tbody td:nth-child(4),
  .admin-table thead th:nth-child(5),
  .admin-table tbody td:nth-child(5) {
    display: none; /* 窄屏隐藏评分/消费（不影响操作） */
  }
  .admin-form__grid { grid-template-columns: 1fr; }
  .admin-pagination { justify-content: center; }
}
