/* 友情链接展示页面样式 */

.friend-links-page {
  padding: 1rem;
  background-color: var(--color-bg-surface, #fff);
  border: 1px solid var(--color-border-light, #eee);
  border-radius: 8px;
  margin-top: 1rem;
}

/* 标题区 */
.fl-page-hero {
  padding-bottom: 0;
  border-bottom: none;
  text-align: center;
}

.fl-page-title {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.75rem;
}

.fl-page-lead {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

/* 触发按钮 */
.fl-open-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background-color: var(--color-primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
}

.fl-open-modal-btn:hover {
  background-color: var(--color-primary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(74, 140, 94, 0.22);
}

.fl-open-modal-btn:active {
  transform: translateY(0);
}

.fl-open-modal-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* ---------- 静态模态框 ---------- */
.fl-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.fl-modal.fl-modal-open {
  display: flex;
}

/* 遮罩层 */
.fl-modal-mask {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: fl-modal-mask-in 0.2s ease;
}

@keyframes fl-modal-mask-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 弹窗主体 */
.fl-modal-dialog {
  position: relative;
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  background-color: var(--color-bg-card);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fl-modal-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fl-modal-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 弹窗头部 */
.fl-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.fl-modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.fl-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.fl-modal-close:hover {
  background-color: var(--color-border-light);
  color: var(--color-text-primary);
}

.fl-modal-close:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* 弹窗体（可滚动） */
.fl-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.fl-modal-section-desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* 弹窗内表单去除自身外边距，避免双层卡片显得拥挤 */
.fl-modal-body .fl-submit-form-wrap {
  margin: 0;
  max-width: none;
  box-shadow: none;
  border: 1px solid var(--color-border-light);
}

/* ---------- 链接列表区（页面内直接显示） ---------- */
.fl-page-section {
  padding: 2rem 0 0;
  border-top: 1px solid var(--color-border-light);
  margin-top: 2rem;
}

.fl-page-heading {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
  padding-left: 0.625rem;
  border-left: 3px solid var(--color-primary);
}

.fl-page-section-intro {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
}

.fl-page-section .fl-list {
  margin: 0;
}

/* 响应式 */
@media (max-width: 480px) {
  .friend-links-page {
    padding: 0.75rem;
    margin-top: 0.5rem;
  }

  .fl-page-title {
    font-size: 1.5rem;
  }

  .fl-page-lead {
    font-size: 0.875rem;
  }

  .fl-open-modal-btn {
    width: 100%;
    padding: 0.7rem 1.5rem;
  }

  .fl-modal-dialog {
    width: 95%;
    max-height: 90vh;
    border-radius: 10px;
  }

  .fl-modal-header {
    padding: 0.85rem 1rem;
  }

  .fl-modal-body {
    padding: 1rem;
  }

  .fl-modal-title {
    font-size: 1rem;
  }

  .fl-page-section {
    padding: 1.5rem 0 0;
    margin-top: 1.5rem;
  }

  .fl-page-heading {
    font-size: 1.125rem;
  }
}

/* 深色模式微调 */
html.dark-theme .fl-modal-mask {
  background-color: rgba(0, 0, 0, 0.7);
}

html.dark-theme .fl-modal-close:hover {
  background-color: var(--color-border);
}
