/* ============================================================
   friends.css
   ============================================================ */

/* ---------- 统计信息 ---------- */
.friends-stats {
    margin: 20px 0 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 10px;
    display: inline-block;
}

/* ---------- 友链网格 ---------- */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
    margin: 32px 0 20px;
}

/* ---------- 友链卡片 ---------- */
.friend-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.7), rgba(255,255,255,0.4));
    background-color: rgba(255,255,255,0.45);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1),
                box-shadow 0.4s ease,
                border-color 0.3s ease,
                background 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04),
                inset 0 1px 0 rgba(255,255,255,0.6);
    backdrop-filter: blur(8px) saturate(1.1);
    -webkit-backdrop-filter: blur(8px) saturate(1.1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: friendFadeInUp 0.5s cubic-bezier(0.2, 0.9, 0.4, 1.1) forwards;

  background-blend-mode: overlay, normal;

}

.friend-card:nth-child(1) { animation-delay: 0.05s; }
.friend-card:nth-child(2) { animation-delay: 0.1s; }
.friend-card:nth-child(3) { animation-delay: 0.15s; }
.friend-card:nth-child(4) { animation-delay: 0.2s; }
.friend-card:nth-child(5) { animation-delay: 0.25s; }
.friend-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes friendFadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* 光泽扫光 */
.friend-card::after {
    content: '';
    position: absolute;
    left: -50%;
    top: -50%;
    width: 60%;
    height: 200%;
    transform: skewX(-25deg) translateX(-100%);
    background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.25), rgba(255,255,255,0));
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}
.friend-card:hover::after {
    transform: skewX(-25deg) translateX(250%);
}

.friend-card:hover,
.friend-card:focus-visible {
    border-color: var(--accent-color);
    box-shadow: 0 16px 32px -8px rgba(0,0,0,0.10),
                0 0 0 2px rgba(var(--accent-rgb, 180,91,99), 0.15);
    transform: translateY(-6px) scale(1.01);
    background: linear-gradient(145deg, rgba(255,255,255,0.85), rgba(255,255,255,0.55));
}

/* ---------- 暗色模式 ---------- */
[data-theme="dark"] .friend-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
    background-color: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4),
                inset 0 1px 0 rgba(255,255,255,0.04);
    backdrop-filter: blur(10px) saturate(0.9);
}
[data-theme="dark"] .friend-card:hover {
    border-color: var(--accent-light);
    box-shadow: 0 16px 32px -8px rgba(0,0,0,0.6),
                0 0 0 2px rgba(var(--accent-rgb, 78,168,255), 0.2);
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
}

/* ==========================================================
   头像区域
   ========================================================== */
.friend-avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    background: var(--tag-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 0 0 0.5px rgba(255,255,255,0.2),
                0 2px 8px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.friend-card:hover .friend-avatar {
    transform: scale(1.04);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb, 180,91,99), 0.15),
                0 4px 16px rgba(0,0,0,0.06);
}

.avatar-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}
.avatar-placeholder {
    width: 100%;
    height: 100%;
    /* 🔽 统一方形圆角 */
    border-radius: var(--radius-md, 12px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    background: var(--accent-color);
}
.avatar-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 🔽 统一方形圆角 */
    border-radius: var(--radius-md, 12px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ---------- 卡片文字 ---------- */
.friend-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.friend-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s, text-decoration 0.2s;
}
.friend-card:hover .friend-name {
    color: var(--accent-dark);
    text-decoration: underline;
    text-underline-offset: 4px;
}
.friend-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.friend-url {
    margin-top: 6px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
    text-align: right;
    font-family: var(--font-mono, monospace);
    transition: opacity 0.2s, color 0.2s;
    word-break: break-all;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
.friend-url::before {
    content: "🔗";
    font-size: 0.65rem;
    opacity: 0.6;
    filter: grayscale(0.3);
}
.friend-card:hover .friend-url {
    opacity: 0.95;
    color: var(--accent-color);
}
.friend-card:hover .friend-url::before {
    filter: grayscale(0);
}

/* ---------- 信息卡片（申请区） ---------- */
.info-card {
    background: var(--surface-color-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: 28px 32px;
    margin: 32px 0 28px;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}
.info-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-light);
}
.info-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 20px;
    letter-spacing: -0.3px;
    border-left: 4px solid var(--accent-color);
    padding-left: 18px;
}
.requirements-section {
    margin: 8px 0 32px 0;
}
.section-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
}
.section-subtitle::before {
    content: '';
    width: 6px;
    height: 22px;
    background: var(--accent-color);
    border-radius: 4px;
    display: inline-block;
}
.requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 12px;
}
.requirement-item {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 20px 18px;
    transition: all 0.25s ease;
    border: 1px solid var(--border-light);
    backdrop-filter: blur(2px);
}
.requirement-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent-light);
    box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.12);
    background: var(--surface-color);
}
.requirement-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.2px;
}
.requirement-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    display: inline-block;
    opacity: 0.8;
}
.requirement-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* 我的信息 */
.myinfo-section {
    margin: 32px 0 20px;
    padding-top: 8px;
}
.myinfo-header {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.myinfo-header::before {
    content: '';
    width: 6px;
    height: 22px;
    background: var(--accent-color);
    border-radius: 4px;
    display: inline-block;
}
.info-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    background: var(--tag-bg);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    display: inline-block;
}

/* 代码块 */
.code-block-wrapper {
    background: var(--code-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin: 20px 0;
    overflow: hidden;
    position: relative;
    transition: all 0.2s;
}
.code-block-wrapper:hover {
    border-color: var(--accent-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.code-header {
    display: flex;
    justify-content: flex-end;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--border-light);
}
.copy-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 4px 14px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}
.copy-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-1px);
}
pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    background: transparent;
    font-size: 0.85rem;
}
code {
    font-family: var(--font-mono);
    color: var(--accent-color);
    background: transparent;
}

/* 警告 */
.warning-note {
    margin-top: 28px;
    padding: 14px 20px;
    background: rgba(180, 91, 99, 0.08);
    border-left: 3px solid var(--accent-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.warning-note:hover {
    background: rgba(180, 91, 99, 0.12);
}
.warning-note strong {
    color: var(--accent-color);
    font-weight: 600;
}

/* 致谢 */
.contact-note {
    margin-top: 48px;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}
.contact-note p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}
.contact-note a {
    color: var(--accent-color);
}
.contact-note a:hover {
    text-decoration: underline;
}

/* 空状态/加载/错误 */
.friends-empty,
.friends-loading,
.friends-error {
    text-align: center;
    padding: 60px 20px;
    background: var(--surface-color-secondary);
    border-radius: var(--radius-xl);
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
}
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   🎯 响应式断点优化
   ============================================================ */

/* --- 平板及以下 (≤ 1024px) --- */
@media (max-width: 1024px) {
    .friends-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 24px;
    }
    .friend-card {
        padding: 18px 20px;
        gap: 16px;
    }
    .friend-avatar {
        width: 72px;
        height: 72px;
    }
    .friend-name {
        font-size: 1.25rem;
    }
}

/* --- 手机横屏 / 小平板 (≤ 768px) --- */
@media (max-width: 768px) {
    .friends-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .friend-card {
        padding: 16px 20px;
        gap: 16px;
        flex-direction: row;
    }
    .friend-avatar {
        width: 68px;
        height: 68px;
    }
    .friend-name {
        font-size: 1.2rem;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
    .friend-desc {
        font-size: 0.85rem;
    }
    .friend-url {
        font-size: 0.65rem;
    }

    .info-card {
        padding: 20px 24px;
    }
    .info-title {
        font-size: 1.4rem;
    }
    .requirements-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .requirement-item {
        padding: 16px;
    }
}

/* --- 手机小屏 (≤ 480px) 纵向排列 --- */
@media (max-width: 480px) {
    .friends-grid {
        gap: 16px;
    }
    .friend-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 18px 16px;
        gap: 12px;
    }
    .friend-avatar {
        width: 72px;
        height: 72px;
        margin-bottom: 2px;
    }
    .friend-info {
        align-items: center;
        width: 100%;
    }
    .friend-name {
        font-size: 1.2rem;
        white-space: normal;
        text-align: center;
        width: 100%;
    }
    .friend-desc {
        text-align: center;
        font-size: 0.85rem;
        -webkit-line-clamp: 3;
    }
    .friend-url {
        text-align: center;
        justify-content: center;
        margin-top: 4px;
        font-size: 0.7rem;
    }
    .friend-url::before {
        content: "🔗";
    }

    .info-card {
        padding: 16px 18px;
    }
    .info-title {
        font-size: 1.3rem;
        padding-left: 14px;
    }
    .requirements-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .requirement-item {
        padding: 14px;
    }
    .section-subtitle {
        font-size: 1.05rem;
    }

    .code-header {
        justify-content: center;
    }
    pre {
        padding: 14px;
        font-size: 0.75rem;
    }
    .warning-note {
        font-size: 0.85rem;
        padding: 12px 16px;
    }
}

/* --- 超小屏 (≤ 360px) 额外微调 --- */
@media (max-width: 360px) {
    .friend-card {
        padding: 14px 12px;
    }
    .friend-avatar {
        width: 60px;
        height: 60px;
    }
    .friend-name {
        font-size: 1.05rem;
    }
    .friend-desc {
        font-size: 0.8rem;
    }
    .info-card {
        padding: 14px 12px;
    }
    .requirement-item {
        padding: 12px;
    }
}

/* ============================================================
   辅助工具类
   ============================================================ */
.text-center {
    text-align: center;
}
.mt-0 {
    margin-top: 0;
}
.mb-0 {
    margin-bottom: 0;
}

/* ============================================================
   友链覆盖层放大至全屏 (FriendLinkManager)
   ============================================================ */

.friend-link-overlay {
  position: fixed;
  z-index: 10000;
  transition: all 0.65s cubic-bezier(0.34, 1.2, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  /* 背景和模糊会在动画中设置，初始透明 */
}

/* 内容容器 - 居中，白色文字 */
.friend-link-content {
  color: #fff;
  max-width: 480px;
  width: 90%;
  text-align: center;
  position: relative;
  padding: 20px 0;
  pointer-events: none; /* 默认穿透，按钮单独启用 */
}

.friend-link-content button {
  pointer-events: auto;
}

/* 头像 */
.friend-link-avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,0.8);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
}
.friend-link-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.friend-link-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  color: white;
}

/* 文字信息 - 白色为主 */
.friend-link-name {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.friend-link-desc {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  margin: 0 0 12px 0;
  line-height: 1.6;
  text-shadow: 0 1px 8px rgba(0,0,0,0.15);
}
.friend-link-url {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  word-break: break-all;
  font-family: var(--font-mono);
  margin: 0 0 20px 0;
  background: rgba(255,255,255,0.1);
  padding: 6px 18px;
  border-radius: 40px;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
}

/* 提示语 & 倒计时 */
.friend-link-hint {
  font-size: 1.15rem;
  color: #fff;
  font-weight: 500;
  margin: 0 0 12px 0;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 12px rgba(0,0,0,0.25);
}
.friend-link-countdown {
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 28px;
  background: rgba(255,255,255,0.08);
  padding: 8px 20px;
  border-radius: 40px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
  display: inline-block;
}
.friend-link-countdown .countdown-number {
  font-weight: 700;
  color: #fff;
  font-size: 1.4rem;
  min-width: 28px;
  display: inline-block;
}

/* 主要按钮 */
.friend-link-go {
  background: #fff;
  color: var(--accent-color, #b45b63);
  border: none;
  padding: 12px 44px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  pointer-events: auto;
}
.friend-link-go:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 36px rgba(0,0,0,0.35);
}
.friend-link-go:active {
  transform: scale(0.95);
}