/* 前台样式 */

.friendly-links-container {
    margin: 20px 0;
    font-size: 14px; /* 设置基础字体大小 */
    line-height: 1.5; /* 设置基础行高 */
    color: #333; /* 设置基础文字颜色 */
}

/* 重置友情链接区域内的所有元素字体样式 */
.friendly-links-container * {
    font-size: inherit;
    line-height: inherit;
    font-weight: inherit;
}

/* 确保链接样式的一致性 */
.friendly-links-container a {
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-decoration: none;
}

/* 防止主题样式影响友情链接区域 */
.friendly-links-container h1,
.friendly-links-container h2,
.friendly-links-container h3,
.friendly-links-container h4,
.friendly-links-container h5,
.friendly-links-container h6 {
    font-size: inherit;
    font-weight: normal;
    margin: 0;
    padding: 0;
}

/* 确保所有文本元素使用相同的字体大小 */
.friendly-links-container p,
.friendly-links-container span,
.friendly-links-container div,
.friendly-links-container a {
    font-size: inherit !important; /* 强制继承字体大小 */
    font-weight: inherit;
    line-height: inherit;
}

/* 特别针对申请链接的样式优化 */
.friendly-links-apply-link {
    font-size: inherit !important; /* 强制使用继承的字体大小 */
    font-weight: normal !important; /* 确保字体粗细正常 */
    vertical-align: baseline; /* 确保垂直对齐 */
}

/* 纯文字链接样式 */
.friendly-link-item {
    text-decoration: none;
    color: #0073aa;
    font-size: inherit; /* 继承父元素字体大小 */
    font-weight: normal; /* 确保字体粗细正常 */
    line-height: inherit; /* 继承行高 */
    transition: color 0.2s ease;
    white-space: nowrap;
    margin-right: 15px;
    display: inline; /* 确保内联显示 */
}

.friendly-link-item:hover {
    color: #005177;
    text-decoration: underline;
}

/* Logo链接样式 */
.friendly-links-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.friendly-link-logo {
    display: inline-block;
}

.friendly-link-logo a {
    text-decoration: none;
    display: block;
    transition: opacity 0.2s ease;
}

.friendly-link-logo a:hover {
    opacity: 0.8;
}

.friendly-link-logo img {
    max-width: 120px;
    max-height: 60px;
    border-radius: 4px;
    border: 1px solid #ddd;
    padding: 5px;
    background: #fff;
}

.friendly-link-logo .site-name {
    display: inline-block;
    padding: 8px 12px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    font-size: inherit; /* 继承父元素字体大小 */
    font-weight: normal; /* 确保字体粗细正常 */
    line-height: inherit; /* 继承行高 */
    white-space: nowrap;
}


/* 申请链接样式 */
.friendly-links-apply-link {
    color: #0073aa;
    text-decoration: none;
    font-size: inherit; /* 继承父元素字体大小 */
    font-weight: normal; /* 确保字体粗细正常 */
    line-height: inherit; /* 继承行高 */
    display: inline; /* 确保内联显示 */
    transition: color 0.2s ease;
}

.friendly-links-apply-link:hover {
    color: #005177;
    text-decoration: underline;
}

/* 申请按钮样式（保留用于其他用途） */
.friendly-links-apply-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-block;
    text-decoration: none;
}

.friendly-links-apply-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

/* 模态框样式 */
.friendly-links-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.friendly-links-modal .modal-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.friendly-links-modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    border-radius: 8px 8px 0 0;
}

.friendly-links-modal .modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.friendly-links-modal .close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.friendly-links-modal .close:hover,
.friendly-links-modal .close:focus {
    color: #000;
    text-decoration: none;
}

/* 模态框内表单样式 */
.friendly-links-modal .friendly-links-form {
    padding: 20px;
    display: block;
}

.friendly-links-modal .form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.friendly-links-modal .form-group:last-child {
    margin-bottom: 0;
    text-align: right;
}

.friendly-links-modal label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.friendly-links-modal .required {
    color: #d63638;
}

.friendly-links-modal input,
.friendly-links-modal textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.friendly-links-modal input:focus,
.friendly-links-modal textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.submit-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-right: 10px;
}

.submit-btn:hover {
    background: #005a87;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cancel-btn:hover {
    background: #545b62;
}

.form-message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error-message {
    color: #d63638;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #d63638;
    box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .friendly-links-container {
        font-size: 13px; /* 移动端稍微小一点的字体 */
    }
    
    .friendly-link-item {
        margin-right: 10px;
        margin-bottom: 5px;
        display: inline-block;
    }
    
    .friendly-links-logos {
        justify-content: center;
    }
    
    .friendly-link-logo img {
        max-width: 100px;
        max-height: 50px;
    }
    
    .friendly-links-modal .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .friendly-links-modal .modal-header {
        padding: 15px;
    }
    
    .friendly-links-modal .friendly-links-form {
        padding: 15px;
    }
    
    .friendly-links-modal .form-group:last-child {
        text-align: center;
    }
    
    .friendly-links-modal .submit-btn,
    .friendly-links-modal .cancel-btn {
        width: 100%;
        margin: 5px 0;
    }
}
