/**
 * 友链页：与主页 romantic 风格统一，层次与配色略作变化避免单调
 */
body.friends-page {
    align-items: stretch;
}

.friends-page {
    --fr-pink: #ff8fa3;
    --fr-rose: #e8a8c0;
    --fr-lilac: #c5b4e3;
    --fr-peach: #ffc9b8;
    --fr-mint: #b8e0d2;
    --fr-card-border: rgba(232, 168, 192, 0.45);
    min-height: 100vh;
    padding: 24px 16px 48px;
    font-family: "Comic Sans MS", "Microsoft YaHei", "PingFang SC", sans-serif;
    color: #37474f;
}

/* 与日历页 `.games-calendar-page .wrap` 一致：整体宽度 1200px 居中 */
.friends-page .fr-wrap {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.friends-page .fr-back {
    margin-bottom: 18px;
}

/* 标题区 + 主内容共用同一外框，避免左右边框各算各的导致标题栏视觉上多出一段 */
.friends-page .fr-stack {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 182, 193, 0.42);
    box-shadow:
        0 12px 40px rgba(232, 168, 192, 0.14),
        0 2px 0 rgba(255, 255, 255, 0.5) inset;
}

/* 顶栏：粉紫渐变（不再单独设左右外边框，宽与下方白区严格一致） */
.friends-page .fr-hero {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    min-height: 128px;
    padding: 22px 22px 24px;
    display: flex;
    align-items: flex-end;
    background:
        linear-gradient(135deg, rgba(255, 240, 245, 0.97) 0%, rgba(255, 228, 236, 0.95) 38%, rgba(243, 229, 245, 0.92) 72%, rgba(255, 248, 250, 0.98) 100%);
    border: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    box-sizing: border-box;
}

.friends-page .fr-hero::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -8%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 182, 193, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

.friends-page .fr-hero::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 143, 163, 0.45), rgba(197, 180, 227, 0.5), transparent);
    opacity: 0.85;
}

.friends-page .fr-hero-inner {
    position: relative;
    z-index: 1;
}

.friends-page .fr-hero-eyebrow {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: #b88a9a;
    text-transform: none;
}

.friends-page .fr-hero-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.15;
}

.friends-page .fr-hero-sub {
    margin: 10px 0 0;
    font-size: 0.82rem;
    color: #78909c;
    letter-spacing: 0.03em;
}

/* 主内容：半透明白台（顶部分隔线，与标题区同宽） */
.friends-page .fr-panel {
    position: relative;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    border-radius: 0;
    padding: 22px 22px 30px;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: none;
    box-sizing: border-box;
}

.friends-page .fr-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(255, 250, 252, 0.95), rgba(255, 245, 248, 0.88));
    border: 1px solid rgba(255, 182, 193, 0.28);
    box-shadow: 0 2px 8px rgba(255, 182, 193, 0.08);
}

.friends-page .fr-hint {
    margin: 0;
    font-size: 0.88rem;
    color: #546e7a;
    line-height: 1.55;
    flex: 1;
    min-width: 0;
}

.friends-page .fr-hint--placeholder {
    color: #b0bec5;
    font-style: italic;
}

.friends-page .fr-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    font-size: 0.92rem;
    font-weight: 500;
    color: #6a4a3c;
    background: linear-gradient(145deg, #fff8fa, #ffe4ec);
    border: 2px solid rgba(255, 182, 193, 0.55);
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 3px 12px rgba(255, 143, 163, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.friends-page .fr-copy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: rgba(233, 30, 99, 0.45);
    box-shadow: 0 6px 18px rgba(255, 143, 163, 0.28);
}

.friends-page .fr-copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.friends-page .fr-copy-btn.is-done {
    border-color: rgba(129, 199, 132, 0.65);
    color: #2e7d32;
    background: linear-gradient(145deg, #f1f8e9, #e8f5e9);
}

.friends-page .fr-grid {
    display: grid;
    /* minmax(0,1fr) 保证四列等宽，与日历网格一致对齐整页宽度 */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .friends-page .fr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .friends-page .fr-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .friends-page .fr-wrap {
        max-width: 100%;
    }
    .friends-page {
        padding: 12px 10px 40px;
    }
}

/* 友链卡片：基底 + nth _child 微色差 */
.friends-page .fr-card {
    display: block;
    text-decoration: none;
    border-radius: 14px;
    padding: 15px 16px;
    border: 2px solid var(--fr-card-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    color: inherit;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 252, 0.88));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    min-width: 0;
    box-sizing: border-box;
}

.friends-page .fr-card:nth-child(4n + 1) {
    border-color: rgba(255, 143, 163, 0.38);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(255, 245, 248, 0.9));
}

.friends-page .fr-card:nth-child(4n + 2) {
    border-color: rgba(197, 180, 227, 0.4);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.94), rgba(248, 245, 255, 0.88));
}

.friends-page .fr-card:nth-child(4n + 3) {
    border-color: rgba(255, 201, 184, 0.45);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 247, 0.9));
}

.friends-page .fr-card:nth-child(4n + 4) {
    border-color: rgba(184, 224, 210, 0.45);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.94), rgba(248, 255, 252, 0.88));
}

.friends-page .fr-card:hover:not(.fr-card--placeholder) {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(232, 168, 192, 0.22);
    border-color: rgba(233, 30, 99, 0.35);
}

.friends-page .fr-card--placeholder {
    cursor: default;
    border-style: dashed;
    opacity: 0.92;
}

.friends-page .fr-card--placeholder:nth-child(4n + 1) {
    border-color: rgba(255, 143, 163, 0.35);
}

.friends-page .fr-card--placeholder:nth-child(4n + 2) {
    border-color: rgba(197, 180, 227, 0.38);
}

.friends-page .fr-card--placeholder:nth-child(4n + 3) {
    border-color: rgba(255, 201, 184, 0.4);
}

.friends-page .fr-card--placeholder:nth-child(4n + 4) {
    border-color: rgba(184, 224, 210, 0.4);
}

.friends-page .fr-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.friends-page .fr-ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: cover;
    background: linear-gradient(145deg, #fff5f8, #fff0f3);
    border: 2px solid rgba(232, 168, 192, 0.4);
    box-shadow: 0 2px 6px rgba(255, 182, 193, 0.2);
}

.friends-page .fr-ico.fr-ico-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 600;
    color: #8b4a5c;
}

.friends-page .fr-ico--ph {
    background: linear-gradient(145deg, rgba(255, 245, 248, 0.8), rgba(243, 229, 245, 0.5));
    border-style: dashed;
    border-color: rgba(232, 168, 192, 0.45);
}

.friends-page .fr-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #37474f;
    line-height: 1.35;
    word-break: break-word;
}

.friends-page .fr-name--ph {
    color: #b0bec5;
    font-weight: 500;
}

.friends-page .fr-url {
    font-size: 0.78rem;
    color: #90a4ae;
    line-height: 1.45;
    word-break: break-all;
}

.friends-page .fr-url--ph {
    color: #cfd8dc;
}

/* 夜间：与全站 night / 图库夜间一致 */
body.night.friends-page {
    color: #e0e0f0;
}

body.night.friends-page .fr-stack {
    border-color: rgba(138, 138, 255, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

body.night.friends-page .fr-hero {
    background: linear-gradient(135deg, rgba(45, 45, 78, 0.95) 0%, rgba(38, 38, 68, 0.92) 50%, rgba(42, 42, 72, 0.94) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.night.friends-page .fr-hero::before {
    background: radial-gradient(circle, rgba(138, 138, 255, 0.2) 0%, transparent 70%);
}

body.night.friends-page .fr-hero::after {
    background: linear-gradient(90deg, transparent, rgba(255, 221, 133, 0.25), rgba(138, 138, 255, 0.3), transparent);
}

body.night.friends-page .fr-hero-eyebrow {
    color: #a0a0c8;
}

body.night.friends-page .fr-hero-sub {
    color: #9090c0;
}

body.night.friends-page .fr-panel {
    background: rgba(38, 38, 62, 0.55);
    border-top-color: rgba(255, 255, 255, 0.08);
}

body.night.friends-page .fr-toolbar {
    background: linear-gradient(145deg, rgba(40, 40, 72, 0.75), rgba(32, 32, 56, 0.65));
    border-color: rgba(138, 138, 255, 0.2);
}

body.night.friends-page .fr-hint {
    color: #b0b0d8;
}

body.night.friends-page .fr-hint--placeholder {
    color: #7070a0;
}

body.night.friends-page .fr-copy-btn {
    background: linear-gradient(145deg, rgba(55, 55, 95, 0.9), rgba(45, 45, 85, 0.85));
    border-color: rgba(138, 138, 255, 0.45);
    color: #e8e8ff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

body.night.friends-page .fr-copy-btn:hover:not(:disabled) {
    border-color: #8a8aff;
}

body.night.friends-page .fr-card {
    background: linear-gradient(165deg, rgba(42, 42, 68, 0.85), rgba(35, 35, 58, 0.8));
}

body.night.friends-page .fr-card:nth-child(4n + 1) {
    border-color: rgba(255, 143, 163, 0.28);
}

body.night.friends-page .fr-card:nth-child(4n + 2) {
    border-color: rgba(180, 170, 230, 0.3);
}

body.night.friends-page .fr-card:nth-child(4n + 3) {
    border-color: rgba(255, 183, 150, 0.28);
}

body.night.friends-page .fr-card:nth-child(4n + 4) {
    border-color: rgba(130, 200, 180, 0.28);
}

body.night.friends-page .fr-card:hover:not(.fr-card--placeholder) {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    border-color: rgba(138, 138, 255, 0.45);
}

body.night.friends-page .fr-name {
    color: #e8e8f8;
}

body.night.friends-page .fr-url {
    color: #9090c0;
}

body.night.friends-page .fr-ico {
    background: rgba(30, 30, 52, 0.85);
    border-color: rgba(138, 138, 255, 0.3);
}

body.night.friends-page .fr-ico.fr-ico-letter {
    color: #ffb3c6;
}

body.night.friends-page .fr-ico--ph {
    background: rgba(30, 30, 52, 0.6);
    border-color: rgba(138, 138, 255, 0.25);
}

body.night.friends-page .fr-name--ph {
    color: #7070a0;
}

body.night.friends-page .fr-url--ph {
    color: #505080;
}
