/* ==========================================================================
   友情链接页
   依赖 styles.css 提供的 .main-page 白卡片
   ========================================================================== */

.friends-page {
    --line: #e7e0d2;
    --ink: #1a1815;
    --ink-2: #45403a;
    --muted: #8b8477;
    --serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", "SimSun", Georgia, serif;
}

/* ---------------------------------------------------------------- 标题区 */
.friends-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ink);
}

.friends-head h1 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--ink);
}

.friends-head .sub {
    margin: 0;
    color: var(--muted);
    font-size: 0.66rem;
    letter-spacing: 0.28em;
    white-space: nowrap;
}

.friends-intro {
    margin: 1.1rem 0 1.8rem;
    color: #6b655c;
    font-size: 0.92rem;
    line-height: 1.9;
}

/* ---------------------------------------------------------------- 友链卡片 */
.friend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.friend-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfaf7;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.friend-card a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.5rem 1rem 1.35rem;
    color: inherit;
    text-decoration: none;
}

.friend-card a:focus-visible {
    outline: 2px solid #9c3d2e;
    outline-offset: 3px;
    border-radius: 14px;
}

.friend-card img {
    width: 80px;
    height: 80px;
    margin-bottom: 0.35rem;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px #fff, 0 10px 20px -14px rgba(0, 0, 0, 0.55);
}

.friend-name {
    font-family: var(--serif);
    font-size: 1.02rem;
    letter-spacing: 0.06em;
    color: var(--ink);
}

.friend-desc {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    word-break: break-all;
    text-align: center;
}

.friend-card:hover {
    transform: translateY(-3px);
    border-color: #d9cfbc;
    box-shadow: 0 18px 32px -26px rgba(20, 30, 50, 0.5);
}

/* 空位 */
.friend-card.is-empty {
    background: transparent;
    border-style: dashed;
    border-color: #d9d1c2;
}

.friend-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 168px;
    padding: 1.5rem 1rem;
    border-radius: 14px;
    color: #a49b8c;
}

.friend-empty .friend-name {
    color: #a49b8c;
}

/* ---------------------------------------------------------------- 友链说明 */
.friend-note {
    margin-top: 2.8rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line);
}

.friend-note h2 {
    margin: 0 0 0.6rem;
    text-align: left;
    font-family: var(--serif);
    font-size: 1.12rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--ink);
}

.friend-note p {
    margin: 0 0 1rem;
    color: #6b655c;
    font-size: 0.88rem;
    line-height: 1.9;
}

.friend-meta {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.8rem;
}

.friend-meta > div {
    display: flex;
    gap: 0.4rem;
    align-items: baseline;
}

.friend-meta dt {
    flex: 0 0 3.2em;
    color: var(--muted);
    letter-spacing: 0.12em;
}

.friend-meta dd {
    margin: 0;
    color: var(--ink-2);
    word-break: break-all;
}

.friend-meta a {
    color: var(--ink-2);
    text-decoration: none;
    border-bottom: 1px solid #d9cfbc;
}

.friend-meta a:hover {
    color: #9c3d2e;
    border-bottom-color: #9c3d2e;
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 768px) {
    .friends-head {
        flex-direction: column;
        gap: 0.5rem;
    }

    .friend-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .friend-card img {
        width: 64px;
        height: 64px;
    }

    .friend-empty {
        min-height: 150px;
    }
}

@media (max-width: 420px) {
    .friend-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .friend-card a {
        padding: 1.1rem 0.5rem 1rem;
    }

    .friend-desc {
        font-size: 0.62rem;
        letter-spacing: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .friend-card {
        transition: none;
    }

    .friend-card:hover {
        transform: none;
    }
}
