/* members.css - 网格布局版本 */
.page-header {
  padding: 60px 0 40px;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.05)"/></svg>');
  background-size: cover;
}

.page-header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: #fff;
}

.page-description {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
  color: #cbd5e1;
  max-width: 600px;
}

/* ========================================
✅ 核心修改：网格布局容器
======================================== */
.members-grid-container {
  width: 100%;
  padding: 40px 0;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* PC端一行4个 */
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========================================
✅ 卡片样式 - 保留所有原有3D翻转+特效
======================================== */
.cool-card {
  perspective: 2000px;
  width: 100%;
  height: 420px;
  cursor: pointer;
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.cool-card:hover {
  transform: translateZ(20px) scale(1.05);
  z-index: 5;
}

.cool-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.cool-card-front,
.cool-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 20px;
  overflow: hidden;
  box-sizing: border-box;
}

.cool-card:hover .cool-card-inner {
  transform: rotateY(180deg);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cool-card-front {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  padding: 25px;
  position: relative;
}

.cool-card-front::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 70%
  );
  transform: rotate(45deg);
  animation: shine 3s infinite linear;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.cool-avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 15px;
}

.cool-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.cool-avatar-glow {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(45deg, #4f46e5, #8b5cf6, #ec4899);
  border-radius: 50%;
  filter: blur(15px);
  opacity: 0.5;
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  0% {
    opacity: 0.3;
    transform: scale(0.95);
  }
  100% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

.cool-role-badge {
  position: absolute;
  bottom: 5px;
  right: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  z-index: 3;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.role-admin {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}
.role-vice-admin {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.role-member {
  background: linear-gradient(135deg, #10b981, #059669);
}

.cool-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 5px;
  background: linear-gradient(45deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cool-position {
  font-size: 1rem;
  color: #4f46e5;
  font-weight: 600;
  margin-bottom: 10px;
}

.cool-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.cool-bio p {
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 20px;
}

.cool-stats {
  display: flex;
  justify-content: space-around;
}

.cool-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.cool-stat i {
  font-size: 1.2rem;
  color: #4f46e5;
}

.cool-stat span {
  font-size: 0.85rem;
  color: #94a3b8;
}

.cool-hover-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 0.9rem;
  animation: pulse 2s infinite;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 15px;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

.cool-card-back {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(79, 70, 229, 0.3);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: 25px;
}

.cool-back-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cool-back-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(45deg, #4f46e5, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cool-back-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 5px;
}

.cool-detail-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.cool-detail-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.cool-detail-item:hover {
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(79, 70, 229, 0.3);
  transform: translateX(5px);
}

.cool-detail-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.cool-detail-label {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 3px;
}

.cool-detail-value {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.cool-back-bio {
  margin-top: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cool-bio-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  text-align: left;
}

.cool-bio-text {
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: left;
}

.cool-back-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.cool-action-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.message-btn {
  background: linear-gradient(135deg, #4f46e5, #8b5cf6);
  color: white;
}

.message-btn:hover {
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(79, 70, 229, 0.4);
}

.profile-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

.cool-back-body::-webkit-scrollbar {
  width: 6px;
}
.cool-back-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}
.cool-back-body::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #4f46e5, #8b5cf6);
  border-radius: 3px;
}

/* ========================================
✅ 响应式适配 - 移动端优化
======================================== */
@media (max-width: 1200px) {
  .members-grid {
    grid-template-columns: repeat(3, 1fr); /* 中等屏幕一行3个 */
    gap: 25px;
  }
}

@media (max-width: 992px) {
  .members-grid {
    grid-template-columns: repeat(2, 1fr); /* 平板端一行2个 */
    gap: 20px;
  }

  .cool-card {
    height: 380px;
  }

  .cool-avatar-wrapper {
    width: 100px;
    height: 100px;
  }

  .cool-name {
    font-size: 1.3rem;
  }
}

@media (max-width: 768px) {
  .page-title {
    font-size: 2.2rem;
  }

  .members-grid {
    grid-template-columns: repeat(2, 1fr); /* 移动端一行2个 */
    gap: 12px;
    padding: 0 10px;
  }

  .cool-card {
    height: 340px;
    min-width: 0; /* 确保卡片可以缩小 */
  }

  .cool-avatar-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
  }

  /* 修复移动端角色徽章位置 */
  .cool-role-badge {
    bottom: -5px;
    right: -5px;
    padding: 4px 8px;
    font-size: 0.7rem;
  }

  .cool-name {
    font-size: 1.1rem;
  }

  .cool-position {
    font-size: 0.9rem;
  }

  .cool-card-front,
  .cool-card-back {
    padding: 15px;
  }

  .cool-bio p {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .cool-stat {
    gap: 3px;
  }

  .cool-stat i {
    font-size: 1rem;
  }

  .cool-stat span {
    font-size: 0.75rem;
  }

  .cool-hover-hint {
    font-size: 0.8rem;
    padding: 6px;
    margin-top: 10px;
  }

  .cool-back-actions {
    flex-direction: column;
    gap: 8px;
  }

  .cool-action-btn {
    padding: 10px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .page-header {
    padding: 30px 0 15px;
  }

  .page-title {
    font-size: 1.4rem;
  }

  .page-description {
    font-size: 0.9rem;
  }

  .members-grid {
    grid-template-columns: repeat(2, 1fr); /* 480px以下也一行2个 */
    gap: 8px;
    padding: 0 6px;
  }

  .cool-card {
    height: 300px;
    min-width: 0;
  }

  .cool-avatar-wrapper {
    width: 60px;
    height: 60px;
    margin: 0 auto 8px;
  }

  /* 修复小屏幕角色徽章位置 */
  .cool-role-badge {
    bottom: -8px;
    right: -8px;
    padding: 3px 6px;
    font-size: 0.6rem;
  }

  .cool-name {
    font-size: 1rem;
    margin-bottom: 3px;
  }

  .cool-position {
    font-size: 0.8rem;
    margin-bottom: 8px;
  }

  .cool-card-front,
  .cool-card-back {
    padding: 10px;
  }

  .cool-bio p {
    font-size: 0.75rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    margin: 0 0 10px;
    line-height: 1.4;
  }

  .cool-stats {
    justify-content: space-between;
  }

  .cool-stat {
    gap: 2px;
  }

  .cool-stat i {
    font-size: 0.8rem;
  }

  .cool-stat span {
    font-size: 0.65rem;
  }

  .cool-hover-hint {
    font-size: 0.7rem;
    padding: 4px;
    margin-top: 8px;
    gap: 5px;
  }

  .cool-hover-hint i {
    font-size: 0.7rem;
  }

  .cool-back-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
  }

  .cool-back-title {
    font-size: 1.1rem;
  }

  .cool-detail-list {
    gap: 10px;
    margin-bottom: 15px;
  }

  .cool-detail-item {
    padding: 8px;
    gap: 10px;
  }

  .cool-detail-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .cool-detail-label {
    font-size: 0.7rem;
  }

  .cool-detail-value {
    font-size: 0.85rem;
  }

  .cool-back-bio {
    margin-top: 15px;
    padding: 10px;
  }

  .cool-bio-title {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  .cool-bio-text {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .cool-back-actions {
    gap: 6px;
    margin-top: 15px;
  }

  .cool-action-btn {
    padding: 8px;
    font-size: 0.75rem;
    gap: 5px;
  }

  .cool-action-btn i {
    font-size: 0.8rem;
  }
}

/* 超小屏幕适配 */
@media (max-width: 360px) {
  .members-grid {
    grid-template-columns: 1fr; /* 超小屏幕一行1个 */
    gap: 10px;
    padding: 0 5px;
  }

  .cool-card {
    height: 280px;
  }

  .cool-avatar-wrapper {
    width: 55px;
    height: 55px;
  }

  /* 修复超小屏幕角色徽章位置 */
  .cool-role-badge {
    bottom: -10px;
    right: -10px;
    padding: 2px 4px;
    font-size: 0.55rem;
  }

  .cool-name {
    font-size: 0.95rem;
  }

  .cool-position {
    font-size: 0.75rem;
  }

  .cool-bio p {
    font-size: 0.7rem;
  }
}
