/* 自助申请照片页面样式 */
/* [2026-03-02] 纯新增 */
@use '@/styles/variables' as *;
@use '@/styles/mixins' as *;

.photos {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  text-align: left;
  font-family: 'Noto Sans SC', $font-family-base;
}

/* 卡片 */
.photos__card {
  align-self: stretch;
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  gap: 15px;
}

.photos__cardHeader {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.photos__cardTitle {
  margin: 0;
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
  color: #1e293b;
}

.photos__count {
  font-size: 14px;
  color: #6b7280;
}

/* 筛选 */
.photos__filters {
  align-self: stretch;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.photos__select {
  min-width: 160px;
  height: 38px;
  border-radius: 6px;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 9px 13px;
  font-size: 14px;
  line-height: 20px;
  color: #1e293b;
  cursor: pointer;
  appearance: none;
  font-family: inherit;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px;
}

/* 表格 */
.photos__table {
  align-self: stretch;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.photos__tableHeader {
  align-self: stretch;
  min-width: 750px;
  background-color: #f3f4f6;
  display: flex;
  align-items: center;
}

.photos__tableRow {
  align-self: stretch;
  min-width: 750px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  @include transition-fast;

  &:hover {
    background-color: #f9fafb;
  }
}

.photos__cell {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 20px;
  color: #1e293b;

  &--header {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
  }

  &--avatar {
    width: 64px;
    flex-shrink: 0;
    justify-content: center;
  }

  &--nickname {
    width: 120px;
    flex-shrink: 0;
    font-weight: 500;
  }

  &--accountId {
    width: 140px;
    flex-shrink: 0;
    font-size: 13px;
  }

  &--type {
    width: 100px;
    flex-shrink: 0;
  }

  &--region {
    width: 140px;
    flex-shrink: 0;
  }

  &--photoCount {
    width: 100px;
    flex-shrink: 0;
  }

  &--date {
    flex: 1;
    min-width: 90px;
    font-size: 12px;
    color: #6b7280;
  }
}

/* 头像 */
.photos__avatar {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background-size: cover;
  background-position: center;
  background-color: #e5e7eb;
}

/* 类型徽章 */
.photos__typeBadge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background-color: #e0e7ff;
  color: #3730a3;
}

/* 查看照片按钮 */
.photos__viewBtn {
  cursor: pointer;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  background-color: rgba(59, 130, 246, 0.08);
  padding: 3px 8px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: #2563eb;
  font-family: inherit;
  white-space: nowrap;
  @include transition-fast;

  &:hover {
    background-color: rgba(59, 130, 246, 0.16);
  }
}

/* 空数据 */
.photos__emptyRow {
  align-self: stretch;
  padding: 40px 24px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

/* 帮助文本 */
.photos__help {
  align-self: stretch;
  font-size: 12px;
  line-height: 16px;
  color: #6b7280;
  padding-top: 4px;
}

/* 加载/错误 */
.photos__loading {
  align-self: stretch;
  padding: 40px 24px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

.photos__error {
  align-self: stretch;
  padding: 24px;
  background-color: #fef2f2;
  border-radius: 6px;
  color: #991b1b;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.photos__retryBtn {
  cursor: pointer;
  border: 1px solid #991b1b;
  border-radius: 4px;
  background-color: transparent;
  padding: 4px 12px;
  font-size: 12px;
  color: #991b1b;
  font-family: inherit;
  @include transition-fast;

  &:hover {
    background-color: #991b1b;
    color: #fff;
  }
}

/* 分页 */
.photos__pagination {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid #e5e7eb;
  margin-top: 8px;
}

.photos__pageBtn {
  cursor: pointer;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background-color: #fff;
  padding: 6px 12px;
  font-size: 14px;
  color: #1e293b;
  font-family: inherit;
  @include transition-fast;

  &:hover:not(:disabled) {
    background-color: #f3f4f6;
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

.photos__pageInfo {
  font-size: 14px;
  color: #6b7280;
}

/* 模态框 */
.modal__overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal__content {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

.modal__title {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
}

.modal__info {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #6b7280;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.modal__closeBtn {
  cursor: pointer;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background-color: #fff;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  font-family: inherit;
  @include transition-fast;

  &:hover {
    background-color: #f3f4f6;
  }
}

/* 照片网格 */
.photoGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}

.photoGrid__item {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  @include transition-fast;

  &:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  }
}

.photoGrid__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* 全屏灯箱 */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: pointer;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__close {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}
