/**
 * 同人作品展示页 - 专用样式
 * 使用 BEM 命名规范
 */

/* ==================== 1. 页面头部区域 ==================== */
.works-header {
  margin-bottom: 30px;
}

.works-header__title {
  font-size: 32px;
  font-weight: bold;
  color: var(--text-main);
  margin-bottom: 10px;
}

.works-header__title span {
  font-size: 20px;
  font-weight: normal;
  color: #888;
  margin-left: 10px;
}

.works-header__subtitle {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.8;
  max-width: 800px;
}

/* ==================== 2. 工具条（筛选与排序）==================== */
.works-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.works-toolbar__label {
  font-size: 14px;
  color: var(--text-light);
  font-weight: bold;
}

.works-toolbar__filters,
.works-toolbar__sort {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.works-toolbar__filter-btn,
.works-toolbar__sort-btn {
  padding: 8px 16px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background-color: #fff;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.works-toolbar__filter-btn:hover,
.works-toolbar__sort-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.works-toolbar__filter-btn.active,
.works-toolbar__sort-btn.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.works-toolbar__divider {
  width: 1px;
  height: 24px;
  background-color: var(--border-color);
  margin: 0 10px;
}

/* ==================== 3. 作品网格布局 ==================== */
.works-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.works-grid__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 16px;
}

/* 响应式断点 */
@media screen and (max-width: 1200px) {
  .works-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 900px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 600px) {
  .works-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== 4. 作品卡片 ==================== */
.work-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.work-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 图片区域 */
.work-card__image {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 比例 */
  background-color: #f0f0f0;
  overflow: hidden;
}

.work-card__placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #bbb;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.work-card__image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 状态标签 */
.work-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 4px;
  color: #fff;
}

.work-card__badge--available {
  background-color: #52c41a;
}

.work-card__badge--presale {
  background-color: #1890ff;
}

.work-card__badge--limited {
  background-color: #faad14;
  color: #333;
}

.work-card__badge--soldout {
  background-color: #999;
}

/* 卡片主体 */
.work-card__body {
  padding: 16px;
}

.work-card__title {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.4;
  /* 限制两行 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-card__event {
  font-size: 12px;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.work-card__desc {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 12px;
  /* 限制两行 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.work-card__size {
  font-size: 12px;
  color: #999;
}

.work-card__price {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary-color);
}

/* 操作按钮 */
.work-card__actions {
  display: flex;
  gap: 8px;
}

.work-card__btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.work-card__btn--detail {
  background-color: #f5f5f5;
  color: var(--text-main);
}

.work-card__btn--detail:hover {
  background-color: #e8e8e8;
}

.work-card__btn--buy {
  background-color: var(--primary-color);
  color: #fff;
}

.work-card__btn--buy:hover {
  background-color: var(--primary-hover);
}

/* ==================== 5. 模态弹层 ==================== */
.work-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.work-modal.active {
  display: flex;
}

.work-modal__content {
  position: relative;
  display: flex;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.work-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.work-modal__close:hover {
  background-color: rgba(0, 0, 0, 0.2);
  color: #333;
}

/* 弹层图片区域 */
.work-modal__image {
  flex: 0 0 45%;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-modal__placeholder {
  font-size: 24px;
  color: #ccc;
}

.work-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 弹层信息区域 */
.work-modal__info {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

.work-modal__badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 4px;
  color: #fff;
  margin-bottom: 12px;
}

.work-modal__badge--available {
  background-color: #52c41a;
}

.work-modal__badge--presale {
  background-color: #1890ff;
}

.work-modal__badge--limited {
  background-color: #faad14;
  color: #333;
}

.work-modal__badge--soldout {
  background-color: #999;
}

.work-modal__title {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.3;
}

.work-modal__event {
  font-size: 14px;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.work-modal__desc {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 24px;
}

/* 规格信息 */
.work-modal__specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.work-modal__spec {
  padding: 12px;
  background-color: #f9f9f9;
  border-radius: 6px;
}

.work-modal__spec dt {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.work-modal__spec dd {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-main);
}

.work-modal__btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  background-color: var(--primary-color);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.work-modal__btn:hover {
  background-color: var(--primary-hover);
}

.work-modal__notice {
  padding: 16px;
  background-color: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 6px;
  font-size: 14px;
  color: #d48806;
  text-align: center;
}

/* 弹层响应式 */
@media screen and (max-width: 768px) {
  .work-modal__content {
    flex-direction: column;
    max-height: 95vh;
  }

  .work-modal__image {
    flex: 0 0 200px;
  }

  .work-modal__info {
    padding: 24px;
  }

  .work-modal__specs {
    grid-template-columns: 1fr;
  }
}

/* ==================== 6. 工具条响应式 ==================== */
@media screen and (max-width: 768px) {
  .works-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .works-toolbar__divider {
    display: none;
  }

  .works-header__title {
    font-size: 24px;
  }

  .works-header__title span {
    display: block;
    margin-left: 0;
    margin-top: 5px;
  }
}
