h2 {
    padding: 40px 100px;
    color: #fff;
}

hr {
    width: 87%;
    margin: 0 auto; /* 左右自動邊距置中 */
    border: 1px solid #ccc; /* 線條顏色 */
}

.friends-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, 250px);
  gap: 30px; /* 卡片間距 */
  padding: 40px 100px;
  position: relative;
  z-index: 2;
  justify-content: start; /* 靠左排列，不撐滿整行 */
}

/* 單一卡片 */
.friend-card {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(6px);
  border-radius: 4px;
  padding: 50px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid transparent; /* 預設透明，hover 才出現白框 */
}

.friend-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.35);
}

.friend-card::before,
.friend-card::after {
  content: "";
  position: absolute;
  background: #fff;
  z-index: 2;
}

/* 上下兩條線 */
.friend-card::before {
  top: -2px;
  left: 0;
  height: 2px;
  width: 0; /* 初始長度 0 */
  transition: width 0.4s ease;
}

.friend-card::after {
  bottom: -2px;
  right: 0;
  height: 2px;
  width: 0;
  transition: width 0.4s ease;
}

.friend-card:hover::before {
  width: 100%; /* 滑鼠靠近時拉滿上邊線 */
}

.friend-card:hover::after {
  width: 100%; /* 滑鼠靠近時拉滿下邊線 */
}

/* 左右兩條線 */
.friend-card span.line-left,
.friend-card span.line-right {
  position: absolute;
  width: 2px;
  height: 0;
  background: #fff;
  top: -2px;
  transition: height 0.4s ease;
}

.friend-card span.line-left {
  left: -2px;
}

.friend-card span.line-right {
  right: -2px;
}

.friend-card:hover span.line-left,
.friend-card:hover span.line-right {
    height: calc(100% + 4px); /* 原本 4px + 1px */
}

/* 朋友大頭照 */
.friend-card .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: relative;
}

/* 文字 */
.friend-card h3 {
  margin: 20px 0 5px;
  font-size: 1.3rem;
  color: #fff;
}

.friend-card p {
  font-size: 1rem;
  color: #ccc;
  margin-bottom: 15px;
}

/* 按鈕 */
.friend-card .btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.3s ease;
}

@keyframes twinkle {
  from { opacity: 0.2; }
  to { opacity: 1; }
}
