/* ===== 友情链接页面 ===== */
.friends-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}
.fl-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 24px;
}

/* 上半区并排 */
.fl-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

/* ===== 本站信息卡片 ===== */
.fl-site-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    color: var(--text);
    position: relative;
    overflow: hidden;
}
.fl-site-card::before {
    display: none;
}
.fl-site-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.fl-site-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}
.fl-site-meta {
    flex: 1;
}
.fl-site-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}
.fl-site-slogan {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.fl-site-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fl-site-field {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
}
.fl-site-label {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    min-width: 32px;
}
.fl-site-value {
    flex: 1;
    min-width: 0;
    word-break: break-all;
    font-size: 0.84rem;
    color: var(--text);
}
.fl-site-value a {
    color: var(--primary);
    text-decoration: none;
}
.fl-site-value a:hover {
    text-decoration: underline;
}

/* ===== 申请友链 ===== */
.fl-apply-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    display: flex;
    flex-direction: column;
}
.fl-apply-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.fl-apply-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}
.fl-apply-list li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.fl-apply-list li::before {
    content: '';
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 8px;
}

/* 合作伙伴区域标题 */
.fl-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
}

/* 友链卡片网格 */
.fl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.fl-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 14px;
}
.fl-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: var(--primary);
}
.fl-card-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
}
.fl-card-logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}
.fl-no-logo {
    font-size: 1.3rem;
    color: var(--text-muted);
}
.fl-card-info {
    flex: 1;
    min-width: 0;
}
.fl-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fl-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.fl-card-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 1rem;
    transition: transform 0.2s;
}
.fl-card:hover .fl-card-arrow {
    transform: translateX(3px);
    color: var(--primary);
}

/* 空状态 */
.fl-list-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.fl-list-empty-icon {
    font-size: 2.6rem;
    margin-bottom: 12px;
}
.fl-list-empty-text {
    font-size: 0.92rem;
}

/* 加载 */
.friends-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* 跳转确认弹窗 */
.fl-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.fl-confirm-box {
    background: var(--bg);
    border-radius: 14px;
    padding: 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    border: 1px solid var(--border);
}
.fl-confirm-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 14px;
}
.fl-confirm-url {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--primary);
    margin-bottom: 18px;
    font-family: monospace;
}
.fl-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.fl-confirm-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}
.fl-btn-cancel {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.fl-btn-cancel:hover { background: var(--border); }
.fl-btn-go {
    background: var(--primary);
    color: #fff;
}
.fl-btn-go:hover { opacity: 0.9; }

/* ===== 申请友链按钮 ===== */
.fl-apply-btn {
    margin-top: auto;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: var(--primary);
    color: #fff;
    transition: all 0.2s;
    width: 100%;
}
.fl-apply-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== 申请友链弹窗 ===== */
.fl-apply-dialog {
    background: var(--bg);
    border-radius: 16px;
    max-width: 480px;
    width: 92%;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    overflow: hidden;
}
.fl-apply-dialog-title {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 20px 24px 0;
    color: var(--text);
}
.fl-apply-dialog-body {
    padding: 20px 24px;
}
.fl-apply-dialog-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}
.fl-form-group {
    margin-bottom: 16px;
}
.fl-form-group:last-child {
    margin-bottom: 0;
}
.fl-form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.fl-form-required {
    color: #ef4444;
}
.fl-form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.fl-form-input:focus {
    border-color: var(--primary);
}
.fl-form-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}
.fl-form-textarea:focus {
    border-color: var(--primary);
}
.fl-form-row {
    display: flex;
    gap: 8px;
}
.fl-form-row .fl-form-input {
    flex: 1;
}
.fl-form-fetch-btn {
    flex-shrink: 0;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    transition: all 0.2s;
    white-space: nowrap;
}
.fl-form-fetch-btn:hover {
    background: var(--primary);
    color: #fff;
}
.fl-form-fetch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.fl-apply-submit-btn {
    padding: 9px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    background: var(--primary);
    color: #fff;
    font-weight: 500;
    transition: all 0.2s;
}
.fl-apply-submit-btn:hover { opacity: 0.9; }
.fl-apply-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 申请弹窗提示 */
.fl-apply-tip {
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    transition: all 0.3s;
    text-align: center;
}
.fl-tip-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.fl-tip-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.fl-tip-info { background: var(--bg-subtle); color: var(--text-secondary); border: 1px solid var(--border); }

/* 移动端适配 */
@media (max-width: 768px) {
    .friends-page { padding: 20px 16px; }
    .fl-top-row { grid-template-columns: 1fr; }
    .fl-grid { grid-template-columns: 1fr; }
    .fl-page-title { font-size: 1.3rem; }
    .fl-card { padding: 14px 16px; }
    .fl-site-card { padding: 22px; }
    .fl-apply-card { padding: 22px; }
}
