/* =========================================
   Links Page Styles (友情链接样式)
   ========================================= */

/* Hero Section adjustments */
.hero {
  position: relative;
  height: 40vh;
  min-height: 350px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  margin-bottom: -3rem; /* overlap with content */
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-top: 1rem;
  letter-spacing: 1px;
  animation: fadeUpIn 1s ease forwards 0.3s;
  opacity: 0;
}

@keyframes fadeUpIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Main Container */
.links-container {
  max-width: 1200px;
  width: 90%;
  margin: 0 auto 6rem auto;
  position: relative;
  z-index: 10;
}

.links-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* Link Group Styles */
.link-group {
  padding: 2.5rem;
  border-radius: 20px;
}

.group-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.group-title-icon {
  color: var(--primary);
  font-size: 1.5rem;
  animation: pulse 2s infinite alternate;
}

/* Apply Section Styles (Foldable details) */
.link-apply-section {
  padding: 1.5rem 2.5rem;
  border-radius: 20px;
  margin-top: 3rem;
  transition: all 0.3s ease;
}

.link-apply-section[open] {
  padding-bottom: 2.5rem;
}

.apply-summary {
  margin-bottom: 0;
  border-bottom: none;
  cursor: pointer;
  list-style: none; /* Hide default arrow */
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 0;
  transition: all 0.3s;
}

.apply-summary::-webkit-details-marker {
  display: none;
}

.link-apply-section[open] .apply-summary {
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.apply-toggle-arrow {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
}

.link-apply-section[open] .apply-toggle-arrow {
  transform: rotate(180deg);
}

.apply-content {
  color: var(--text-main);
  line-height: 1.8;
  animation: fadeInDetails 0.4s ease-out;
}

@keyframes fadeInDetails {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.apply-desc {
  margin-bottom: 2rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border-left: 4px solid var(--primary);
  padding: 1.2rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.apply-info-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.step-header .step-title {
  margin-bottom: 0;
}

.copy-site-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.copy-site-btn:hover {
  background: rgba(var(--primary-rgb), 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.copy-site-btn.copied {
  background: rgba(50, 205, 50, 0.15);
  border-color: #32cd32;
  color: #32cd32;
}

.step-title {
  font-size: 1.2rem;
  color: var(--primary);
}

.step-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.step-list li {
  margin-bottom: 0.8rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.step-list li strong {
  color: var(--text-main);
  display: inline-block;
  width: 90px;
}

.step-email-hint {
  margin-bottom: 1rem;
  color: var(--text-main);
}

.apply-email {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 700;
}

/* Links Grid Layout */
.links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* Individual Link Card */
.link-card {
  display: flex;
  align-items: center;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.link-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 
              0 0 20px rgba(var(--primary-rgb), 0.2);
}

.link-card:hover::before {
  opacity: 1;
}

/* Avatar Style */
.link-avatar-wrap {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  margin-right: 1.2rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: transform 0.4s ease;
}

.link-card:hover .link-avatar-wrap {
  transform: rotate(5deg) scale(1.1);
}

.link-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-body);
  display: block;
}

.link-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
}

/* Link Info Text */
.link-info {
  position: relative;
  z-index: 1;
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.link-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.4rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

.link-card:hover .link-name {
  color: var(--primary);
}

.link-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* Empty State */
.empty-links {
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

@media (max-width: 1024px) {
  .links-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: 280px;
  }
  
  .links-grid {
    grid-template-columns: 1fr;
  }
  
  .link-group, .link-apply-section {
    padding: 1.5rem;
  }
  
  .apply-info-box {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
  }
}
